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:
1 parent
78822346b1
commit
f86661f6c9
49 files changed
+18156
-238
No files matched your search
+73
-4
@@ -34,13 +34,13 @@ export interface StatusPageItem {
|
||||
export interface PublicStatusItem {
|
||||
id: number;
|
||||
label: string;
|
||||
state: "up" | "down" | "maintenance" | "unknown";
|
||||
state: "up" | "trouble" | "down" | "maintenance" | "unknown";
|
||||
uptime30d: number | null;
|
||||
}
|
||||
export interface PublicStatus {
|
||||
title: string;
|
||||
message: string | null;
|
||||
level: "ok" | "issue" | "maintenance" | "unknown";
|
||||
level: "ok" | "trouble" | "issue" | "maintenance" | "unknown";
|
||||
counts: Record<PublicStatusItem["state"], number>;
|
||||
items: PublicStatusItem[];
|
||||
generatedAt: string;
|
||||
@@ -1326,6 +1326,65 @@ export interface HetznerForServer {
|
||||
} | null;
|
||||
}
|
||||
|
||||
export interface CostItem {
|
||||
id: number;
|
||||
name: string;
|
||||
amount: number;
|
||||
currency: string;
|
||||
period: "month" | "year";
|
||||
category: string;
|
||||
/** The day it is (or will first be) billed; the next time it falls is nextRenewal. */
|
||||
renewsOn: string | null;
|
||||
nextRenewal: string | null;
|
||||
/** Per month, whatever the period it is paid in. */
|
||||
monthly: number;
|
||||
note: string | null;
|
||||
}
|
||||
|
||||
export interface CostInput {
|
||||
name: string;
|
||||
amount: number;
|
||||
currency: string;
|
||||
period: "month" | "year";
|
||||
category: string;
|
||||
renewsOn: string | null;
|
||||
note: string | null;
|
||||
}
|
||||
|
||||
export interface CostsReport {
|
||||
items: CostItem[];
|
||||
/** What can be read rather than typed: a Hetzner project's estimate. */
|
||||
automatic: { key: string; source: string; name: string; currency: string; monthly: number; detail: string; link: string; stale: boolean }[];
|
||||
/** Per currency; none is converted into another. */
|
||||
totals: { currency: string; monthly: number; yearly: number; items: number; categories: { category: string; monthly: number }[] }[];
|
||||
categories: string[];
|
||||
}
|
||||
|
||||
/** One Speedtest Tracker (an integration of type speedtest), as its page shows it. Speeds are bits per second. */
|
||||
export interface SpeedtestInfo {
|
||||
id: number;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
status: { at: string; ok: boolean; error: string | null } | null;
|
||||
fresh: boolean;
|
||||
/** What the line is sold at (Mbit/s; null: not said) and the share below which it is called slow. */
|
||||
expected: { downloadMbps: number | null; uploadMbps: number | null; minPercent: number };
|
||||
state: {
|
||||
latest: { at: string; download: number | null; upload: number | null; ping: number | null; healthy: boolean | null } | null;
|
||||
/** The middle of the newest few completed tests — what the alerts judge. */
|
||||
middle: { count: number; download: number | null; upload: number | null; ping: number | null };
|
||||
lastTest: { at: string; status: string } | null;
|
||||
stored: number;
|
||||
} | null;
|
||||
problems: { key: string; message: string; severity: "warning" }[];
|
||||
}
|
||||
|
||||
export interface SpeedtestHistory {
|
||||
days: number;
|
||||
/** Mbit/s and milliseconds. */
|
||||
points: { t: string; download: number | null; upload: number | null; ping: number | null }[];
|
||||
}
|
||||
|
||||
/** One NetBox, as its page shows it. */
|
||||
export interface NetBoxInfo {
|
||||
id: number;
|
||||
@@ -1562,7 +1621,7 @@ export interface HeartbeatInput {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export type AgendaKind = "secret" | "certificate" | "domain" | "tailscale" | "warranty" | "support" | "maintenance" | "restore" | "updates" | "todo";
|
||||
export type AgendaKind = "secret" | "certificate" | "domain" | "tailscale" | "warranty" | "support" | "maintenance" | "restore" | "updates" | "todo" | "renewal";
|
||||
|
||||
/** One job on the to-do list. */
|
||||
export interface TodoItem {
|
||||
@@ -2385,7 +2444,7 @@ export interface ManualTaskInput {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export type IntegrationType = "proxmox" | "synology" | "semaphore" | "tailscale" | "gitea" | "dockhand" | "uptimekuma" | "phpipam" | "pbs" | "osticket" | "unifi" | "npm" | "homeassistant" | "ups" | "jellyfin" | "authentik" | "prometheus" | "immich" | "paperless" | "nextcloud" | "netbox" | "n8n" | "hetzner";
|
||||
export type IntegrationType = "proxmox" | "synology" | "semaphore" | "tailscale" | "gitea" | "dockhand" | "uptimekuma" | "phpipam" | "pbs" | "osticket" | "unifi" | "npm" | "homeassistant" | "ups" | "jellyfin" | "authentik" | "prometheus" | "immich" | "paperless" | "nextcloud" | "netbox" | "n8n" | "hetzner" | "speedtest";
|
||||
|
||||
export interface IntegrationField {
|
||||
key: string;
|
||||
@@ -2970,6 +3029,16 @@ export const api = {
|
||||
netbox: {
|
||||
list: () => request<{ netboxes: NetBoxInfo[] }>("/api/netbox"),
|
||||
},
|
||||
costs: {
|
||||
get: () => request<CostsReport>("/api/costs"),
|
||||
create: (data: CostInput) => request<{ id: number }>("/api/costs", { method: "POST", body: JSON.stringify(data) }),
|
||||
update: (id: number, data: CostInput) => request<{ id: number }>(`/api/costs/${id}`, { method: "PUT", body: JSON.stringify(data) }),
|
||||
remove: (id: number) => request<void>(`/api/costs/${id}`, { method: "DELETE" }),
|
||||
},
|
||||
speedtest: {
|
||||
list: () => request<{ speedtests: SpeedtestInfo[] }>("/api/speedtest"),
|
||||
history: (id: number, days: number) => request<SpeedtestHistory>(`/api/speedtest/${id}/history?days=${days}`),
|
||||
},
|
||||
hetzner: {
|
||||
list: () => request<{ projects: HetznerProject[] }>("/api/hetzner"),
|
||||
forServer: (serverId: number) => request<HetznerForServer>(`/api/hetzner/for-server/${serverId}`),
|
||||
|
||||
Reference in new issue
Block a user