2011-06-07 13:26:45 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2011-09-02 19:50:10 +00:00
|
|
|
require system.class
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2012-05-21 20:23:41 +00:00
|
|
|
lassign [system diskspace] size used perc free fperc
|
2013-04-03 22:42:15 +00:00
|
|
|
set dsindex $($perc * 25 / 100 + 1)
|
|
|
|
if {$dsindex > 25} { set dsindex 25 }
|
|
|
|
set dsfile [format "%02d" $dsindex]
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2011-07-07 22:33:19 +00:00
|
|
|
# The HD model only has the USB images which are blue. I prefer the green
|
|
|
|
# one so use those if available.
|
|
|
|
if {[file exists /opt/share/images/blue/345_2_14_ST_HDD_01.png]} {
|
|
|
|
set prefix 345_2_14_ST_HDD
|
|
|
|
} else {
|
|
|
|
set prefix 345_1_27_ST_USB
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "
|
|
|
|
|
|
|
|
<span style=\"float: right;
|
|
|
|
background:url('/images/345_1_27_ST_USB_BG.png')
|
|
|
|
no-repeat\">
|
2013-04-03 22:42:15 +00:00
|
|
|
<img src=/images/${prefix}_$dsfile.png>
|
2011-07-07 22:33:19 +00:00
|
|
|
</span>
|
2011-06-07 13:26:45 +00:00
|
|
|
|
2011-07-07 22:33:19 +00:00
|
|
|
<span style=\"float: right\">
|
|
|
|
<br>
|
|
|
|
Total space: $size<br>
|
2012-05-21 20:23:41 +00:00
|
|
|
Used: $used ($perc%)<br>
|
|
|
|
Free: $free ($fperc%)
|
2011-07-07 22:33:19 +00:00
|
|
|
</span>
|
|
|
|
"
|
2011-06-07 13:26:45 +00:00
|
|
|
|