summaryrefslogtreecommitdiffstats
path: root/health-system-html.lsp
blob: 7cc9287868c7c71ab3f52365617adf8a1ef90018 (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
<? local view = ... ?>

<h1>General health</h1>

<h2>System</h2>

<h3>Uptime</h3>
<pre><?= view.system.uptime ?></pre>

<h3>Time/TimeZone</h3>
<pre><?= view.system.date ?></pre>
<pre><?= view.system.timezone ?></pre>

<h3>Name</h3>
<pre><?= view.system.uname ?></pre>
<h3>Memory</h3>
<pre><?= view.system.memory.value ?></pre>

<TABLE STYLE="margin:0px;padding:0px;border:0px">
	<TR>
		<TD>0%</TD><TD WIDTH="<?= view.system.memory.used ?>%" STYLE="background:red;"><CENTER><? if ( tonumber(view.system.memory.used) > 10) then io.write(view.system.memory.used .. "%") end ?></CENTER></TD><TD WIDTH="<?= (100-view.system.memory.used) ?>%" STYLE="background:green;"><CENTER><? if ( 90 > tonumber(view.system.memory.used)) then io.write((100-view.system.memory.used) .. "%") end ?></CENTER></TD><TD>100%</TD>
	</TR>
</TABLE>
<TABLE STYLE="margin:0px;padding:0px;border:0px">
	<TR>
		<TD WIDTH="100px"><B><?= view.system.memory.used_label ?></B></TD><TD STYLE="background:red;" WIDTH="20px"></TD><TD WIDTH="70px"><B>=Used</B></TD><TD STYLE="background:green;" WIDTH="20px"></TD><TD><B>=Free</B></TD>
	</TR>
</TABLE>

<?
--[[ DEBUG INFORMATION
require("debugs")
io.write(debugs.variables(view))
--]]
?>