From 911745fda6c191e216128d1a1e33c280ad0bc96d Mon Sep 17 00:00:00 2001 From: Kalzu Rekku Date: Sun, 25 Oct 2026 19:50:00 +0200 Subject: [PATCH] The dashboard actually. --- dashboard.py | 30 +++ index.html | 527 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 557 insertions(+) create mode 100644 dashboard.py create mode 100644 index.html diff --git a/dashboard.py b/dashboard.py new file mode 100644 index 0000000..47bc4cb --- /dev/null +++ b/dashboard.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +""" +Lightweight test server and transparent proxy for the Records API. +Serves index.html on http://127.0.0.1:8080 and adds CORS headers to Axum requests. +""" +from http.server import SimpleHTTPRequestHandler, HTTPServer +import urllib.request +import urllib.error + +PORT = 8080 + +class ProxyHandler(SimpleHTTPRequestHandler): + def end_headers(self): + self.send_header('Access-Control-Allow-Origin', '*') + self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') + self.send_header('Access-Control-Allow-Headers', '*') + super().end_headers() + + def do_OPTIONS(self): + self.send_response(204) + self.end_headers() + +if __name__ == '__main__': + print(f"๐Ÿš€ Dashboard running at http://127.0.0.1:{PORT}") + print("Press Ctrl+C to stop.") + server = HTTPServer(('127.0.0.1', PORT), ProxyHandler) + try: + server.serve_forever() + except KeyboardInterrupt: + print("\nStopping...") \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..7043552 --- /dev/null +++ b/index.html @@ -0,0 +1,527 @@ + + + + + + Records API & Replication Dashboard + + + + +
+
+

โšก Records API & Replication Monitor

+

+ Interactive validation and real-time visualization of SQLite append-only journals +

+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ Primary Node +
Seq: --
+
ID: --
+
+ +
+ Connected +
โ”โ”โ”โ” โ—„โ”€pullโ”€โ”€ โ”โ”โ”โ”
+
Lag: 0 records
+
+ +
+ Replica Node +
Seq: --
+
ID: --
+
State: --
+
+
+ + +
+ +
+
+ ๐Ÿ“– Primary Records (`/api/records`) + 0 records +
+
+ + + +
SeqUUIDDate (UTC)Payload
Loading...
+
+
+ + +
+
+ ๐Ÿ“– Replica Records (`/api/records`) + 0 records +
+
+ + + +
SeqUUIDDate (UTC)Payload
Loading...
+
+
+
+ + +
+ +
+
โœ๏ธ Write Record (Primary)
+ + + +
+ + +
+
๐Ÿงช Automated Tests
+
+ + + +
+
+ + +
+
+ โš™๏ธ Schema Management + +
+
Click Inspect to view
+ +
+
+ + +
+
+ ๐Ÿ–ฅ๏ธ Live Verification Console + +
+
+
+ + + +