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
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useState, type CSSProperties, type ReactNode } from "react";
|
||||
import { Fragment, useEffect, useState, type CSSProperties, type ReactNode } from "react";
|
||||
import { Link, useSearchParams } from "react-router-dom";
|
||||
import { api, type CurrentUser, type IntegrationSummary, type IntegrationType } from "../api/client";
|
||||
import IntegrationForm from "../components/IntegrationForm";
|
||||
@@ -13,59 +13,7 @@ import { ErrorNotice } from "../components/Notice";
|
||||
import { toast } from "../utils/toast";
|
||||
import UptimeRibbon from "../components/UptimeRibbon";
|
||||
import RunbookEntry from "../components/RunbookEntry";
|
||||
|
||||
const TYPE_LABELS: Record<IntegrationType, string> = {
|
||||
tailscale: "Tailscale",
|
||||
proxmox: "Proxmox",
|
||||
synology: "Synology",
|
||||
semaphore: "Semaphore",
|
||||
gitea: "Gitea",
|
||||
dockhand: "Dockhand",
|
||||
uptimekuma: "Uptime Kuma",
|
||||
phpipam: "phpIPAM",
|
||||
pbs: "Proxmox Backup Server",
|
||||
osticket: "osTicket",
|
||||
unifi: "UniFi",
|
||||
npm: "Nginx Proxy Manager",
|
||||
homeassistant: "Home Assistant",
|
||||
ups: "UPS",
|
||||
jellyfin: "Jellyfin",
|
||||
authentik: "Authentik",
|
||||
prometheus: "Prometheus",
|
||||
immich: "Immich",
|
||||
paperless: "Paperless-ngx",
|
||||
n8n: "n8n",
|
||||
netbox: "NetBox",
|
||||
nextcloud: "Nextcloud",
|
||||
hetzner: "Hetzner Cloud",
|
||||
};
|
||||
|
||||
/** The page each kind of integration gets once it is connected. */
|
||||
const TYPE_PAGES: Record<IntegrationType, string> = {
|
||||
tailscale: "/tailscale",
|
||||
proxmox: "/proxmox",
|
||||
synology: "/synology",
|
||||
semaphore: "/semaphore",
|
||||
gitea: "/gitea",
|
||||
dockhand: "/docker",
|
||||
uptimekuma: "/uptime-kuma",
|
||||
phpipam: "/ipam",
|
||||
pbs: "/pbs",
|
||||
osticket: "/osticket",
|
||||
unifi: "/network/devices",
|
||||
npm: "/proxy-hosts",
|
||||
homeassistant: "/home-assistant",
|
||||
ups: "/ups",
|
||||
jellyfin: "/jellyfin",
|
||||
authentik: "/authentik",
|
||||
prometheus: "/prometheus",
|
||||
immich: "/immich",
|
||||
paperless: "/paperless",
|
||||
n8n: "/n8n",
|
||||
netbox: "/netbox",
|
||||
nextcloud: "/nextcloud",
|
||||
hetzner: "/hetzner",
|
||||
};
|
||||
import { groupOfType, TYPE_GROUPS, TYPE_LABELS, TYPE_PAGES } from "../utils/integrationTypes";
|
||||
|
||||
/** "pve.example.lan" out of "https://pve.example.lan:8006/", or the text itself when it isn't an address. */
|
||||
function hostOf(baseUrl: string): string {
|
||||
@@ -202,6 +150,14 @@ function IntegrationsList({ user, tabs }: { user: CurrentUser; tabs: ReactNode }
|
||||
(statusFilter === "disabled" ? !i.enabled : statusFilter === "failing" ? i.enabled && i.health?.status === "failing" : i.enabled && i.health?.status === "ok");
|
||||
const sortedIntegrations = tableSearch.filtered ? [...tableSearch.filtered].filter(matchesStatus).sort((a, b) => a.name.localeCompare(b.name)) : null;
|
||||
|
||||
// The cards in groups, as the sidebar groups their pages (a kind nobody has placed goes under "Other").
|
||||
const groupedIntegrations = (() => {
|
||||
const groups = new Map<string, { id: string; label: string; items: IntegrationSummary[] }>();
|
||||
for (const g of [...TYPE_GROUPS.map(({ id, label }) => ({ id, label })), { id: "other", label: "Other" }]) groups.set(g.id, { ...g, items: [] });
|
||||
for (const i of sortedIntegrations ?? []) groups.get(groupOfType(i.type).id)!.items.push(i);
|
||||
return [...groups.values()].filter((g) => g.items.length > 0);
|
||||
})();
|
||||
|
||||
function exportCsv() {
|
||||
if (!sortedIntegrations) return;
|
||||
downloadCsv(
|
||||
@@ -217,8 +173,7 @@ function IntegrationsList({ user, tabs }: { user: CurrentUser; tabs: ReactNode }
|
||||
<div>
|
||||
<h2 className="page-title mb-0">Integrations</h2>
|
||||
<div className="text-secondary small mt-1">
|
||||
Tailscale, Proxmox, Synology, Semaphore, Gitea, Dockhand, and Uptime Kuma each get their own page
|
||||
once connected — add and manage credentials here.
|
||||
Each connected system gets its own page — open it from here or from the sidebar, in the group shown. Add and manage credentials here.
|
||||
</div>
|
||||
</div>
|
||||
{isAdmin && !adding && !editingIntegration && (
|
||||
@@ -287,7 +242,14 @@ function IntegrationsList({ user, tabs }: { user: CurrentUser; tabs: ReactNode }
|
||||
</div>
|
||||
|
||||
<div className="row row-cards">
|
||||
{sortedIntegrations?.map((i) => {
|
||||
{groupedIntegrations.map((group) => (
|
||||
<Fragment key={group.id}>
|
||||
<div className="col-12">
|
||||
<h4 className="mb-0 mt-2">
|
||||
{group.label} <span className="text-secondary fw-normal small">{group.items.length}</span>
|
||||
</h4>
|
||||
</div>
|
||||
{group.items.map((i) => {
|
||||
const result = testResults[i.id];
|
||||
const page = TYPE_PAGES[i.type];
|
||||
return (
|
||||
@@ -348,6 +310,8 @@ function IntegrationsList({ user, tabs }: { user: CurrentUser; tabs: ReactNode }
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</Fragment>
|
||||
))}
|
||||
{sortedIntegrations?.length === 0 && (
|
||||
<div className="col-12">
|
||||
<div className="card">
|
||||
|
||||
Reference in new issue
Block a user