parent
f8d6afa95e
commit
d7e7654686
10 changed files with 19 additions and 35 deletions
|
@ -45,7 +45,6 @@
|
|||
"clsx": "^2.1.0",
|
||||
"radix-icons-svelte": "^1.2.1",
|
||||
"sanitize-html": "^2.11.0",
|
||||
"socket.io": "^4.7.2",
|
||||
"socket.io-client": "^4.7.2",
|
||||
"tailwind-merge": "^2.2.0",
|
||||
"tailwind-variants": "^0.1.19"
|
||||
|
|
|
@ -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([]);
|
||||
|
||||
|
|
23
yarn.lock
23
yarn.lock
|
@ -2103,7 +2103,7 @@ socket.io-parser@~4.2.4:
|
|||
"@socket.io/component-emitter" "~3.1.0"
|
||||
debug "~4.3.1"
|
||||
|
||||
socket.io@*, socket.io@^4.7.2:
|
||||
socket.io@*:
|
||||
version "4.7.2"
|
||||
resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.7.2.tgz#22557d76c3f3ca48f82e73d68b7add36a22df002"
|
||||
integrity sha512-bvKVS29/I5fl2FGLNHuXlQaUH/BlzX1IN6S+NKLNZpBsPZIDH+90eQmCs2Railn4YUiww4SzUedJ6+uzwFnKLw==
|
||||
|
@ -2131,8 +2131,16 @@ source-map-js@^1.0.2:
|
|||
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
|
||||
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
|
||||
|
||||
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0:
|
||||
name string-width-cjs
|
||||
"string-width-cjs@npm:string-width@^4.2.0":
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
string-width@^4.1.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
|
@ -2150,7 +2158,14 @@ string-width@^5.0.1, string-width@^5.1.2:
|
|||
emoji-regex "^9.2.2"
|
||||
strip-ansi "^7.0.1"
|
||||
|
||||
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
|
|
Loading…
Add table
Reference in a new issue