diff --git a/web/src/routes/admin/diagnostics/+page.svelte b/web/src/routes/admin/diagnostics/+page.svelte index f6fb0e34..12379cb9 100644 --- a/web/src/routes/admin/diagnostics/+page.svelte +++ b/web/src/routes/admin/diagnostics/+page.svelte @@ -36,13 +36,26 @@ } } + // Default view = the most recent N events, no time window. The + // start/end window is an Advanced affordance. + const DEFAULT_LIMIT = 500; + // Filter state. let accountId = $state(''); let clientId = $state(''); let kind = $state(''); let fromLocal = $state(''); let toLocal = $state(''); - let limit = $state(500); + let limit = $state(DEFAULT_LIMIT); + + // True when an explicit time window is set (drives the caption wording). + const hasWindow = $derived(Boolean(fromLocal || toLocal)); + + function resetWindow() { + fromLocal = ''; + toLocal = ''; + limit = DEFAULT_LIMIT; + } // datetime-local (browser-local, no tz) → RFC3339 UTC the API accepts. function toRfc(v: string): string | undefined { @@ -191,77 +204,97 @@ - -
- - - - - + +
+
+ + -
- - +
+ + +
+ + +
+ + Advanced filters{hasWindow ? ' · window active' : ''} + +
+ + + + +
+
@@ -276,7 +309,13 @@

{:else}
- {rows.length} events (oldest first) + + {#if hasWindow} + {rows.length} events in window (oldest first) + {:else} + Most recent {rows.length} events (oldest first) · set a time window under Advanced + {/if} +