summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/templates/clientlist.html
blob: 2b1f3f2b4b9c07f6503ae5e17eae35bdffcdf0d4 (plain) (blame)
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
<h2>{{lang_clientList}} ({{rowCount}})</h2>

<form method="post" action="?do=statistics" id="list-form">
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" name="redirect" value="?{{redirect}}">

<table class="stupidtable table table-condensed table-striped">
	<thead>
		<tr>
			<td></td>
			<td></td>
			<td class="text-right">
				<button type="button" class="btn btn-default btn-xs" onclick="popupFilter('lastseen')">
					<span class="glyphicon glyphicon-filter"></span>
				</button>
			</td>
			<td>
				<button type="button" class="btn btn-default btn-xs" onclick="popupFilter('kvmstate')">
					<span class="glyphicon glyphicon-filter"></span>
				</button>
			</td>
			<td class="text-right">
				<button type="button" class="btn btn-default btn-xs" onclick="popupFilter('gbram')">
					<span class="glyphicon glyphicon-filter"></span>
				</button>
			</td>
			<td class="text-right">
				<button type="button" class="btn btn-default btn-xs" onclick="popupFilter('hddgb')">
					<span class="glyphicon glyphicon-filter"></span>
				</button>
			</td>
			<td>
				<button type="button" class="btn btn-default btn-xs" onclick="popupFilter('realcores')">
					<span class="glyphicon glyphicon-filter"></span>
				</button>
			</td>
			<td>
				<button type="button" class="btn btn-default btn-xs" onclick="popupFilter('location')">
					<span class="glyphicon glyphicon-filter"></span>
				</button>
			</td>
		</tr>
		<tr>
			<th data-sort="string">
				<div class="checkbox checkbox-inline">
					<input type="checkbox" id="toggle-all">
					<label></label>
				</div>
				{{lang_machine}}
			</th>
			<th data-sort="ipv4">{{lang_address}}</th>
			<th data-sort="int" class="text-right">{{lang_lastSeen}}</th>
			<th data-sort="string">{{lang_kvmSupport}}</th>
			<th data-sort="int" class="text-right">{{lang_gbRam}}</th>
			<th data-sort="int" class="text-right">{{lang_tmpGb}}</th>
			<th data-sort="int">{{lang_cpuModel}}</th>
			<th data-sort="string">{{lang_location}}</th>
		</tr>
	</thead>
	<tbody>
		{{#rows}}
		<tr>
			<td data-sort-value="{{hostname}}" class="text-nowrap">
			<div class="checkbox checkbox-inline">
				<input type="checkbox" name="uuid[]" value="{{machineuuid}}" class="machine-checkbox">
				<label></label>
			</div>
			{{#hasnotes}}
				<span class="glyphicon glyphicon-exclamation-sign pull-right"></span>
			{{/hasnotes}}
			{{#state_OFFLINE}}
				<span class="glyphicon glyphicon-off" title="{{lang_machineOff}}"></span>
			{{/state_OFFLINE}}
			{{#state_IDLE}}
				<span class="glyphicon glyphicon-ok green" title="{{lang_machineIdle}}"></span>
			{{/state_IDLE}}
			{{#state_OCCUPIED}}
				<span class="glyphicon glyphicon-user red" title="{{lang_machineOccupied}}"></span>
			{{/state_OCCUPIED}}
			{{#state_STANDBY}}
			<span class="glyphicon glyphicon-off green" title="{{lang_machineStandby}}"></span>
			{{/state_STANDBY}}
				{{#link_details}}
				<a href="?do=Statistics&amp;uuid={{machineuuid}}">
				{{/link_details}}
					<b>{{hostname}}</b>
				{{#link_details}}
				</a>
				{{/link_details}}
				<div class="small">{{machineuuid}}</div>
			{{#rmmodule}}
				<div class="small">{{lang_runMode}}:
					<a class="slx-bold" href="?do=runmode&amp;module={{rmmodule}}">{{moduleName}}</a> / {{modeName}}
				</div>
			{{/rmmodule}}
			</td>
			<td data-sort-value="{{clientip}}"><b><a href="?do=Statistics&amp;show=list&amp;filters=subnet={{subnet}}">{{subnet}}</a>{{lastoctet}}</b><br>{{macaddr}}</td>
			<td data-sort-value="{{lastseen_int}}" class="text-right text-nowrap">{{lastseen}}</td>
			<td class="{{kvmclass}}">{{kvmstate}}</td>
			<td data-sort-value="{{gbram}}" class="text-right {{ramclass}}">{{gbram}}&thinsp;GiB</td>
			<td data-sort-value="{{gbtmp}}" class="text-right {{hddclass}}">
				{{gbtmp}}&thinsp;GiB
				{{#badsectors}}<div><span data-toggle="tooltip" title="{{lang_reallocatedSectors}}" data-placement="left">
					<span class="glyphicon glyphicon-exclamation-sign"></span>
					{{badsectors}}
				</span></div>{{/badsectors}}
				{{#nohdd}}<div>
					<span class="glyphicon glyphicon-hdd red"></span>
				</div>{{/nohdd}}
			</td>
			<td data-sort-value="{{realcores}}">{{lang_realCores}}: {{realcores}}<div class="small">{{cpumodel}}</div></td>
			<td data-sort-value="{{locationname}}">{{locationname}}</td>
		</tr>
		{{/rows}}
	</tbody>
</table>
	<div class="text-right buttonbar">
		<button type="reset" class="btn btn-default">
			<span class="glyphicon glyphicon-refresh"></span>
			{{lang_reset}}
		</button>
		{{#rebootcontrol}}
		{{#canShutdown}}
			<button type="submit" name="action" value="shutdownmachines" class="btn btn-danger btn-machine-action"
					  data-confirm="{{lang_shutdownConfirm}}" data-title="{{lang_shutdown}}">
				<span class="glyphicon glyphicon-off"></span>
				{{lang_shutdown}}
			</button>
		{{/canShutdown}}
		{{#canReboot}}
			<button type="submit" name="action" value="rebootmachines" class="btn btn-warning btn-machine-action"
					  data-confirm="#confirm-reboot">
				<span class="glyphicon glyphicon-repeat"></span>
				{{lang_reboot}}
			</button>
		{{/canReboot}}
		{{/rebootcontrol}}
		{{#canDelete}}
			<button type="submit" name="action" value="delmachines" class="btn btn-danger btn-machine-action"
					  data-confirm="{{lang_sureDeletePermanent}}">
				<span class="glyphicon glyphicon-trash"></span>
				{{lang_delete}}
			</button>
		{{/canDelete}}
	</div>
	<div class="hidden" id="confirm-reboot">
		<p>{{lang_rebootConfirm}}</p>
		<div class="checkbox">
			<input type="checkbox" name="kexec" value="1" id="kexec-input" form="list-form">
			<label for="kexec-input">{{lang_rebootKexecCheck}}</label>
		</div>
	</div>
</form>

<script type="application/javascript"><!--

document.addEventListener("DOMContentLoaded", function () {
	var $buttons = $('.btn-machine-action');
	var $fn = function () {
		$buttons.prop("disabled", $('.machine-checkbox:checked').length === 0);
	};
	var $boxes = $('.machine-checkbox');
	$boxes.change($fn);
	$("button[type=reset]").click(function() { setTimeout($fn, 1); });
	if (window && window.opera && window.opera.version && Number(window.opera.version()) < 13) {
		$(document).ready(function () {
			setTimeout(function () {
				$('div.checkbox > input.machine-checkbox').click().click();
			}, 1);
		});
	} else {
		$fn();
	}
	$('#toggle-all').click(function(e) {
		e.stopPropagation();
		$boxes.prop('checked', $(this).is(':checked'));
		$fn();
	});
});

//--></script>