Speedtest Tracker, Costs, "Having trouble" on status pages, grouped Integrations and Dashboard

- Speedtest Tracker integration: charts, alerts for a slow line (median of the
  last three tests under a share of what is paid for) and for failing tests.
- Costs page (Records): things paid for by hand plus Hetzner's estimate, totals
  per currency, bills rolled forward into Coming up as Renewals.
- Status pages: a "Having trouble" state for things that answer but have an open
  alert; Speedtest reads as the internet.
- Integrations page and kind picker grouped like the sidebar (one shared types
  file); Notifications "What to send" shown one group at a time; Dashboard
  integration sections follow the menu groups, with tiles for integrations that
  have no widget.
- Docs, tests, and ROLES.md menu table brought up to date.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-26 23:23:46 +01:00
1 parent 78822346b1
commit f86661f6c9
49 files changed
+18156 -238

No files matched your search

+32 -2
View File
@@ -23,8 +23,8 @@ what the app actually creates.
|---|---|
| **File** | `DATABASE_PATH`, default `../data/homelab-manager.sqlite` (relative to `server/`; `/app/data/...` in Docker). The folder is created if missing. |
| **Foreign keys** | Switched on for every connection (`PRAGMA foreign_keys = ON`), so the `ON DELETE` rules below are enforced. |
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0068`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
| **Tables** | 80 application tables, plus drizzle's own `__drizzle_migrations`. |
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0070`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
| **Tables** | 82 application tables, plus drizzle's own `__drizzle_migrations`. |
**Not in the database, but beside it in the data folder:** the backups of the database itself (`backups/homelab-manager-….sqlite`, taken daily and on request; see [BACKUP.md](BACKUP.md)), and, only while a restore is waiting or has just happened, `restore-pending.sqlite` / `restore-pending.json` and `restore-result.json`.
@@ -75,6 +75,7 @@ erDiagram
integrations ||--o| nextcloud_state : "cascade"
integrations ||--o{ dockhand_vulnerabilities : "cascade"
integrations ||--o| hetzner_state : "cascade"
integrations ||--o{ speedtest_results : "cascade"
integrations ||--o| netbox_state : "cascade"
integrations ||--o| n8n_state : "cascade"
integrations ||--o| paperless_state : "cascade"
@@ -920,6 +921,35 @@ How a NetBox (an integration of type `netbox`) is right now, one row each, repla
| `ips` | text | JSON array of the addresses NetBox holds, without the prefix length, at most 5000; null when they could not be listed. |
| `updated_at` | text NOT NULL | ISO. |
#### `speedtest_results`
The speed tests a Speedtest Tracker (an integration of type `speedtest`) has made, one row each, kept for 90 days. The primary key is (`integration_id`, `result_id`) and `integration_id` is a foreign key with **cascade**; an index on (`integration_id`, `at`). A result is stored once under Speedtest Tracker's own id and never changed afterwards. How the last read went is kept in `settings`, key `_internal:speedtestSync`.
| Column | Type | Notes |
|---|---|---|
| `integration_id`, `result_id` | integer PK | `result_id` is Speedtest Tracker's own id for the result. |
| `at` | text NOT NULL | ISO: when the test was made (the time Ookla gives, else `created_at` taken as UTC). |
| `status` | text NOT NULL | `completed`, `failed`, `skipped` … |
| `download_bps`, `upload_bps` | real | Bits per second; null for a test that has none (failed, skipped). |
| `ping_ms` | real | Milliseconds. |
| `healthy` | bool | Speedtest Tracker's own judgement by its thresholds; null when it did not say. |
#### `cost_items`
Things paid for by hand (a domain, a VPN, a licence, a subscription), one row each — the Costs page. What can be read (a Hetzner project's estimate) is not here. No foreign keys.
| Column | Type | Notes |
|---|---|---|
| `id` | integer PK | |
| `name` | text NOT NULL | |
| `amount` | real NOT NULL | What is paid each time, with VAT. |
| `currency` | text NOT NULL | Three capital letters. Totals are per currency; none is converted. |
| `period` | text NOT NULL | `month` or `year`. |
| `category` | text NOT NULL, default `Other` | Free text (Hosting, Domains, Subscriptions …). |
| `renews_on` | text | YYYY-MM-DD: a day it is (or will first be) billed. An anchor: the next time it falls is worked out from it and shown in Coming up. |
| `note` | text | |
| `created_at`, `updated_at` | text NOT NULL | ISO. |
#### `hetzner_state`
How a Hetzner Cloud project (an integration of type `hetzner`; a token belongs to one project) is right now, one row each, replaced at every read (every five minutes). `integration_id` is the primary key and a foreign key with **cascade**. There is no history table.