parent
f8d6afa95e
commit
d7e7654686
10 changed files with 19 additions and 35 deletions
src
lib
components
stores
types
routes
|
@ -6,7 +6,6 @@
|
|||
import { slide } from 'svelte/transition';
|
||||
import { IconType, type Server } from '$lib/types/data-types';
|
||||
import { Skeleton } from '$lib/components/ui/skeleton';
|
||||
import type { Heartbeat } from '$lib/types/uptime-kuma-types';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
|
||||
let { server, icons, monitor } = $props<{
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
import { slide } from 'svelte/transition';
|
||||
import { IconType, type Service } from '$lib/types/data-types';
|
||||
import { Skeleton } from '$lib/components/ui/skeleton';
|
||||
import type { Heartbeat } from '$lib/types/uptime-kuma-types';
|
||||
|
||||
let { service, icons, monitor } = $props<{
|
||||
service: Service;
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
import { writable } from 'svelte/store';
|
||||
import { io } from 'socket.io-client';
|
||||
|
||||
export let socketStore = writable(io('https://status.neshweb.net/'));
|
|
@ -1,4 +0,0 @@
|
|||
import { type Writable, writable } from 'svelte/store';
|
||||
import type { Heartbeat } from '$lib/types/uptime-kuma-types';
|
||||
|
||||
export let uptimeStore: Writable<Map<number, Heartbeat>> = writable(new Map());
|
|
@ -1,9 +0,0 @@
|
|||
export type Heartbeat = {
|
||||
readonly monitorID: number;
|
||||
readonly status: number;
|
||||
readonly time: string;
|
||||
readonly msg: string;
|
||||
readonly ping: number;
|
||||
readonly important: boolean;
|
||||
readonly duration: number;
|
||||
};
|
|
@ -3,7 +3,6 @@
|
|||
<script>
|
||||
import '../app.pcss';
|
||||
import Header from './Header.svelte';
|
||||
import { socketStore } from '$lib/stores/socketStore';
|
||||
import { beforeNavigate } from '$app/navigation';
|
||||
import Footer from './Footer.svelte';
|
||||
|
||||
|
@ -13,9 +12,6 @@
|
|||
navigation.to.url.pathname === '/servers' || navigation.from.url.pathname === '/servers';
|
||||
const services =
|
||||
navigation.to.url.pathname === '/services' || navigation.from.url.pathname === '/services';
|
||||
if (!(servers && services)) {
|
||||
$socketStore.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -2,11 +2,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import type { Server } from '$lib/types/data-types';
|
||||
import { io } from 'socket.io-client';
|
||||
import type { Heartbeat } from '$lib/types/uptime-kuma-types';
|
||||
import ServerCard from '$lib/components/ServerCard.svelte';
|
||||
import { socketStore } from '$lib/stores/socketStore';
|
||||
import { uptimeStore } from '$lib/stores/uptimeStore';
|
||||
|
||||
let servers: readonly Server[] = $state.frozen([]);
|
||||
|
||||
|
|
|
@ -4,10 +4,7 @@
|
|||
import ServiceCard from '$lib/components/ServiceCard.svelte';
|
||||
import type { Service } from '$lib/types/data-types';
|
||||
import { io } from 'socket.io-client';
|
||||
import type { Heartbeat } from '$lib/types/uptime-kuma-types';
|
||||
import { socketStore } from '$lib/stores/socketStore';
|
||||
import { onDestroy } from 'svelte';
|
||||
import { uptimeStore } from '$lib/stores/uptimeStore';
|
||||
|
||||
let services: readonly Service[] = $state.frozen([]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue