diff --git a/index.html b/index.html index e5ff7a1a..6cf1f5d3 100644 --- a/index.html +++ b/index.html @@ -8,14 +8,33 @@ + @@ -25,6 +44,7 @@ + @@ -34,7 +54,8 @@ $.fn.dataTable.ext.search.push( function( settings, data, dataIndex ) { - var hide = $('#hideOffline').hasClass("fa fa-check-square-o"); + var hideOffline = $('#hideOffline').prop('checked'); + var showNotification = $('#showOfflineNotification').prop('checked'); var clientId = settings.aoData[dataIndex]._aData.client_status.client_id; var lastStatus = settings.aoData[dataIndex]._aData.client_status.last_status_update * 1000; @@ -42,15 +63,15 @@ if (!online) { var threshold = new Date().getTime() - (TRESHOLD_IN_MS + RELOAD_INTERVAL_IN_MS); - if (lastStatus > threshold) { + if (lastStatus > threshold && showNotification) { $("#notificationBar").after('
' + '×' + - 'Client ' + clientId + ' just went offline! Last update: ' + new Date(lastStatus) + + 'Miner ' + clientId + ' just went offline! Last update: ' + new Date(lastStatus) + '
'); } } - return (online || !hide); + return (online || !hideOffline); } ); @@ -58,11 +79,11 @@ var latestRelease = ""; var table = $('#clientStatusList').DataTable({ - dom: "<'toolbar'><'row'<'col-sm-9'B><'col-sm-3'f>><'row'<'col-sm-12't>>", - bPaginate : false, - ajax : { - url : "/admin/getClientStatusList", - dataSrc : 'client_status_list' + dom: "<'row'<'col-sm-9'B><'col-sm-3'f>><'row'<'col-sm-12't>>", + bPaginate: false, + ajax: { + url: "/admin/getClientStatusList", + dataSrc: 'client_status_list' }, deferRender: true, columns: [ @@ -72,40 +93,40 @@ className: 'select-checkbox', orderable: false }, - { data: "client_status.client_id", render: clientInfo}, - { data: "client_status.current_pool"}, - { data: "client_status.current_status"}, - { data: "client_status.current_algo_name"}, - { data: "client_status.hashrate_short", render: round, className: "right"}, - { data: "client_status.hashrate_medium", render: round, className: "right"}, - { data: "client_status.hashrate_long", render: round, className: "right"}, - { data: "client_status.hashrate_highest", render: round, className: "right"}, - { data: "client_status.hashes_total", className: "right"}, - { data: "client_status.avg_time", className: "right"}, - { data: "client_status.shares_good", className: "right"}, - { data: "client_status.shares_total", className: "right"}, - { data: "client_status.last_status_update", render: laststatus}, + {data: "client_status.client_id", render: clientInfo}, + {data: "client_status.current_pool"}, + {data: "client_status.current_status"}, + {data: "client_status.current_algo_name"}, + {data: "client_status.hashrate_short", render: round, className: "right"}, + {data: "client_status.hashrate_medium", render: round, className: "right"}, + {data: "client_status.hashrate_long", render: round, className: "right"}, + {data: "client_status.hashrate_highest", render: round, className: "right"}, + {data: "client_status.hashes_total", className: "right"}, + {data: "client_status.avg_time", className: "right"}, + {data: "client_status.shares_good", className: "right"}, + {data: "client_status.shares_total", className: "right"}, + {data: "client_status.last_status_update", render: laststatus}, { data: null, defaultContent: - "", + "", orderable: false, className: "center-tab" } ], rowId: 'client_status.client_id', select: { - style : "multi" + style: "multi" }, - order: [ 1, 'asc' ], + order: [1, 'asc'], lengthChange: false, buttons: [ { - text: ' Pull client config', + text: ' Pull miner config', className: 'btn-default', enabled: false, action: function () { - table.rows({ selected: true }).eq(0).each(function (index) { + table.rows({selected: true}).eq(0).each(function (index) { var row = table.row(index); var data = row.data(); @@ -114,11 +135,11 @@ } }, { - text: ' Push client config', + text: ' Push miner config', className: 'btn-primary', enabled: false, action: function () { - table.rows({ selected: true }).eq(0).each(function (index) { + table.rows({selected: true}).eq(0).each(function (index) { var row = table.row(index); var data = row.data(); @@ -131,7 +152,7 @@ className: 'btn-success', enabled: false, action: function () { - table.rows({ selected: true }).eq(0).each(function (index) { + table.rows({selected: true}).eq(0).each(function (index) { var row = table.row(index); var data = row.data(); @@ -144,7 +165,7 @@ className: 'btn-warning', enabled: false, action: function () { - table.rows({ selected: true }).eq(0).each(function (index) { + table.rows({selected: true}).eq(0).each(function (index) { var row = table.row(index); var data = row.data(); @@ -157,7 +178,7 @@ className: 'btn-info', enabled: false, action: function () { - table.rows({ selected: true }).eq(0).each(function (index) { + table.rows({selected: true}).eq(0).each(function (index) { var row = table.row(index); var data = row.data(); @@ -170,7 +191,7 @@ className: 'btn-danger', enabled: false, action: function () { - table.rows({ selected: true }).eq(0).each(function (index) { + table.rows({selected: true}).eq(0).each(function (index) { var row = table.row(index); var data = row.data(); @@ -188,7 +209,7 @@ } ], - "footerCallback": function ( row, data, start, end, display ) { + "footerCallback": function (row, data, start, end, display) { var api = this.api(); var sumHashrateShort = 0; @@ -200,61 +221,61 @@ var sumSharesGood = 0; var sumSharedTotal = 0; - sumHashrateShort = api + sumHashrateShort = api .column(5, {page: 'current'}) .data() - .reduce( function (a, b) { - return a+b; - }, 0 ); + .reduce(function (a, b) { + return a + b; + }, 0); - sumHashrateMedium = api + sumHashrateMedium = api .column(6, {page: 'current'}) .data() - .reduce( function (a, b) { - return a+b; - }, 0 ); + .reduce(function (a, b) { + return a + b; + }, 0); - sumHashrateLong = api + sumHashrateLong = api .column(7, {page: 'current'}) .data() - .reduce( function (a, b) { - return a+b; - }, 0 ); + .reduce(function (a, b) { + return a + b; + }, 0); - sumHashrateHighest = api + sumHashrateHighest = api .column(8, {page: 'current'}) .data() - .reduce( function (a, b) { - return a+b; - }, 0 ); + .reduce(function (a, b) { + return a + b; + }, 0); - sumHashesTotal = api + sumHashesTotal = api .column(9, {page: 'current'}) .data() - .reduce( function (a, b) { - return a+b; - }, 0 ); + .reduce(function (a, b) { + return a + b; + }, 0); - avgTimeTotal = api + avgTimeTotal = api .column(10, {page: 'current'}) .data() - .reduce( function (a, b) { - return (a+b) / 2; - }, 0 ); + .reduce(function (a, b) { + return (a + b) / 2; + }, 0); - sumSharesGood = api + sumSharesGood = api .column(11, {page: 'current'}) .data() - .reduce( function (a, b) { - return a+b; - }, 0 ); + .reduce(function (a, b) { + return a + b; + }, 0); sumSharedTotal = api .column(12, {page: 'current'}) .data() - .reduce( function (a, b) { - return a+b; - }, 0 ); + .reduce(function (a, b) { + return a + b; + }, 0); sumHashrateShort = round(sumHashrateShort); sumHashrateMedium = round(sumHashrateMedium); @@ -293,7 +314,7 @@ }); table.on('select', function () { - var selectedRows = table.rows( { selected: true } ).count(); + var selectedRows = table.rows({selected: true}).count(); table.button(0).enable(selectedRows > 0); table.button(1).enable(selectedRows > 0); @@ -305,7 +326,7 @@ }); table.on('deselect', function () { - var selectedRows = table.rows( { selected: true } ).count(); + var selectedRows = table.rows({selected: true}).count(); table.button(0).enable(selectedRows > 0); table.button(1).enable(selectedRows > 0); @@ -316,9 +337,11 @@ table.button(6).enable(selectedRows > 0); }); - table.buttons().container().appendTo( '#clientStatusList_wrapper .col-sm-6:eq(0)' ); + table.buttons().container().appendTo('#clientStatusList_wrapper .col-sm-6:eq(0)'); - $("div.toolbar").html('
'); + $('#hideOffline').change(function() { + table.draw(); + }); $('#clientStatusList tbody').on( 'click', 'button', function () { var data = table.row( $(this).parents('tr') ).data(); @@ -340,7 +363,7 @@ $('#minerEditor').modal('show'); }, error: function (data) { - setError('Unable to fetch ' + clientId + '_config.json - Please make sure that you pulled the config before!'); + setError('Unable to fetch ' + clientId + '_config.json - Please make sure that you pulled the config before!'); } }); }); @@ -372,23 +395,12 @@ setClientConfig(clientId, jsonClientConfig, true); }, error: function (data) { - setError('Unable to fetch ' + clientId + '_config.json - Please make sure that you pulled the config before!'); + setError('Unable to fetch ' + clientId + '_config.json - Please make sure that you pulled the config before!'); } }); }); }); - - $('#hideOffline').click( function() { - if ($(this).hasClass("fa fa-square-o")) { - $(this).removeClass("fa fa-square-o").addClass("fa fa-check-square-o"); - } else { - $(this).removeClass("fa fa-check-square-o").addClass("fa fa-square-o"); - } - - table.draw(); - } ); - $('#selectAllTop,#selectAllBottom').click( function() { if ($("#selectAllTop").hasClass("fa fa-square-o")) { $("#selectAllTop").removeClass("fa fa-square-o").addClass("fa fa-check-square-o"); @@ -512,14 +524,14 @@ data: clientConfig, success: function(data){ if (isMultiConfigEdit) { - setSuccess('Successfully updated configs for the selected clients - You need push the config to the clients to apply the config.'); + setSuccess('Successfully updated configs for the selected miners - You need push the config to the miners to apply the config.'); } else { - setSuccess('Successfully updated config for: ' + clientId + ' - You need push the config to the client to apply the config.'); + setSuccess('Successfully updated config for: ' + clientId + ' - You need push the config to the miner to apply the config.'); } }, error: function (data) { if (isMultiConfigEdit) { - setError('Failed to update configs for the selected clients \nError:' + JSON.stringify(data,undefined, 2)); + setError('Failed to update configs for the selected miners \nError:' + JSON.stringify(data,undefined, 2)); } else { setError('Failed to update config for: ' + clientId + ' \nError: ' + JSON.stringify(data,undefined, 2)); } @@ -540,11 +552,16 @@

XMRigCC Dashboard

+
+ + +
+ - + @@ -591,7 +608,7 @@
Client IdMiner Id Pool Status Algo