Qrome - updated some of the HTML display for hostname and offline

pull/24/head
Chrome Legion 2018-06-17 23:31:44 -07:00
parent 9f23894ecb
commit 1d624db136
1 changed files with 34 additions and 27 deletions

View File

@ -629,10 +629,13 @@ 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>";
if (printerClient.isPrinting()) {
html += "File: " + printerClient.getFileName() + "<br>";
float fileSize = printerClient.getFileSize().toFloat();
if (fileSize > 0) {
@ -663,6 +666,10 @@ void displayPrinterStatus() {
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 += "</p></div></div>";
server.sendContent(html); // spit out what we got