Update status_ui.go and status.html
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 15px">#</th>
|
||||
<th>Plug name</th>
|
||||
<th>Description</th>
|
||||
<th style="width: 30px">Status</th>
|
||||
<th style="width: 300px">Power load</th>
|
||||
<th style="width: 150px">Command</th>
|
||||
@@ -78,9 +78,9 @@
|
||||
var table = $('#example2').DataTable({
|
||||
'ajax': '/json/status',
|
||||
"columns" : [
|
||||
{ "data" : 0 },
|
||||
{ "data" : 1 },
|
||||
{ "data" : 2 },
|
||||
{ "data" : "Num" },
|
||||
{ "data" : "Description" },
|
||||
{ "data" : "Status" },
|
||||
{ "data" : null, "defaultContent": "<div class='progress progress-xs'><div class='progress-bar progress-bar-danger' style='width: 55%'></div></div>"},
|
||||
{ "data" : null, "defaultContent":btnhtml }
|
||||
],
|
||||
@@ -90,7 +90,7 @@
|
||||
'ordering' : true,
|
||||
'info' : true,
|
||||
'rowCallback': function( row, data ) {
|
||||
if ( data[2] == "true" ) {
|
||||
if ( data.Status ) {
|
||||
$('td:eq(2)', row).html( '<i class="fa fa-toggle-on"></i>' );
|
||||
} else {
|
||||
$('td:eq(2)', row).html( '<i class="fa fa-toggle-off"></i>' );
|
||||
|
||||
Reference in New Issue
Block a user