mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +09:00
Fixed bug with negative production
This commit is contained in:
1 parent
a243181856
commit
5abeb8c9a6
2 files changed
+5
-2
No files matched your search
@@ -18,7 +18,7 @@ setTimeout(function() {
|
|||||||
var seenDate = (seenDate+"")[0]+"-"+(seenDate+"")[1]+(seenDate+"")[4]+(seenDate+"")[6]+"-"+(seenDate+"")[2]+(seenDate+"")[5]+(seenDate+"")[7]+"-"+(seenDate+"")[3];
|
var seenDate = (seenDate+"")[0]+"-"+(seenDate+"")[1]+(seenDate+"")[4]+(seenDate+"")[6]+"-"+(seenDate+"")[2]+(seenDate+"")[5]+(seenDate+"")[7]+"-"+(seenDate+"")[3];
|
||||||
}
|
}
|
||||||
HTML += "<div class='slaveBox'>";
|
HTML += "<div class='slaveBox'>";
|
||||||
HTML += '<div id="' + slaveData[key].unique + '" class="productionGraph" style="height: 250px; width: calc(100% - 200px);"></div>';
|
HTML += '<div id="' + slaveData[key].unique + '" class="productionGraph" style="width: calc(100% - 200px);"></div>';
|
||||||
HTML += "<h2>ID: " + slaveData[key].unique + "</h2><p>Last seen: "+seenDate+"</p><p>Port: "+slaveData[key].serverPort+"</p><p>Host: "+slaveData[key].mac+"</p>";
|
HTML += "<h2>ID: " + slaveData[key].unique + "</h2><p>Last seen: "+seenDate+"</p><p>Port: "+slaveData[key].serverPort+"</p><p>Host: "+slaveData[key].mac+"</p>";
|
||||||
|
|
||||||
HTML += "</div>";
|
HTML += "</div>";
|
||||||
@@ -86,7 +86,9 @@ function generateLineChartArray(data, nameKey) {
|
|||||||
if(data[i].timestamp > Date.now() - (24*60*60*1000)){
|
if(data[i].timestamp > Date.now() - (24*60*60*1000)){
|
||||||
let y = data[i].data[nameKey]
|
let y = data[i].data[nameKey]
|
||||||
if(!data[i].data[nameKey]) {
|
if(!data[i].data[nameKey]) {
|
||||||
y = 0
|
y = 0;
|
||||||
|
} else if(y < 0) {
|
||||||
|
y = 0;
|
||||||
}
|
}
|
||||||
chartData[chartData.length] = {
|
chartData[chartData.length] = {
|
||||||
x: new Date(data[i].timestamp),
|
x: new Date(data[i].timestamp),
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
}
|
}
|
||||||
.productionGraph {
|
.productionGraph {
|
||||||
float:right;
|
float:right;
|
||||||
|
height:300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-black {
|
.button-black {
|
||||||
|
|||||||
Reference in new issue
Block a user