feat: implement dashboard with authentication and event logging

- Added dashboard functionality at /status with Basic Auth using DASHBOARD_PASSWORD.
- Created server-side event logging to track catalog and university status.
- Implemented traffic metrics tracking and display on the dashboard.
- Enhanced API tests to cover new dashboard features and authentication.
- Introduced CSS and JS for dashboard styling and functionality.
- Added tests for dashboard access control and data retrieval.
This commit is contained in:
2026-10-21 00:04:33 +03:00
parent de72d003b8
commit 3ae7b38fca
15 changed files with 1216 additions and 74 deletions

View File

@@ -26,6 +26,11 @@ test("API: до загрузки индекса сервер жив, но не
assert.equal(health.body.ready, false);
assert.equal(health.body.client, "127.0.0.1");
assert.equal(typeof health.body.apiVersion, "number");
// Public health says alive, ready and versions; the rest is on the dashboard.
assert.equal(health.body.traffic, undefined);
assert.equal(health.body.telegram, undefined);
// Without DASHBOARD_PASSWORD the dashboard is off.
assert.equal((await get("/status/")).status, 404);
const ready = await json("/api/ready");
assert.equal(ready.status, 503);
assert.equal(ready.body.code, "not_ready");