2011-06-07 13:26:45 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
2011-07-01 22:56:53 +00:00
|
|
|
source /mod/var/mongoose/lib/setup
|
|
|
|
require pkg.class
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2011-06-28 00:20:31 +00:00
|
|
|
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>
|
2011-06-07 13:26:45 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-06-28 00:20:31 +00:00
|
|
|
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>"
|
2011-06-07 13:26:45 +00:00
|
|
|
} else {
|
2011-06-28 00:20:31 +00:00
|
|
|
puts "<tr class=greenshade>"
|
2011-06-07 13:26:45 +00:00
|
|
|
}
|
|
|
|
|
2011-06-28 00:20:31 +00:00
|
|
|
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\"
|
2011-06-29 22:53:15 +00:00
|
|
|
action=[string tolower $type]
|
2011-06-28 00:20:31 +00:00
|
|
|
class=[string tolower $type]>$type</button></td>"
|
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
puts "</tr>"
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "</table>"
|
|
|
|
|