From 950ae0a4e9f2782176f6a4a20efea4e711d303e3 Mon Sep 17 00:00:00 2001 From: Dejan R Date: Mon, 20 Apr 2026 18:11:26 +0200 Subject: [PATCH] added page to main --- main.go | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index b91b0fe..aa46825 100644 --- a/main.go +++ b/main.go @@ -2287,7 +2287,38 @@ func apiAlarms(w http.ResponseWriter, r *http.Request) { func serveUI(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/" { - // Parse and execute template with config data + // Check license before serving the UI + if licenseMgr != nil { + status := licenseMgr.Status() + if status.Locked { + // Serve fallback activation page when locked + w.Header().Set("Content-Type", "text/html; charset=utf-8") + fmt.Fprintf(w, ` +Force Monitor — License Required + +

Force Monitor

Machine fingerprint: %s

+

License mode: %s

+

Message: %s

+

GET /api/license/status

+

GET /api/license/request

+

Paste signed license JSON

+ +
+

+
`, status.FingerprintShort, status.Mode, status.Message) + return + } + } + + // License OK — serve the full dashboard template tmpl, err := template.ParseFiles(filepath.Join("static", "index.html")) if err != nil { log.Printf("template parse error: %v", err)