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/server/templates/stream.html | 556 ++++++++++++++++++++++++++++++++++ 1 file changed, 556 insertions(+) create mode 100644 internal/server/templates/stream.html (limited to 'internal/server/templates/stream.html') diff --git a/internal/server/templates/stream.html b/internal/server/templates/stream.html new file mode 100644 index 0000000..2e40d3b --- /dev/null +++ b/internal/server/templates/stream.html @@ -0,0 +1,556 @@ + + + + + {{if .ThemeCSS}} + + {{end}} + + + {{.Site.Name}} [Loading...] + + {{if .Site.Favicon}} + + {{else}} + + {{end}} + + {{if .CustomHead}}{{.CustomHead}}{{end}} + + + +
+
+
+
+ {{if .Site.Logo}} + Logo + {{end}} +
+

{{.Site.Name}}

+

{{.Site.Description}}

+
+
+
+
+ +
+
+
+
+
+
+ Connecting... +
+ -- +
+
+ +
+ {{range $groupIndex, $group := .Groups}} +
+
+
+
+ + + +

{{$group.Name}}

+
+ {{if $group.ShowGroupUptime}} + -- + {{end}} +
+
+
+ {{range .Monitors}} +
+
+
+
+
+ {{if .Link}}{{.Name}}{{else}}{{.Name}}{{end}} + {{.Type}} +
+
+ {{if not .HidePing}}--{{end}} + + +
+
+
+ -- +
+
+
+ {{range seq $.TickCount}} +
+ {{end}} +
+
+ {{end}} +
+
+ {{end}} +
+ + {{if .Incidents}} +
+

Incidents

+
+ {{range .Incidents}} +
+
+
+
+
+ {{if eq .Status "resolved"}} + + {{else if eq .Status "scheduled"}} + + {{else}} + + {{end}} + {{.Title}} +
+

{{.Message}}

+ {{if .IsScheduled}} +

Scheduled: {{if .ScheduledStart}}{{.ScheduledStart}}{{end}} - {{if .ScheduledEnd}}{{.ScheduledEnd}}{{end}}

+ {{end}} +
+
+ {{.Status}} +
+
+
+
+ {{end}} +
+
+ {{end}} + +
+
+ Connecting... + Powered by Kaze +
+
+
+ +
+ +
+
+
+ +
+
+ ↑↓ navigate + select + esc close +
+
+
+ + + + -- cgit v1.2.3