Added "hide offline miners" toggle
This commit is contained in:
parent
10a08e1ccf
commit
9c03bd3705
2 changed files with 28 additions and 1 deletions
28
index.html
28
index.html
|
@ -11,6 +11,7 @@
|
||||||
.left{text-align:left;}
|
.left{text-align:left;}
|
||||||
.right{text-align:right;}
|
.right{text-align:right;}
|
||||||
.center{text-align:center;}
|
.center{text-align:center;}
|
||||||
|
.toolbar { float: right; padding-left: 10pt;}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.4.js"></script>
|
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.4.js"></script>
|
||||||
|
@ -20,9 +21,28 @@
|
||||||
<script src="https://use.fontawesome.com/6b3cdfc597.js"></script>
|
<script src="https://use.fontawesome.com/6b3cdfc597.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
$.fn.dataTable.ext.search.push(
|
||||||
|
function( settings, data, dataIndex ) {
|
||||||
|
var hide = document.getElementById("hideOffline").checked;
|
||||||
|
|
||||||
|
var lastStatus = settings.aoData[dataIndex]._aData.client_status.last_status_update * 1000;
|
||||||
|
var threshold = new Date().getTime() - 10*60*1000;
|
||||||
|
|
||||||
|
console.log("lastStatus: " + new Date(lastStatus));
|
||||||
|
console.log("threshold: " + new Date(threshold));
|
||||||
|
|
||||||
|
if (lastStatus > threshold || !hide) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var table = $('#clientStatusList').DataTable({
|
var table = $('#clientStatusList').DataTable({
|
||||||
dom: 'Bfrtip',
|
dom: '<"toolbar">frtip',
|
||||||
processing : true,
|
processing : true,
|
||||||
bPaginate : false,
|
bPaginate : false,
|
||||||
ajax : {
|
ajax : {
|
||||||
|
@ -129,6 +149,8 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("div.toolbar").html('<input type="checkbox" id="hideOffline" value="hide" checked style="margin-right: 5pt"><label>Hide offline miners</label>');
|
||||||
|
|
||||||
$('#clientStatusList tbody').on( 'click', 'button', function () {
|
$('#clientStatusList tbody').on( 'click', 'button', function () {
|
||||||
var data = table.row( $(this).parents('tr') ).data();
|
var data = table.row( $(this).parents('tr') ).data();
|
||||||
var clientId = data['client_status']['client_id'];
|
var clientId = data['client_status']['client_id'];
|
||||||
|
@ -190,6 +212,10 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#hideOffline').click( function() {
|
||||||
|
table.draw();
|
||||||
|
} );
|
||||||
|
|
||||||
setInterval(function () {
|
setInterval(function () {
|
||||||
table.ajax.reload();
|
table.ajax.reload();
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2016-2017 XMRig <support@xmrig.com>
|
* Copyright 2016-2017 XMRig <support@xmrig.com>
|
||||||
|
* Copyright 2017- BenDr0id <ben@graef.in>
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue