Some small bugfixes
parent
e882e9a07e
commit
62d010a4da
|
|
@ -162,7 +162,7 @@ void DuetClient::getPrinterJobResults() {
|
||||||
if (printerData.error != "") {
|
if (printerData.error != "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const size_t bufferSize = 6*JSON_ARRAY_SIZE(1) + 3*JSON_ARRAY_SIZE(2) + 5*JSON_ARRAY_SIZE(3) + 5*JSON_OBJECT_SIZE(2) + 4*JSON_OBJECT_SIZE(5) + JSON_OBJECT_SIZE(9) + 257
|
const size_t bufferSize = 6*JSON_ARRAY_SIZE(1) + 3*JSON_ARRAY_SIZE(2) + 5*JSON_ARRAY_SIZE(3) + 5*JSON_OBJECT_SIZE(2) + 4*JSON_OBJECT_SIZE(5) + JSON_OBJECT_SIZE(9) + 257;
|
||||||
DynamicJsonDocument jsonBuffer(bufferSize);
|
DynamicJsonDocument jsonBuffer(bufferSize);
|
||||||
|
|
||||||
// Parse JSON object
|
// Parse JSON object
|
||||||
|
|
@ -238,7 +238,7 @@ let eta = total_time - pstats.print_duration; */
|
||||||
printerData.toolTargetTemp = (int)jsonBuffer["result"]["status"]["extruder"]["target"];
|
printerData.toolTargetTemp = (int)jsonBuffer["result"]["status"]["extruder"]["target"];
|
||||||
printerData.bedTemp = (int)jsonBuffer["result"]["status"]["heater_bed"]["temperature"];
|
printerData.bedTemp = (int)jsonBuffer["result"]["status"]["heater_bed"]["temperature"];
|
||||||
printerData.bedTargetTemp = (int)jsonBuffer["result"]["status"]["heater_bed"]["target"];
|
printerData.bedTargetTemp = (int)jsonBuffer["result"]["status"]["heater_bed"]["target"];
|
||||||
printerData.fileSize = (long)jsonBuffer2["result"]["size"];
|
printerData.fileSize = (long)jsonBuffer["result"]["size"];
|
||||||
|
|
||||||
if (isPrinting()) {
|
if (isPrinting()) {
|
||||||
this->debugController->printLn("Status: " + printerData.state + " " + printerData.fileName + "(" + printerData.progressCompletion + "%)");
|
this->debugController->printLn("Status: " + printerData.state + " " + printerData.fileName + "(" + printerData.progressCompletion + "%)");
|
||||||
|
|
|
||||||
|
|
@ -171,12 +171,9 @@ void WebServer::displayPrinterStatus() {
|
||||||
|
|
||||||
html += "<div class='w3-cell-row' style='width:100%'><h2>" + printerClient->getPrinterType() + " Monitor</h2></div><div class='w3-cell-row'>";
|
html += "<div class='w3-cell-row' style='width:100%'><h2>" + printerClient->getPrinterType() + " Monitor</h2></div><div class='w3-cell-row'>";
|
||||||
html += "<div class='w3-cell w3-container' style='width:100%'><p>";
|
html += "<div class='w3-cell w3-container' style='width:100%'><p>";
|
||||||
if (printerClient->getPrinterType() == "Repetier") {
|
if ((printerClient->getPrinterType() == "Repetier") || (printerClient->getPrinterType() == "Klipper")) {
|
||||||
html += "Printer Name: " + printerClient->getPrinterName() + " <a href='/configure' title='Configure'><i class='fa fa-cog'></i></a><br>";
|
html += "Printer Name: " + printerClient->getPrinterName() + " <a href='/configure' title='Configure'><i class='fa fa-cog'></i></a><br>";
|
||||||
}
|
}
|
||||||
else if (printerClient->getPrinterType() == "Klipper") {
|
|
||||||
html += "Printer Name: " + printerClient->getPrinterName() + " <a href='/configure' title='Configure'><i class='fa fa-cog'></i></a><br>";
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
html += "Host Name: " + this->globalDataController->getPrinterHostName() + " <a href='/configure' title='Configure'><i class='fa fa-cog'></i></a><br>";
|
html += "Host Name: " + this->globalDataController->getPrinterHostName() + " <a href='/configure' title='Configure'><i class='fa fa-cog'></i></a><br>";
|
||||||
}
|
}
|
||||||
|
|
@ -402,7 +399,7 @@ void WebServer::handleConfigure() {
|
||||||
CHANGE_FORM = "<form class='w3-container' action='/updateconfig' method='get'><h2>Station Config:</h2>"
|
CHANGE_FORM = "<form class='w3-container' action='/updateconfig' method='get'><h2>Station Config:</h2>"
|
||||||
"<p><label>" + printerClient->getPrinterType() + " API Key (get from your server)</label>"
|
"<p><label>" + printerClient->getPrinterType() + " API Key (get from your server)</label>"
|
||||||
"<input class='w3-input w3-border w3-margin-bottom' type='text' name='PrinterApiKey' id='PrinterApiKey' value='%OCTOKEY%' maxlength='60'></p>";
|
"<input class='w3-input w3-border w3-margin-bottom' type='text' name='PrinterApiKey' id='PrinterApiKey' value='%OCTOKEY%' maxlength='60'></p>";
|
||||||
if (printerClient->getPrinterType() == "OctoPrint" || "Klipper") {
|
if ((printerClient->getPrinterType() == "OctoPrint") || (printerClient->getPrinterType() == "Klipper")) {
|
||||||
CHANGE_FORM += "<p><label>" + printerClient->getPrinterType() + " Host Name (usually octopi)</label><input class='w3-input w3-border w3-margin-bottom' type='text' name='PrinterHostName' value='%OCTOHOST%' maxlength='60'></p>";
|
CHANGE_FORM += "<p><label>" + printerClient->getPrinterType() + " Host Name (usually octopi)</label><input class='w3-input w3-border w3-margin-bottom' type='text' name='PrinterHostName' value='%OCTOHOST%' maxlength='60'></p>";
|
||||||
}
|
}
|
||||||
CHANGE_FORM += "<p><label>" + printerClient->getPrinterType() + " Address (do not include http://)</label>"
|
CHANGE_FORM += "<p><label>" + printerClient->getPrinterType() + " Address (do not include http://)</label>"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue