Some small bugfixes

pull/125/head
Robert Stein 2020-12-14 05:57:05 +01:00
parent e882e9a07e
commit 62d010a4da
2 changed files with 5 additions and 8 deletions

View File

@ -162,7 +162,7 @@ void DuetClient::getPrinterJobResults() {
if (printerData.error != "") {
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);
// Parse JSON object
@ -238,7 +238,7 @@ let eta = total_time - pstats.print_duration; */
printerData.toolTargetTemp = (int)jsonBuffer["result"]["status"]["extruder"]["target"];
printerData.bedTemp = (int)jsonBuffer["result"]["status"]["heater_bed"]["temperature"];
printerData.bedTargetTemp = (int)jsonBuffer["result"]["status"]["heater_bed"]["target"];
printerData.fileSize = (long)jsonBuffer2["result"]["size"];
printerData.fileSize = (long)jsonBuffer["result"]["size"];
if (isPrinting()) {
this->debugController->printLn("Status: " + printerData.state + " " + printerData.fileName + "(" + printerData.progressCompletion + "%)");

View File

@ -171,10 +171,7 @@ 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 w3-container' style='width:100%'><p>";
if (printerClient->getPrinterType() == "Repetier") {
html += "Printer Name: " + printerClient->getPrinterName() + " <a href='/configure' title='Configure'><i class='fa fa-cog'></i></a><br>";
}
else if (printerClient->getPrinterType() == "Klipper") {
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>";
}
else {
@ -402,7 +399,7 @@ void WebServer::handleConfigure() {
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>"
"<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() + " Address (do not include http://)</label>"