From bf3ea7a7515948470a156adb55d102dd9dc7429c Mon Sep 17 00:00:00 2001 From: Karl Date: Sat, 9 May 2026 09:37:09 +0100 Subject: [PATCH] feat(ui): add dashboard for cookie management and usage monitoring Add a new root GET route that serves a responsive web interface. This dashboard allows users to update session cookies by pasting JSON and provides real-time visualization of Ollama cloud usage and server health status. --- server.js | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/server.js b/server.js index 17eea8e..8106059 100644 --- a/server.js +++ b/server.js @@ -374,6 +374,130 @@ function stateBody(friendlyName, icon, usage, fetchedAt) { const app = express(); app.set("json spaces", 2); +app.get("/", (_req, res) => { + res.send(` + + + + +Ollama Cloud Usage + + + +
+

Ollama Cloud Usage

+ +
+

Update Cookies

+

Paste the exported cookie JSON array from your browser below.

+ + +
+
+ +
+

Current Usage

+ +
+ No data yet. +
+
+
+ +
+

Health

+
Checking...
+
+
+ + +`); +}); + app.get("/api/usage", (_req, res) => { if (!latestState) { return res.json({ status: "no_data", message: "No data yet. Wait for first poll." });