diff --git a/gui/dashboard/app.svelte b/gui/dashboard/app.svelte index 68bc3aa..797c0f8 100644 --- a/gui/dashboard/app.svelte +++ b/gui/dashboard/app.svelte @@ -10,11 +10,6 @@ let servicesUp = {}; let servicesDown = {}; let servicesUnknown = {}; - let servicesInCluster = {}; - let servicesInClusterUnknown = {}; - const clusters = JSON.parse('__CLUSTERS__'); - const clusterKeys = clusters ? Object.keys(clusters) : false; - let currentClusterIndex = -1; let loading = true; let lock = false; @@ -68,39 +63,6 @@ } } }); - - $: if (clusterKeys?.length && !loading) { - function nextCluster() { - lock = true; - currentClusterIndex++; - - if (currentClusterIndex >= clusterKeys.length) { - currentClusterIndex = 0; - } - - const inClusterTemp = {}; - const inClusterTempUnknown = {}; - const currentClusterKey = clusterKeys[currentClusterIndex]; - - for (const [ id, s ] of Object.entries(services)) { - if (s.cluster === currentClusterKey) { - if (!s.lastBeat || !s.lastBeat.date) { - inClusterTempUnknown[id] = s; - } - else { - inClusterTemp[id] = s; - } - } - } - - servicesInCluster = inClusterTemp; - servicesInClusterUnknown = inClusterTempUnknown; - lock = false; - } - - nextCluster(); - setInterval(() => nextCluster, 10_000); - } @@ -112,14 +74,8 @@ {#if !loading} - - {#if !clusterKeys?.length} - - - {:else} - - - {/if} + + {:else} loading {/if} diff --git a/gui/dashboard/index.js b/gui/dashboard/index.js index 68a1638..b4d6b13 100644 --- a/gui/dashboard/index.js +++ b/gui/dashboard/index.js @@ -1,21 +1,3 @@ -import { get, writable } from 'svelte/store'; import App from './app.svelte'; new App({ target: document.body }); - -function createSettingsStore() { - const s = writable(0); - - function updateStorage(val) { - window.localStorage.setItem('statusdash', JSON.stringify(val)); - s.set(val); - } - - return { - subscribe: s.subscribe, - set: val => updateStorage(val), - update: val => updateStorage({ ...get(s), val }), - }; -} - -export const settings = createSettingsStore(); diff --git a/gui/dashboard/settings.svelte b/gui/dashboard/settings.svelte index 6e54a97..3cb06ff 100644 --- a/gui/dashboard/settings.svelte +++ b/gui/dashboard/settings.svelte @@ -1,6 +1,6 @@