From 5abeb8c9a67ba2eb4f61caa7e372527ec30c279c Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Thu, 16 Mar 2017 09:24:39 +0100 Subject: [PATCH] Fixed bug with negative production --- static/slaveDisplay.js | 6 ++++-- static/style.css | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/static/slaveDisplay.js b/static/slaveDisplay.js index b902cf87..04d97bb1 100644 --- a/static/slaveDisplay.js +++ b/static/slaveDisplay.js @@ -18,7 +18,7 @@ setTimeout(function() { var seenDate = (seenDate+"")[0]+"-"+(seenDate+"")[1]+(seenDate+"")[4]+(seenDate+"")[6]+"-"+(seenDate+"")[2]+(seenDate+"")[5]+(seenDate+"")[7]+"-"+(seenDate+"")[3]; } HTML += "
"; - HTML += '
'; + HTML += '
'; HTML += "

ID: " + slaveData[key].unique + "

Last seen: "+seenDate+"

Port: "+slaveData[key].serverPort+"

Host: "+slaveData[key].mac+"

"; HTML += "
"; @@ -86,7 +86,9 @@ function generateLineChartArray(data, nameKey) { if(data[i].timestamp > Date.now() - (24*60*60*1000)){ let y = data[i].data[nameKey] if(!data[i].data[nameKey]) { - y = 0 + y = 0; + } else if(y < 0) { + y = 0; } chartData[chartData.length] = { x: new Date(data[i].timestamp), diff --git a/static/style.css b/static/style.css index 6d3e0f02..cc8211d9 100644 --- a/static/style.css +++ b/static/style.css @@ -51,6 +51,7 @@ } .productionGraph { float:right; + height:300px; } .button-black {