From 4b49b70e131619af5cad480720b3d2aa5fbd0878 Mon Sep 17 00:00:00 2001 From: Jerry Brady Date: Fri, 4 Apr 2014 02:56:53 +0000 Subject: [PATCH] Added stat updater per algorithm --- website/static/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/website/static/main.js b/website/static/main.js index a87d63e..6c94769 100644 --- a/website/static/main.js +++ b/website/static/main.js @@ -1,6 +1,5 @@ $(function(){ - var hotSwap = function(page, pushSate){ if (pushSate) history.pushState(null, null, '/' + page); $('.selected').removeClass('selected'); @@ -29,8 +28,10 @@ $(function(){ var statsSource = new EventSource("/api/live_stats"); statsSource.addEventListener('message', function(e){ var stats = JSON.parse(e.data); - $('#statsMiners').text(stats.global.workers); - $('#statsHashrate').text(stats.global.hashrate); + for (algo in algos) { + $('#statsMiners'+algo).text(stats.algos[algo].workers); + $('#statsHashrate'+algo).text(stats.algos[algo].hashrateString); + } }); -}); \ No newline at end of file +});