diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-18 23:43:12 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-18 23:43:12 +0100 |
| commit | ed19a428cb5eef84c8cf3fed5fda3afd5fc96305 (patch) | |
| tree | 39e3167a4f8b7423a15b3a5f56e973554bdb3195 /web/script/log_live.ts | |
| parent | 901dff07ed357694eb35284a58c3cc6c003c53ce (diff) | |
| download | jellything-ed19a428cb5eef84c8cf3fed5fda3afd5fc96305.tar jellything-ed19a428cb5eef84c8cf3fed5fda3afd5fc96305.tar.bz2 jellything-ed19a428cb5eef84c8cf3fed5fda3afd5fc96305.tar.zst | |
Move client scripts to build-crate
Diffstat (limited to 'web/script/log_live.ts')
| -rw-r--r-- | web/script/log_live.ts | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/web/script/log_live.ts b/web/script/log_live.ts deleted file mode 100644 index b8af11e..0000000 --- a/web/script/log_live.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - This file is part of jellything (https://codeberg.org/metamuffin/jellything) - which is licensed under the GNU Affero General Public License (version 3); see /COPYING. - Copyright (C) 2026 metamuffin <metamuffin.org> -*/ -/// <reference lib="dom" /> -globalThis.addEventListener("DOMContentLoaded", () => { - if (!document.body.classList.contains("admin_log")) return - const log = document.getElementById("log")! - - const warnonly = new URL(globalThis.location.href).searchParams.get("warnonly") == "true" - const ws = new WebSocket(`/admin/log?stream&warnonly=${warnonly}&html=true`) - ws.onopen = () => console.log("live log connected"); - ws.onclose = () => console.log("live log disconnected"); - ws.onerror = e => console.log(`live log ws error: ${e}`); - - ws.onmessage = msg => { - log.children[0].children[0].innerHTML += msg.data - while (log.children[0].children[0].children.length > 1024) - log.children[0].children[0].children[0].remove() - } -}) |