summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/templates/kvmstate.html
blob: 07ecd5581463db099c060848afabd241d8e4d22b (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
<div class="col-md-6">
	<div class="panel panel-default">
		<div class="panel-heading">
			{{lang_kvmStats}}
		</div>
		<div class="panel-body">
			<div class="row">
				<div class="col-sm-6">
					<table class="table table-condensed table-striped">
						<tr>
							<th>{{lang_kvmState}}</th>
							<th class="text-right">{{lang_machineCount}}</th>
						</tr>
						{{#rows}}
						<tr id="kvm{{kvmstate}}">
							<td class="text-left slx-nowrap"><a href="?do=Statistics&amp;filter=kvmstate&amp;argument={{kvmstate}}">{{kvmstate}}</a></td>
							<td class="text-right">{{count}}</td>
						</tr>
						{{/rows}}
					</table>
				</div>
				<div class="col-sm-6">
					<canvas id="kvmchart" style="width:100%;height:250px"></canvas>
					<script type="text/javascript">
						document.addEventListener("DOMContentLoaded", function() {
							var data = {{{json}}};
							var sel = false;
							new Chart(document.getElementById('kvmchart').getContext('2d')).Pie(data, { 
								animation: false,
								tooltipTemplate: "<%if (label){%><%=label%><%}%>",
								customTooltips: function(tooltip) {
									if (sel !== false) sel.removeClass('slx-bold');
									if (!tooltip) {
										sel = false;
										return;
									}
									sel = $('#kvm' + tooltip.text);
									sel.addClass('slx-bold');
								}
							});
						}, false);
					</script>
				</div>
			</div>
		</div>
	</div>
</div>