mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 15:04:52 +09:00
1 parent
dc2c04741a
commit
3f699e7ab5
1 file changed
+16
-3
+16
-3
@@ -20,8 +20,9 @@ setTimeout(function() {
|
||||
}
|
||||
HTML += "<div class='slaveBox'>";
|
||||
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>IP: "+slaveData[key].publicIP +":"+ slaveData[key].serverPort+"</p>"
|
||||
HTML += "<p>Host: "+slaveData[key].mac+"</p>";
|
||||
HTML += "<button onclick='hideAllDatasets(\"" + slaveData[key].unique + "\")\'>Hide all</button>";
|
||||
HTML += "</div>";
|
||||
}
|
||||
}
|
||||
@@ -97,7 +98,7 @@ function generateLineChartArray(data, nameKey) {
|
||||
}
|
||||
}
|
||||
}
|
||||
chartData = sortByKey(chartData, "x")
|
||||
chartData = sortByKey(chartData, "x");
|
||||
let xyz = {};
|
||||
xyz.name = nameKey;
|
||||
xyz.type = "line";
|
||||
@@ -141,6 +142,18 @@ function drawChart(selector, chartData) {
|
||||
chart.render();
|
||||
}
|
||||
|
||||
function hideAllDatasets(chartID) {
|
||||
if(chartsByID[chartID]) {
|
||||
let chart = chartsByID[chartID];
|
||||
for(let i = 0; i < chart.options.data.length; i++) {
|
||||
chart.options.data[i].visible = false;
|
||||
}
|
||||
chart.render();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// function to sort arrays of objects after a keys value
|
||||
function sortByKey(array, key) {
|
||||
return array.sort(function(a, b) {
|
||||
|
||||
Reference in new issue
Block a user