summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/templates/machine-hdds.html
blob: 4d0409f9840777c6dd93d3bb6be76f6ccfc9709f (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
<h3>{{lang_hdds}}</h3>
<div class="row">
	{{#hdds}}
		<div class="col-md-6">
			<div class="panel panel-default">
				<div class="panel-heading">
					<b>{{s_ModelFamily}}</b> {{dev}}
				</div>
				<div class="panel-body">
					{{#s_DeviceModel}}
					<div>{{lang_modelNo}}: {{s_DeviceModel}}, {{lang_serialNo}}: {{s_SerialNumber}}</div>
					{{/s_DeviceModel}}
					{{#s_ReallocatedSectorCt}}
					<div class="red">{{lang_reallocatedSectors}}: {{s_ReallocatedSectorCt}}</div>
					{{/s_ReallocatedSectorCt}}
					{{#s_CurrentPendingSector}}
					<div class="red">{{lang_pendingSectors}}: {{s_CurrentPendingSector}}</div>
					{{/s_CurrentPendingSector}}
					{{#s_PowerOnHours}}
					<div>{{lang_powerOnTime}}: {{s_PowerOnHours}}&thinsp;{{lang_hours}} ({{PowerOnTime}})</div>
					{{/s_PowerOnHours}}
					{{#s_MediaandDataIntegrityErrors}}
					<div class="red">{{lang_mediaIntegrityErrors}}: {{s_MediaandDataIntegrityErrors}}</div>
					{{/s_MediaandDataIntegrityErrors}}
					<div class="row">
						<div class="col-sm-7">
							<table class="table table-condensed table-striped table-responsive">
								<tr>
									<th>{{lang_partName}}</th>
									<th class="text-right">{{lang_partSize}}</th>
									<th>{{lang_partType}}</th>
								</tr>
								{{#partitions}}
									<tr id="{{id}}">
										<td>{{name}}</td>
										<td class="text-right text-nowrap">{{size}}&thinsp;GiB</td>
										<td>{{type}}</td>
									</tr>
								{{/partitions}}
							</table>
							<div class="slx-bold">{{lang_total}}: {{size}}&thinsp;GiB</div>
						</div>
						<div class="col-sm-5">
							<canvas id="{{devid}}-chart" style="width:100%;height:250px"></canvas>
							<script type="text/javascript">
								document.addEventListener("DOMContentLoaded", function() {
									var data = {{{json}}};
									var sel = false;
									new Chart(document.getElementById('{{devid}}-chart').getContext('2d')).Pie(data, { 
										animation: false,
										tooltipTemplate: "<%if (label){%><%=label%><%}%>",
										customTooltips: function(tooltip) {
											if (sel !== false) sel.removeClass('info');
											if (!tooltip) {
												sel = false;
												return;
											}
											sel = $('#' + tooltip.text);
											sel.addClass('info');
										}
									});
								}, false);
							</script>
						</div>
					</div>
				</div>
			</div>
		</div>
	{{/hdds}}
</div>