blob: efa3bad39a8f16edcd39d209091820766350c7dc (
plain) (
tree)
|
|
<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="stupidtable filter-col table table-condensed table-striped" data-filter-col="kvmstate">
<thead>
<tr>
<th data-sort="string">{{lang_kvmState}}</th>
<th data-sort="int" class="text-right">{{lang_machineCount}}</th>
</tr>
</thead>
<tbody>
{{#rows}}
<tr id="kvm{{kvmstate}}">
<td data-sort-value="{{kvmstate}}" class="text-left text-nowrap">
<a class="filter-val" data-filter-val="{{kvmstate}}" href="?do=Statistics&show=summary&filters={{query}}~,~kvmstate={{kvmstate}}">{{kvmstate}}</a>
</td>
<td class="text-right">{{count}}</td>
</tr>
{{/rows}}
</tbody>
</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>
|