webif/var/mongoose/include/packages.jim
hummypkg d1cfff8899 restructure requires, add initial plugin class and hook into settings
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@220 2a923420-c742-0410-a762-8d5b09965624
2011-07-01 22:56:53 +00:00

60 lines
1.0 KiB
Plaintext
Executable File

#!/mod/bin/jimsh
source /mod/var/mongoose/lib/setup
require 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>"