webif/var/mongoose/include/packages.jim
hummypkg 050cb611bf working on package system
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@209 2a923420-c742-0410-a762-8d5b09965624
2011-06-28 00:20:31 +00:00

58 lines
980 B
Plaintext
Executable File

#!/mod/bin/jimsh
source /mod/var/mongoose/lib/pkg.class
puts {
<style type=text/css>
.ui-button, .ui-button-text { padding: 0; font-size: 12px; }
</style>
<script type=text/javascript src=/js/packages.js></script>
<table class=borders>
<tr>
<th>Package</th>
<th>Installed</th>
<th>Avail</th>
<th>Description</th>
</tr>
}
set avail [pkg avail]
foreach name [lsort [array names avail]] {
set pkg [pkg load $name $avail($name)]
if {![$pkg is installed]} {
puts "<tr>"
} elseif {[$pkg is upgradable]} {
puts "<tr class=yellowshade>"
} else {
puts "<tr class=greenshade>"
}
puts "
<td>$name</td>
<td>[$pkg get installed]</td>
<td>[$pkg get latest]</td>
<td>[$pkg get descr]</td>
"
if {![$pkg is installed]} {
set type Install
} elseif {[$pkg is upgradable]} {
set type Upgrade
} else {
set type Remove
}
puts "<td align=center><button id=\"$name\"
class=[string tolower $type]>$type</button></td>"
puts "</tr>"
}
puts "</table>"