linting changes

This commit is contained in:
Neshura 2024-01-03 20:40:52 +01:00
parent 63197220a6
commit cedf89e106
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
2 changed files with 58 additions and 21 deletions
src/routes/services

View file

@ -3,14 +3,14 @@
<script lang="ts">
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 { io } from 'socket.io-client';
import type { Heartbeat } from '$lib/types/uptime-kuma-types';
let { data }: { data: { token: string } } = $props();
$effect(() => {
console.log("Data:", data.token)
})
console.log('Data:', data.token);
});
let services: readonly Service[] = $state.frozen([]);
@ -25,10 +25,10 @@
const socket = io('https://status.neshweb.net/');
socket.on('connect', () => {
socket.emit("loginByToken", data.token, (res) => {
console.log(data.token)
socket.emit('loginByToken', data.token, (res) => {
console.log(data.token);
console.log(res);
})
});
});
socket.on('heartbeatList', (idString: string, data) => {
@ -41,18 +41,17 @@
ping: recent.ping,
important: recent.important,
duration: recent.duration
}
};
monitorList.set(monitor.monitorID, monitor);
monitorList = new Map(monitorList.entries());
})
});
socket.on('heartbeat', (data) => {
monitorList.set(data.monitorID, data);
monitorList = new Map(monitorList.entries());
})
});
}
})
});
async function get(url: string): Promise<any> {
let res = await fetch(url);