hal/web-resource/sensor_overview.tmpl
Ziver Koc fc41b60386 Added relative timestamps
Former-commit-id: 5ea7e7519cbe1059d9595a82229b7c7de3ef17bf
2016-01-24 17:37:32 +01:00

34 lines
No EOL
1.2 KiB
Cheetah
Executable file

<h1 class="page-header">Sensor Overview</h1>
<div class="col-md-12">
<div class="panel panel-default drop-shadow">
<div class="panel-heading">Local Sensors</div>
<div class="panel-body">
<table class="table table-hover table-condensed">
<thead>
<th class="col-md-4">Name</th>
<th class="col-md-3">Type</th>
<th class="col-md-2">Data</th>
<th class="col-md-2">Last Update</th>
</thead>
{{#sensors}}
<tr>
<td><a href="?id={{.getId()}}">{{.getName()}}</a></td>
<td>{{.getDeviceData().getClass().getSimpleName()}}</td>
<td>{{.getDeviceData().getData()}}</td>
<td><span class="timestamp">{{.getDeviceData().getTimestamp()}}</span></td>
</tr>
{{/sensors}}
</table>
</div>
</div>
</div>
<script>
$(function (){
$(".toggle-switch").on("switchChange.bootstrapSwitch", function (event, state) {
$(this).closest('form').submit();
});
});
</script>