mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 23:24:52 +09:00
recievedItemStats for master is working
This commit is contained in:
1 parent
04aba1eef1
commit
3d4c788788
3 files changed
+22
-4
No files matched your search
@@ -403,7 +403,7 @@ app.post("/api/getStats", function(req,res) {
|
||||
if(req.body.statistic == "place"){
|
||||
console.log("sending place data...");
|
||||
// Gather data
|
||||
console.log(recievedItemStatisticsBySlaveID)
|
||||
//console.log(recievedItemStatisticsBySlaveID)
|
||||
let itemStats = recievedItemStatisticsBySlaveID[req.body.slaveID];
|
||||
if(itemStats === undefined){
|
||||
res.send({statusForDebugging:"no data available"});
|
||||
@@ -417,7 +417,21 @@ app.post("/api/getStats", function(req,res) {
|
||||
data: data,
|
||||
});
|
||||
} else if(req.body.statistic == "remove"){
|
||||
console.log("sending remove data...");
|
||||
// Gather data
|
||||
//console.log(sentItemStatisticsBySlaveID)
|
||||
let itemStats = sentItemStatisticsBySlaveID[req.body.slaveID];
|
||||
if(itemStats === undefined){
|
||||
res.send({statusForDebugging:"no data available"});
|
||||
return false;
|
||||
}
|
||||
let data = itemStats.get(config.itemStats.maxEntries, req.body.itemName);
|
||||
|
||||
res.send({
|
||||
maxEntries:config.itemStats.maxEntries,
|
||||
entriesPerSecond: config.itemStats.entriesPerSecond,
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+3
-2
@@ -113,6 +113,7 @@ function makeItemGraphs(itemName){
|
||||
let HTML = ""
|
||||
// Draw in/out chart for unregistered slaves as well
|
||||
slaveIDs.unshift("unknown");
|
||||
slaveIDs.unshift("debug");
|
||||
slaveIDs.forEach(function(slaveID){
|
||||
["place", "remove"].forEach(statistic => {
|
||||
console.log("Making chart for "+slaveID+"'s "+statistic+" statistic")
|
||||
@@ -127,8 +128,8 @@ function makeItemGraphs(itemName){
|
||||
if(xmlhttp.readyState === XMLHttpRequest.DONE && xmlhttp.status === 200) {
|
||||
// console.log(xmlhttp.responseText);
|
||||
if(isJSON(xmlhttp.responseText) && JSON.parse(xmlhttp.responseText).statusForDebugging === undefined){
|
||||
drawChart("contentGraph"+slaveID, [JSON.parse(xmlhttp.response).data]);
|
||||
console.log(JSON.parse(xmlhttp.response).data)
|
||||
drawChart("contentGraph"+slaveID, [JSON.parse(xmlhttp.response).data], slaveID+" "+itemName);
|
||||
// console.log(JSON.parse(xmlhttp.response).data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -33,7 +33,6 @@ button {
|
||||
float:left;
|
||||
width: calc(100% - 300px);
|
||||
min-height:100px;
|
||||
background-color: red;
|
||||
}
|
||||
/* Navbar on the right */
|
||||
#sidenav {
|
||||
@@ -79,6 +78,9 @@ a:hover {
|
||||
#contentGraph {
|
||||
float:left;
|
||||
}
|
||||
.storageGraph {
|
||||
height:200px;
|
||||
}
|
||||
|
||||
/* terminal */
|
||||
.Terminal p div {
|
||||
@@ -183,6 +185,7 @@ a:hover {
|
||||
height:300px;
|
||||
}
|
||||
|
||||
|
||||
.button-black {
|
||||
width:100%;
|
||||
height:40px;
|
||||
|
||||
Reference in new issue
Block a user