webif/var/mongoose/include/packages.jim
hummypkg 43db44d742 improve EPG search using drop-down options. Implement package management
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@210 2a923420-c742-0410-a762-8d5b09965624
2011-06-29 22:53:15 +00:00

59 lines
1015 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\"
action=[string tolower $type]
class=[string tolower $type]>$type</button></td>"
puts "</tr>"
}
puts "</table>"