From c6844fcc4748488ea63a369d404812645d6e002b Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Sun, 25 Oct 2026 04:55:01 +0100 Subject: [PATCH] show server diagnostics in client --- src/App.svelte | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/App.svelte b/src/App.svelte index 3327f19..20dfd33 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -2,6 +2,7 @@ let serverAddress = 'http://127.0.0.1:8787'; let connectionState = 'OFFLINE'; let serverVersion = '—'; + let diagnostics: { status: string; database: string; twitch_identity_count: number; unseen_notification_count: number; realtime: string } | undefined; let activeView = 'Live dashboard'; let sessionToken = ''; let authenticated = false; @@ -92,6 +93,7 @@ connectionState = 'CONNECTED'; await loadActivity(); await loadNotifications(); + await loadDiagnostics(); await loadStreamInfo(); connectRealtime(); if (!mustReplaceCredentials) password = ''; @@ -141,6 +143,7 @@ oauthLink = ''; notifications = []; showNotifications = false; + diagnostics = undefined; } function connectRealtime() { @@ -199,6 +202,18 @@ } } + async function loadDiagnostics() { + try { + const response = await fetch(`${serverAddress}/api/v1/server/diagnostics`, { + headers: { authorization: `Bearer ${sessionToken}` }, + }); + if (!response.ok) return; + diagnostics = await response.json(); + } catch { + diagnostics = undefined; + } + } + async function markNotificationSeen(notificationId: string) { const response = await fetch(`${serverAddress}/api/v1/admin/notifications/${notificationId}/seen`, { method: 'POST', @@ -412,7 +427,7 @@
Sign in as administrator to connect accounts.
{/if} - +