Relative links

This commit is contained in:
Romein van Buren 2022-07-13 11:19:48 +02:00
parent 670fe76249
commit b258fb2285
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
2 changed files with 5 additions and 2 deletions

View File

@ -88,7 +88,10 @@
onMount(() => { onMount(() => {
proportionalGrid(); 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 => { ws.onmessage = async evt => {
const data = JSON.parse(evt.data || '""'); const data = JSON.parse(evt.data || '""');

View File

@ -42,7 +42,7 @@ export const shuffle = crossfade({
}); });
export function ringBell() { export function ringBell() {
const bell = new Audio('http://__SERVER__/statusdashboard/sound'); const bell = new Audio(window.location.href + '/sound');
bell.addEventListener('canplaythrough', () => bell.play()); bell.addEventListener('canplaythrough', () => bell.play());
} }