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 @@ + + +
+ + ++ Interactive validation and real-time visualization of SQLite append-only journals +
+| Seq | UUID | Date (UTC) | Payload |
|---|---|---|---|
| Loading... | |||
| Seq | UUID | Date (UTC) | Payload |
|---|---|---|---|
| Loading... | |||
Click Inspect to view+ +