14 lines
301 B
JavaScript
14 lines
301 B
JavaScript
|
export function updateConnectionStatus(connection) {
|
||
|
let obj = document.getElementById("status")
|
||
|
obj.textContent = `Server Connection: ${connection}`
|
||
|
switch (connection) {
|
||
|
case "connected":
|
||
|
obj.style.color = "green";
|
||
|
break;
|
||
|
case "disconnected":
|
||
|
obj.style.color = "red";
|
||
|
break;
|
||
|
|
||
|
}
|
||
|
}
|