diff --git a/gui/components/formautotestfield.svelte b/gui/components/formautotestfield.svelte index f42baab..e71ca87 100644 --- a/gui/components/formautotestfield.svelte +++ b/gui/components/formautotestfield.svelte @@ -21,7 +21,7 @@ const defaultEndpoint = { { type: 'httpstatus', truth: 'true', operator: 'equal', - string: '200' + string: '200', }, ], }; @@ -29,7 +29,7 @@ const defaultReq = { type: 'httpstatus', truth: 'true', operator: 'equal', - string: '' + string: '', }; const defaultHeader = { name: '', @@ -110,6 +110,7 @@ function removeEndpoint(i) { /> @@ -161,7 +162,7 @@ function removeEndpoint(i) { inline labels={{ on: translate('is', language), - off: translate('isn\'t', language) + off: translate('isn\'t', language), }} bind:value={req.truth} on:change={changeValue} @@ -196,6 +197,7 @@ function removeEndpoint(i) { /> diff --git a/gui/components/formoutagetablefield.svelte b/gui/components/formoutagetablefield.svelte index 5e35e28..2a5f44f 100644 --- a/gui/components/formoutagetablefield.svelte +++ b/gui/components/formoutagetablefield.svelte @@ -28,7 +28,7 @@ const severity = { name: 'no impact', class: 'l4', }, -} +}; const dispatch = createEventDispatcher(); const service = value; // for clarity let outages = []; diff --git a/gui/dashboard/app.svelte b/gui/dashboard/app.svelte index bb99db4..7feaf43 100644 --- a/gui/dashboard/app.svelte +++ b/gui/dashboard/app.svelte @@ -17,7 +17,7 @@ let hasData = false; function tileProps(service) { - let props = { + const props = { title: service.name.en, subtitle: service.cluster, date: service.lastBeat?.date ? new Date(service.lastBeat.date) : undefined, @@ -87,7 +87,9 @@ settings.subscribe(s => { size = (s.cols || 4) * (s.rows || 3); - if (hasData) organiseGrid(); + if (hasData) { + organiseGrid(); + } }); return () => clearInterval(clockInterval); diff --git a/gui/dashboard/tile.svelte b/gui/dashboard/tile.svelte index 9477c7a..b64608a 100644 --- a/gui/dashboard/tile.svelte +++ b/gui/dashboard/tile.svelte @@ -14,13 +14,13 @@ }) : ''; onMount(() => { - if (since) { - function updateDuration() { - formattedDuration = formatDuration( - new Date().getTime() - since.getTime() - ); - } + function updateDuration() { + formattedDuration = formatDuration( + new Date().getTime() - since.getTime() + ); + } + if (since) { updateDuration(); const interval = setInterval(updateDuration, 100); return () => clearInterval(interval); diff --git a/gui/modules/webservicedashboard.svelte b/gui/modules/webservicedashboard.svelte index 6755765..c777d7b 100644 --- a/gui/modules/webservicedashboard.svelte +++ b/gui/modules/webservicedashboard.svelte @@ -5,7 +5,9 @@ onMount(() => { let url = window.location.href; - if (!url.endsWith('/')) url += '/'; + if (!url.endsWith('/')) { + url += '/'; + } url += 'status/dashboard'; window.open(url, '_blank').focus(); diff --git a/lib/dashboard/socket.js b/lib/dashboard/socket.js index 55da5fe..6491f13 100644 --- a/lib/dashboard/socket.js +++ b/lib/dashboard/socket.js @@ -3,7 +3,6 @@ const { makeId } = require('core/makeid'); const decoder = new TextDecoder('utf-8'); -let uws; let downIdsBefore = []; let downIdsAfter = []; @@ -16,7 +15,7 @@ const mapService = (s, beat) => ({ }); async function createDashboardSocket(server) { - uws = server.ws({ + server.ws({ route: '/status/dashboard/socket', onOpen: async ws => { async function sendStatuses() {