From 886ddb31cfbd6e329efd305b41c0d082fc744c3e Mon Sep 17 00:00:00 2001 From: gmemstr Date: Wed, 1 Mar 2017 20:22:04 -0800 Subject: [PATCH] Fixed JavaScript for stats fetching --- src/static/platypus.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/static/platypus.js b/src/static/platypus.js index d3a58fa..ff28d61 100644 --- a/src/static/platypus.js +++ b/src/static/platypus.js @@ -41,17 +41,17 @@ function setRow(text,panel,row){ //console.log(text); //console.log(panel) res = JSON.parse(text); - console.log(res[panel]['online']); - if (res[panel]['online'] == false || res[panel]['online'] == null) { - row.cells[0].innerHTML = res[panel]['name'] + "OFFLINE"; + console.log(res['online']); + if (res['online'] == false || res['online'] == null) { + row.cells[0].innerHTML = res['name'] + "OFFLINE"; row.cells[2].innerHTML = "0%"; row.cells[3].innerHTML = "0%"; row.cells[4].innerHTML = "0%"; } else { - row.cells[0].innerHTML = res[panel]['name']; - row.cells[2].innerHTML = res[panel]['cpu'] + "%"; - row.cells[3].innerHTML = res[panel]['memory'] + "%"; - row.cells[4].innerHTML = res[panel]['disk'] + "%"; + row.cells[0].innerHTML = res['name']; + row.cells[2].innerHTML = res['cpu'] + "%"; + row.cells[3].innerHTML = res['memory'] + "%"; + row.cells[4].innerHTML = res['disk'] + "%"; } }