blob: b4a352fb63cdac76433fab16cdefd67041411dd6 (
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
|
<% local view = ... %>
<% html = require("acf.html") %>
<h1>System</h1>
<h2>Versions and names</h2>
<pre><%= html.html_escape(view.value.version.value) %></pre>
<pre><%= html.html_escape(view.value.uname.value) %></pre>
<h2>Uptime</h2>
<pre><%= html.html_escape(view.value.uptime.value) %></pre>
<h2>Time/TimeZone</h2>
<pre><%= html.html_escape(view.value.date.value) %></pre>
<pre><%= html.html_escape(view.value.timezone.value) %></pre>
<h2>Memory</h2>
<pre><%= html.html_escape(view.value.memory.value) %></pre>
<%
local function print_percent(val)
if (tonumber(val) > 10) then
io.write(html.html_escape(val) .. "%")
end
end
%>
<table style="margin:0px;padding:0px;border:0px">
<tr>
<td>0%</td>
<td width="<%= html.html_escape(view.value.memory.used) %>%"
style="background:red;border:2px solid black;border-right:none;">
<center><b><% print_percent(view.value.memory.used) %></b></center>
</td>
<td width="<%= html.html_escape(view.value.memory.buffers) %>%"
style="background:yellow;border:2px solid black;">
<center><b><% print_percent(view.value.memory.buffers) %></b></center>
</td>
<td width="<%= tonumber(view.value.memory.free) %>%"
style="background:#0c0;border:2px solid black;border-left:none;">
<center><b><% print_percent(view.value.memory.free) %></b></center>
</td>
<td>100%</td>
</tr>
</table>
<table style="margin:0px;padding:0px;border:0px;margin-top:5px;">
<tr>
<td width="100px"><b>Legend:</b></td>
<td style="background:red;;border:2px solid black;" width="20px"></td>
<td width="70px"><b>=Used</b></td>
<td style="background:yellow;;border:2px solid black;" width="20px"></td>
<td width="70px"><b>=buffers / Cached</b></td>
<td style="background:#0c0;border:2px solid black;" width="20px"></td>
<td><b>=Free</b></td>
</tr>
</table>
|