finished adding timer

This commit is contained in:
UpstreamData
2022-04-18 12:29:55 -06:00
committed by UpstreamData
parent 029d3ef596
commit a9cdefcd43
2 changed files with 14 additions and 13 deletions

View File

@@ -92,16 +92,17 @@ ws.onmessage = function(event) {
if (data.hasOwnProperty("online")) {
timer = document.getElementById(data["IP"] + "-timer")
if (data["online"] == "0:00:00") {
if (timer.className.contains("btn-success")) {
timer.className.remove("btn-success")
timer.className += ("btn-secondary")
if (timer.classList.contains("btn-success")) {
timer.classList.remove("btn-success")
timer.className += " btn-secondary"
}
} else {
if (timer.className.contains("btn-secondary")) {
timer.className.remove("btn-secondary")
timer.className += ("btn-success")
if (timer.classList.contains("btn-secondary")) {
timer.classList.remove("btn-secondary")
timer.className += " btn-success"
}
}
timer.innerHTML = data["online"]
};
if (data.hasOwnProperty("miners")) {
var container_all = document.getElementById('chart_container');
@@ -401,9 +402,7 @@ ws.onmessage = function(event) {
var miner_stdout_text = document.getElementById(data["IP"] + "-stdout_text")
miner_stdout.hidden = false
miner_stdout_text.innerHTML = data["text"] + miner_stdout_text.innerHTML
} else {
console.log(data)
};
}
if (data.hasOwnProperty("Light")) {
light_box = document.getElementById(data["IP"] + "-light_container")
if (data["Light"] == "show") {