From defea76033f75804a45bbb650e19cb16c677295b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 28 Jan 2026 03:12:23 -0800 Subject: feat: Add SSE streaming for instant page load and real-time updates New refresh_mode 'stream' eliminates blocking database queries from initial page load. Page renders instantly with skeleton UI, then hydrates via SSE. - Add SSE hub for managing client connections and broadcasting - Add /api/stream endpoint with init and update events - Add stream.html skeleton template with loading animations - Wire scheduler to broadcast on check completion - Backwards compatible: page/api modes unchanged --- internal/config/config.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/config') diff --git a/internal/config/config.go b/internal/config/config.go index 3ac03ea..5e74b5c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -648,12 +648,10 @@ func (c *Config) validate() error { return fmt.Errorf("api.access is 'authenticated' but no api.keys provided") } - // Validate refresh mode switch c.Display.RefreshMode { - case "page", "api": - // Valid modes + case "page", "api", "stream": default: - return fmt.Errorf("invalid display.refresh_mode %q (must be page or api)", c.Display.RefreshMode) + return fmt.Errorf("invalid display.refresh_mode %q (must be page, api, or stream)", c.Display.RefreshMode) } if c.Display.RefreshInterval < 5 { -- cgit v1.2.3