Qrome - updated some of the HTML display for hostname and offline
parent
9f23894ecb
commit
1d624db136
|
|
@ -629,40 +629,47 @@ void displayPrinterStatus() {
|
|||
|
||||
html += "<div class='w3-cell-row' style='width:100%'><h2>Time: " + displayTime + "</h2></div><div class='w3-cell-row'>";
|
||||
html += "<div class='w3-cell w3-container' style='width:100%'><p>";
|
||||
html += "Host Name: " + OctoPrintHostName + "<br>";
|
||||
if (printerClient.getError() != "") {
|
||||
html += "Error: " + printerClient.getError() + "<br>";
|
||||
}
|
||||
html += "Status: " + printerClient.getState() + "<br>";
|
||||
html += "File: " + printerClient.getFileName() + "<br>";
|
||||
float fileSize = printerClient.getFileSize().toFloat();
|
||||
if (fileSize > 0) {
|
||||
fileSize = fileSize / 1024;
|
||||
html += "File Size: " + String(fileSize) + "KB<br>";
|
||||
}
|
||||
int filamentLength = printerClient.getFilamentLength().toInt();
|
||||
if (filamentLength > 0) {
|
||||
float fLength = float(filamentLength) / 1000;
|
||||
html += "Filament: " + String(fLength) + "m<br>";
|
||||
|
||||
if (printerClient.isPrinting()) {
|
||||
html += "File: " + printerClient.getFileName() + "<br>";
|
||||
float fileSize = printerClient.getFileSize().toFloat();
|
||||
if (fileSize > 0) {
|
||||
fileSize = fileSize / 1024;
|
||||
html += "File Size: " + String(fileSize) + "KB<br>";
|
||||
}
|
||||
int filamentLength = printerClient.getFilamentLength().toInt();
|
||||
if (filamentLength > 0) {
|
||||
float fLength = float(filamentLength) / 1000;
|
||||
html += "Filament: " + String(fLength) + "m<br>";
|
||||
}
|
||||
|
||||
html += "Tool Temperature: " + printerClient.getTempToolActual() + "° C<br>";
|
||||
html += "Bed Temperature: " + printerClient.getTempBedActual() + "° C<br>";
|
||||
|
||||
int val = printerClient.getProgressPrintTimeLeft().toInt();
|
||||
int days = elapsedDays(val);
|
||||
int hours = numberOfHours(val);
|
||||
int minutes = numberOfMinutes(val);
|
||||
int seconds = numberOfSeconds(val);
|
||||
html += "Est. Print Time Left: " + zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds) + "<br>";
|
||||
|
||||
val = printerClient.getProgressPrintTime().toInt();
|
||||
days = elapsedDays(val);
|
||||
hours = numberOfHours(val);
|
||||
minutes = numberOfMinutes(val);
|
||||
seconds = numberOfSeconds(val);
|
||||
html += "Printing Time: " + zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds) + "<br>";
|
||||
html += "<style>#myProgress {width: 100%;background-color: #ddd;}#myBar {width: " + printerClient.getProgressCompletion() + "%;height: 30px;background-color: #4CAF50;}</style>";
|
||||
html += "<div id=\"myProgress\"><div id=\"myBar\" class=\"w3-medium w3-center\">" + printerClient.getProgressCompletion() + "%</div></div>";
|
||||
} else {
|
||||
html += "<hr>";
|
||||
}
|
||||
|
||||
html += "Tool Temperature: " + printerClient.getTempToolActual() + "° C<br>";
|
||||
html += "Bed Temperature: " + printerClient.getTempBedActual() + "° C<br>";
|
||||
|
||||
int val = printerClient.getProgressPrintTimeLeft().toInt();
|
||||
int days = elapsedDays(val);
|
||||
int hours = numberOfHours(val);
|
||||
int minutes = numberOfMinutes(val);
|
||||
int seconds = numberOfSeconds(val);
|
||||
html += "Est. Print Time Left: " + zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds) + "<br>";
|
||||
|
||||
val = printerClient.getProgressPrintTime().toInt();
|
||||
days = elapsedDays(val);
|
||||
hours = numberOfHours(val);
|
||||
minutes = numberOfMinutes(val);
|
||||
seconds = numberOfSeconds(val);
|
||||
html += "Printing Time: " + zeroPad(hours) + ":" + zeroPad(minutes) + ":" + zeroPad(seconds) + "<br>";
|
||||
html += "<style>#myProgress {width: 100%;background-color: #ddd;}#myBar {width: " + printerClient.getProgressCompletion() + "%;height: 30px;background-color: #4CAF50;}</style>";
|
||||
html += "<div id=\"myProgress\"><div id=\"myBar\" class=\"w3-medium w3-center\">" + printerClient.getProgressCompletion() + "%</div></div>";
|
||||
html += "</p></div></div>";
|
||||
|
||||
server.sendContent(html); // spit out what we got
|
||||
|
|
|
|||
Loading…
Reference in New Issue