summaryrefslogtreecommitdiffstats
path: root/health-storage-html.lsp
blob: cd9162e49f1d269d0433aac27eea24a0814cea2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<% local view = ... %>

<% displaydisk = function(disk, name)
io.write("<pre>"..disk.value.."</pre>\n")
io.write('<TABLE STYLE="margin:0px;padding:0px;border:0px">\n')
io.write("	<TR>\n")
io.write("		<TD>0%</TD>\n")
if tonumber(disk.used) > 0 then
	io.write('		<TD WIDTH="'..disk.used..'%" STYLE="background:red;border:2px solid black;')
	if tonumber(disk.used) < 100 then io.write('border-right:none;') end
	io.write('"><CENTER><B>')
	if ( tonumber(disk.used) > 10) then io.write(disk.used .. "%") end
	io.write('</B></CENTER></TD>\n')
end
if tonumber(disk.used) < 100 then
	io.write('		<TD WIDTH="'..(100-disk.used)..'%" STYLE="background:#0c0;border:2px solid black;')
	if tonumber(disk.used) > 0 then io.write('border-left:none;') end
	io.write('"><CENTER><B>')
	if ( 90 > tonumber(disk.used)) then io.write((100-disk.used) .. "%") end
	io.write('</B></CENTER></TD>\n')
end
io.write('		<TD>100%</TD>\n')
io.write("	</TR>\n")
io.write("</TABLE>\n")
io.write('<TABLE STYLE="margin:0px;padding:0px;border:0px;margin-top:5px;">\n')
io.write("	<TR>\n")
io.write('		<TD WIDTH="100px"><B>'..name..'</B></TD><TD STYLE="background:red;border:2px solid black;" WIDTH="20px"></TD><TD WIDTH="70px"><B>=Used</B></TD><TD STYLE="background:#0c0;border:2px solid black;" WIDTH="20px"></TD><TD><B>=Free</B></TD>\n')
io.write("	</TR>\n")
io.write("</TABLE>\n")
end %>

<h1>Storage</h1>

<h2>Floppy capacity</h2>
<% if (view.value.floppy) then
for name,floppy in pairs(view.value.floppy.value) do
	displaydisk(floppy, name)
end
else %>
No Floppy mounted
<% end %>

<h2>Harddrive capacity</h2>
<% if (view.value.hd) then 
for name,hd in pairs(view.value.hd.value) do
	displaydisk(hd, name)
end
else %>
No Harddrive mounted
<% end %>

<h2>RAM Disk capacity</h2>
<% if (view.value.ramdisk) then 
for name,ramdisk in pairs(view.value.ramdisk.value) do
	displaydisk(ramdisk, name)
end
else %>
No RAM Disk mounted
<% end %>

<% if view.value.partitions then %>
<h2>Disk partitions</h2>
<pre><%= view.value.partitions.value %></pre>
<% end %>