summaryrefslogtreecommitdiffstats
path: root/src/html/default.html
blob: db894b15a7a1e1a3df8e17a4ffdedbd64245e2fa (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
{% extends "base.html" %}

{% block css %}css/default.css{% endblock %}

{% block header %}
	<h1 class="bghost fghost">Glances running on {{ host.hostname }}</h1>
	<h2 class="bgsystem fgsystem">{{ system.os_name }} {{ system.platform }} {{ system.os_version }}</h2>
{% endblock %}

{% block cpu %}
	{% if cpu is defined %}
	<table>
		<thead>
			<tr>
				<th scope="col" class="bgcpu fgcpu"></th>
				<th scope="col" class="bgcpu fgcpu">Cpu <small>{{ (cpu.user + cpu.kernel + cpu.nice)|round(1) }}%</small></th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td class="bgcpu fgcpu">User</td>
				<td class="{{ cpu.user_color }}">{{ cpu.user|round(1) }}</td>
			</tr>
			<tr>
				<td class="bgcpu fgcpu">Kernel</td>
				<td class="{{ cpu.kernel_color }}">{{ cpu.kernel|round(1) }}</td>
			</tr>
			<tr>
				<td class="bgcpu fgcpu">Nice</td>
				<td class="{{ cpu.nice_color }}">{{ cpu.nice|round(1) }}</td>
			</tr>
		</tbody>
	</table>
	{% endif %}
{% endblock %}

{% block load %}
	{% if (load is defined) and (core is defined) %}
	<table>
		<thead>
			<tr>
				<th scope="col" class="bgload fgload"></th>
				<th scope="col" class="bgload fgload">Load <small>{{ core }}-Core</small></th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td class="bgload fgload">1 min</td>
				<td class="{{ load.min1_color }}">{{ load.min1|round(2) }}</td>
			</tr>
			<tr>
				<td class="bgload fgload">5 mins</td>
				<td class="{{ load.min5_color }}">{{ load.min5|round(2) }}</td>
			</tr>
			<tr>
				<td class="bgload fgload">15 mins</td>
				<td class="{{ load.min15_color }}">{{ load.min15|round(2) }}</td>
			</tr>
		</tbody>
	</table>
	{% endif %}
{% endblock %}

{% block mem %}
	{% if (mem is defined) and (memswap is defined) %}
	<table>
		<thead>
			<tr>
				<th scope="col" class="bgmem fgmem"></th>
				<th scope="col" class="bgmem fgmem">Mem</th>
				<th scope="col" class="bgmem fgmem">Swap</th>
				<th scope="col" class="bgmem fgmem">Real</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td class="bgmem fgmem">Total</td>
				<td>{{ mem.total|filesizeformat(binary = true) }}</td>
				<td>{{ memswap.total|filesizeformat(binary = true) }}</td>
				<td></td>
			</tr>
			<tr>
				<td class="bgmem fgmem">Used</td>
				<td>{{ mem.used|filesizeformat(binary = true) }}</td>
				<td class="{{ memswap.used_color }}">{{ memswap.used|filesizeformat(binary = true) }}</td>
				<td class="{{ mem.used_color }}">{{ (mem.used-mem.cache)|filesizeformat(binary = true) }}</td>
			</tr>
			<tr>
				<td class="bgmem fgmem">Free</td>
				<td>{{ mem.free|filesizeformat(binary = true) }}</td>
				<td>{{ memswap.free|filesizeformat(binary = true) }}</td>
				<td>{{ (mem.free+mem.cache)|filesizeformat(binary = true) }}</td>
			</tr>
		</tbody>
	</table>
	{% endif %}
{% endblock %}

{% block net %}
	{% if net is defined %}
	<table >
		<thead>
			<tr>
				<th scope="col" class="bgnet fgnet"></th>
				<th scope="col" class="bgnet fgnet">Net Rx &darr;</th>
				<th scope="col" class="bgnet fgnet">Net TX &uarr;</th>
			</tr>
		</thead>
		<tbody>
			{% for interface in net %}
				<tr>
					<td id="item">{{ interface.interface_name }}</td>
					{% if interface.rx == 0 %}
						<td>0</td>
					{% else %}
						<td>{{ (interface.rx*8)|filesizeformat(binary = true)|replace("Bytes", "bps")|replace("Byte", "bps")|replace("iB", "bps") }}</td>
					{% endif %}
					{% if interface.tx == 0 %}
						<td>0</td>
					{% else %}
						<td>{{ (interface.tx*8)|filesizeformat(binary = true)|replace("Bytes", "bps")|replace("Byte", "bps")|replace("iB", "bps") }}</td>
					{% endif %}
				</tr>
			{% endfor %}
		</tbody>
	</table>
	{% endif %}
{% endblock %}

{% block diskio %}
	{% if diskio is defined %}
	<table >
		<thead>
			<tr>
				<th scope="col" class="bgdiskio fgdiskio"></th>
				<th scope="col" class="bgdiskio fgdiskio">Disk Write &darr;</th>
				<th scope="col" class="bgdiskio fgdiskio">Disk Read &uarr;</th>
			</tr>
		</thead>
		<tbody>
			{% for disk in diskio %}
				<tr>
					<td id="item">{{ disk.disk_name }}</td>
					<td>{{ disk.write_bytes|filesizeformat(binary = true) }}</td>
					<td>{{ disk.read_bytes|filesizeformat(binary = true) }}</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>
	{% endif %}
{% endblock %}

{% block fs %}
	{% if fs is defined %}
	<table >
		<thead>
			<tr>
				<th scope="col" class="bgdiskio fgdiskio"></th>
				<th scope="col" class="bgdiskio fgdiskio">FS Size</th>
				<th scope="col" class="bgdiskio fgdiskio">FS Used</th>
			</tr>
		</thead>
		<tbody>
			{% for mount in fs %}
				<tr>
					<td id="item">{{ mount.mnt_point }}</td>
					<td>{{ mount.size|filesizeformat(binary = true) }}</td>
					<td class="{{ mount.used_color }}">{{ mount.used|filesizeformat(binary = true) }}</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>
	{% endif %}
{% endblock %}

{% block proccount %}
	{% if (proccount is defined) %}
	<table>
		<thead>
			<tr>
				<th scope="col" class="bgproc fgproc"></th>
				<th scope="col" class="bgproc fgproc">Total</th>
				<th scope="col" class="bgproc fgproc">Running</th>
				<th scope="col" class="bgproc fgproc">Sleep</th>
				<th scope="col" class="bgproc fgproc">Other</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td  id="item">Process</td>
				<td>{{ proccount.total }}</td>
				<td>{{ proccount.running }}</td>
				<td>{{ proccount.sleeping }}</td>
				<td>{{ proccount.total-proccount.running-proccount.sleeping }}</td>
			</tr>
		</tbody>
	</table>
	{% endif %}
{% endblock %}

{% block proclist %}
	{% if proclist is defined %}
	<table >
		<thead>
			<tr>
				<th scope="col" class="bgproc fgproc">CPU %</th>
				<th scope="col" class="bgproc fgproc">Mem virt.</th>
				<th scope="col" class="bgproc fgproc">Mem resi.</th>
				<th scope="col" class="bgproc fgproc">Command</th>
			</tr>
		</thead>
		<tbody>
			{% for proc in proclist %}
				{% if loop.index > 10 %}
					{% break %}
				{% endif %}
				<tr>
					<td>{{ proc.cpu_percent }}</td>
					<td>{{ proc.proc_size|filesizeformat(binary = true) }}</td>
					<td>{{ proc.proc_resident|filesizeformat(binary