add pause functionality and updating favicon

This commit is contained in:
Henry Dollman
2024-07-12 22:24:28 -04:00
parent aacaf2f04f
commit 05f5c94764
8 changed files with 133 additions and 121 deletions

View File

@@ -34,11 +34,17 @@ const App = () => {
useEffect(() => {
if (!authenticated || !servers.length) {
updateFavicon('/favicon.svg')
} else if (servers.find((server) => !server.active)) {
updateFavicon('/favicon-red.svg')
} else {
// all servers good
updateFavicon('/favicon-green.svg')
let up = false
for (const server of servers) {
if (server.status === 'down') {
updateFavicon('/favicon-red.svg')
return
} else if (server.status === 'up') {
up = true
}
}
updateFavicon(up ? '/favicon-green.svg' : '/favicon.svg')
}
}, [authenticated, servers])