From b258fb228503d0a6cfd4800c421c6dde20d22cb0 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Wed, 13 Jul 2022 11:19:48 +0200 Subject: [PATCH] Relative links --- gui/dashboard/app.svelte | 5 ++++- gui/dashboard/lib.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gui/dashboard/app.svelte b/gui/dashboard/app.svelte index d53656e..0d391ea 100644 --- a/gui/dashboard/app.svelte +++ b/gui/dashboard/app.svelte @@ -88,7 +88,10 @@ onMount(() => { proportionalGrid(); - const ws = new WebSocket('ws://__SERVER__/status/dashboard/socket'); + + const ws = new WebSocket( + window.location.href.replace('http', 'ws') + '/socket' + ); ws.onmessage = async evt => { const data = JSON.parse(evt.data || '""'); diff --git a/gui/dashboard/lib.js b/gui/dashboard/lib.js index a7d441d..c9cff01 100644 --- a/gui/dashboard/lib.js +++ b/gui/dashboard/lib.js @@ -42,7 +42,7 @@ export const shuffle = crossfade({ }); export function ringBell() { - const bell = new Audio('http://__SERVER__/statusdashboard/sound'); + const bell = new Audio(window.location.href + '/sound'); bell.addEventListener('canplaythrough', () => bell.play()); }