mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
sentItemStats for master is now working as well
This commit is contained in:
1 parent
3d4c788788
commit
869b5f9ced
3 files changed
+27
-22
No files matched your search
+7
-5
@@ -26,8 +26,9 @@ debugTools = {
|
||||
addItem: function(name, count){
|
||||
console.log(`Attempting to add ${count} ${name}`)
|
||||
postJSON("api/place", {
|
||||
instanceName: "debug",
|
||||
unique: "debug",
|
||||
instanceName: "unknown",
|
||||
instanceID: "unknown",
|
||||
unique: "unknown",
|
||||
name: name,
|
||||
count: count,
|
||||
}, function(data){
|
||||
@@ -35,10 +36,11 @@ debugTools = {
|
||||
});
|
||||
},
|
||||
removeItem: function(name, count){
|
||||
console.log(name)
|
||||
console.log(`Attempting to remove ${count} ${name}`)
|
||||
postJSON("api/remove", {
|
||||
instanceName: "debug",
|
||||
unique: "debug",
|
||||
instanceName: "unknown",
|
||||
instanceID: "unknown",
|
||||
unique: "unknown",
|
||||
name: name,
|
||||
count: count,
|
||||
}, function(data){
|
||||
|
||||
+2
-2
@@ -117,7 +117,7 @@ function makeItemGraphs(itemName){
|
||||
slaveIDs.forEach(function(slaveID){
|
||||
["place", "remove"].forEach(statistic => {
|
||||
console.log("Making chart for "+slaveID+"'s "+statistic+" statistic")
|
||||
HTML += '<div id="contentGraph'+slaveID+'" class="storageGraph" style="width: 100%;"></div>';
|
||||
HTML += '<div id="'+statistic+'contentGraph'+slaveID+'" class="storageGraph" style="width: 100%;"></div>';
|
||||
|
||||
setTimeout(function(){
|
||||
let xmlhttp = new XMLHttpRequest(); // new HttpRequest instance
|
||||
@@ -128,7 +128,7 @@ 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], slaveID+" "+itemName);
|
||||
drawChart(statistic+"contentGraph"+slaveID, [JSON.parse(xmlhttp.response).data], slaveID+" "+itemName);
|
||||
// console.log(JSON.parse(xmlhttp.response).data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user