Fold long page introductions to two lines with Show more

One component, PageIntro, for the text under a page's title: shown as it is
when it fits in two lines, otherwise folded with a Show more, remembered per
page in this browser, opened by tabbing to a link in it, unfolded in print.
Used on 41 pages.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-10 19:42:34 +01:00
1 parent a2b43bcd5d
commit 9937ab2202
46 files changed
+307 -82

No files matched your search

+2
View File
@@ -950,6 +950,8 @@ switched by `?view=`, so a section can be linked to: an alert about a failing se
**The status strip.** Under a server's name, on every section of its page, a row of figures says how it is at a glance: **Status** (online, with when it last reported — or *offline*, with when it did, and a note when Proxmox says the guest is still running, so a stopped agent is not read as a dead machine; for a server with no agent report, what Proxmox says, or that nothing has reported), **Maintenance** (only while a window on this server is on, with when it ends and why), **Alerts** (how many are open about this server and how bad — what a maintenance window, a snooze or a closing has put aside is not counted, but said — and a link to the Alerts page), **Updates** (what is waiting, how many of them security fixes, whether a reboot is needed), **Disk** (the fullest, against its own limit: green, yellow within ten points of it, red at it; a mount with its own limit is judged by that, and an ignored mount is left out), **CPU · memory** and **how long it has run** (for a guest Proxmox reads, or from an agent of version 8 on Linux, 7 on Windows, which say it in every report; left out while the server is offline, since it is then no longer how long it has been up). A figure nothing is known for is left out or says so — it is never filled in. It uses what the page already has plus the alerts and the maintenance windows, read again whenever the page is (the *Refresh* button). Everyone signed in sees it. **The status strip.** Under a server's name, on every section of its page, a row of figures says how it is at a glance: **Status** (online, with when it last reported — or *offline*, with when it did, and a note when Proxmox says the guest is still running, so a stopped agent is not read as a dead machine; for a server with no agent report, what Proxmox says, or that nothing has reported), **Maintenance** (only while a window on this server is on, with when it ends and why), **Alerts** (how many are open about this server and how bad — what a maintenance window, a snooze or a closing has put aside is not counted, but said — and a link to the Alerts page), **Updates** (what is waiting, how many of them security fixes, whether a reboot is needed), **Disk** (the fullest, against its own limit: green, yellow within ten points of it, red at it; a mount with its own limit is judged by that, and an ignored mount is left out), **CPU · memory** and **how long it has run** (for a guest Proxmox reads, or from an agent of version 8 on Linux, 7 on Windows, which say it in every report; left out while the server is offline, since it is then no longer how long it has been up). A figure nothing is known for is left out or says so — it is never filled in. It uses what the page already has plus the alerts and the maintenance windows, read again whenever the page is (the *Refresh* button). Everyone signed in sees it.
**Shorter page introductions.** The few lines under a page’s title that say what the page is are folded to two lines when they are longer than that, with **Show more** under them, so the page’s own content starts higher up. What you choose is remembered for that page in this browser; a short one is shown as it is, a link inside the folded part opens it when you tab to it, and a printout shows all of it.
**Notification history.** Records → Notifications lists every notification that was sent, with how it went through each channel (or why it was not sent: held for quiet hours, a routing rule said nobody, no channel switched on), the error a channel gave when it refused, a filter and a search, and **Send again**. Kept 30 days. See NOTIFICATIONS.md. **Notification history.** Records → Notifications lists every notification that was sent, with how it went through each channel (or why it was not sent: held for quiet hours, a routing rule said nobody, no channel switched on), the error a channel gave when it refused, a filter and a search, and **Send again**. Kept 30 days. See NOTIFICATIONS.md.
**A shorter menu for a smaller homelab.** The menu has a page for every kind of integration the app can read, whether or not you run it. **Settings → Display → Menu → Hide the pages of integrations I have not added** (off until you switch it on, the same for everyone) leaves out of the menu, the command palette and the `g`-shortcuts the pages whose integrations are not in **Administration → Integrations**: Gitea, n8n, Grafana … as the list under the switch says (a disabled integration still counts as added; any one of Sonarr, Radarr, Lidarr, Readarr or Prowlarr keeps *Media managers*, and a Proxmox or a Backup Server keeps *Proxmox backups*). Pages that are useful without an integration — Servers, Alerts, DNS, Endpoints, Secrets, Inventory and the rest — always stay, a group with nothing left disappears, and a hidden page is still there by its address. Adding an integration brings its page back at once. **A shorter menu for a smaller homelab.** The menu has a page for every kind of integration the app can read, whether or not you run it. **Settings → Display → Menu → Hide the pages of integrations I have not added** (off until you switch it on, the same for everyone) leaves out of the menu, the command palette and the `g`-shortcuts the pages whose integrations are not in **Administration → Integrations**: Gitea, n8n, Grafana … as the list under the switch says (a disabled integration still counts as added; any one of Sonarr, Radarr, Lidarr, Readarr or Prowlarr keeps *Media managers*, and a Proxmox or a Backup Server keeps *Proxmox backups*). Pages that are useful without an integration — Servers, Alerts, DNS, Endpoints, Secrets, Inventory and the rest — always stay, a group with nothing left disappears, and a hidden page is still there by its address. Adding an integration brings its page back at once.
+68
View File
@@ -0,0 +1,68 @@
/**
* The folded introductions under page titles: what is remembered about which ones the person has opened out, kept as a short list of page paths — and that every page that has such a text
* uses the one component for it, so they all fold the same way.
*
* Run with: npm test --workspace server
*/
import { test, describe } from "node:test";
import assert from "node:assert/strict";
import { readdirSync, readFileSync } from "node:fs";
import { join } from "node:path";
const { parseOpen, withOpen } = await import("../../web/src/utils/pageIntro.js");
describe("what is remembered", () => {
test("a list of paths as stored; anything else is an empty list", () => {
assert.deepEqual(parseOpen('["/duplicati","/technitium"]'), ["/duplicati", "/technitium"]);
for (const junk of [null, "", "nope", "{}", "5", '"x"']) assert.deepEqual(parseOpen(junk), [], String(junk));
assert.deepEqual(parseOpen('["/a", 5, null, "/b"]'), ["/a", "/b"], "what is not a path is dropped");
});
test("opening a page adds it once; folding it takes it away; the others are left as they were", () => {
const one = withOpen([], "/duplicati", true);
assert.deepEqual(one, ["/duplicati"]);
assert.deepEqual(withOpen(one, "/duplicati", true), ["/duplicati"], "not twice");
assert.deepEqual(withOpen(withOpen(one, "/technitium", true), "/duplicati", false), ["/technitium"]);
});
test("the list never grows past 200: the newest are kept", () => {
let list: string[] = [];
for (let i = 0; i < 250; i++) list = withOpen(list, `/page-${i}`, true);
assert.equal(list.length, 200);
assert.equal(list[0], "/page-50");
assert.equal(list.at(-1), "/page-249");
});
});
describe("the pages", () => {
const pages = join(import.meta.dirname, "..", "..", "web", "src", "pages");
const files = readdirSync(pages).filter((f) => f.endsWith(".tsx"));
const read = (f: string) => readFileSync(join(pages, f), "utf8");
test("the long introductions that were converted use the component, with its import, and no page is left with a long one in a bare paragraph", () => {
const using = files.filter((f) => read(f).includes("<PageIntro"));
assert.ok(using.length >= 38, `${using.length} pages use it`);
for (const f of using) assert.match(read(f), /import PageIntro from "\.\.\/components\/PageIntro";/, f);
// After a page's title, the first block of secondary text of any length (but a short note) is the component's.
const bare: string[] = [];
for (const f of files) {
const s = read(f).replace(/\r\n/g, "\n");
const t = s.indexOf("page-title");
if (t < 0 || s.slice(t, t + 3500).includes("<PageIntro")) continue;
const m = /<(p|div) className="(?:[^"]*\s)?text-secondary(?:\s[^"]*)?">([\s\S]*?)<\/\1>/.exec(s.slice(t, t + 3500));
const text = m ? m[2].replace(/<[^>]+>/g, "").replace(/\{[^}]*\}/g, "x").replace(/\s+/g, " ").trim() : "";
if (text.length >= 200 && !/card-body/.test(m![0].slice(0, 80))) bare.push(`${f} (${text.length})`);
}
// The few that follow their title with a note of another kind (a card, a field's hint) are not introductions.
assert.deepEqual(bare.filter((b) => !/^(Ipam|Servers|InventoryLabels|Privacy)\.tsx/.test(b)), []);
});
test("the component keeps all of the text (it is folded with the styles, never cut from the page) and is printed unfolded", () => {
const component = readFileSync(join(import.meta.dirname, "..", "..", "web", "src", "components", "PageIntro.tsx"), "utf8");
assert.match(component, /aria-expanded=\{open\}/);
assert.match(component, /\{children\}/);
const css = readFileSync(join(import.meta.dirname, "..", "..", "web", "src", "styles.css"), "utf8");
assert.match(css, /\.page-intro-clamp[\s\S]*?-webkit-line-clamp:\s*2/);
assert.match(css, /@media print[\s\S]*?\.page-intro-clamp[\s\S]*?overflow:\s*visible/);
});
});
+54
View File
@@ -0,0 +1,54 @@
import { useId, useLayoutEffect, useRef, useState, type ReactNode } from "react";
import { useLocation } from "react-router-dom";
import { isIntroOpen, rememberIntroOpen } from "../utils/pageIntro";
/**
* The few lines under a page's title that say what the page is. Short ones show as they are; one that runs to more than two lines is folded to two with a "Show more" under it, so the page's
* own content starts higher up, and what the person chose is remembered for that page in this browser. All of the text is in the page either way (a screen reader reads it all, a printout
* shows it all, and tabbing to a link in the folded part opens it).
*/
export default function PageIntro({ children, className = "mb-3" }: { children: ReactNode; className?: string }) {
const { pathname } = useLocation();
const id = useId();
const ref = useRef<HTMLDivElement>(null);
const [open, setOpen] = useState(() => isIntroOpen(pathname));
const [overflowing, setOverflowing] = useState(false);
// Whether it is more than two lines at this width: measured against the line height, so it holds both folded and opened out.
useLayoutEffect(() => {
const el = ref.current;
if (!el) return;
const measure = () => {
const line = parseFloat(getComputedStyle(el).lineHeight) || 22;
setOverflowing(el.scrollHeight > line * 2 + 2);
};
measure();
if (typeof ResizeObserver === "undefined") return;
const watch = new ResizeObserver(measure);
watch.observe(el);
return () => watch.disconnect();
}, [children]);
const folded = overflowing && !open;
return (
<div className={`page-intro text-secondary ${className}`}>
<div id={id} ref={ref} className={folded ? "page-intro-clamp" : undefined} onFocusCapture={() => folded && setOpen(true)}>
{children}
</div>
{overflowing && (
<button
type="button"
className="btn btn-link btn-sm p-0 page-intro-toggle"
aria-expanded={open}
aria-controls={id}
onClick={() => {
rememberIntroOpen(pathname, !open);
setOpen(!open);
}}
>
{open ? "Show less" : "Show more"}
</button>
)}
</div>
);
}
+3 -2
View File
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { formatAgo } from "../utils/duration"; import { formatAgo } from "../utils/duration";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ a }: { a: AdguardInstance }) { function Badge({ a }: { a: AdguardInstance }) {
if (!a.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!a.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -166,10 +167,10 @@ export default function AdguardHome({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">AdGuard Home</h2> <h2 className="page-title">AdGuard Home</h2>
<p className="text-secondary"> <PageIntro>
Read every two minutes (see <Link to="/integrations">Integrations</Link>), with a real DNS question put to it each time — its web interface can be up while DNS is not. Nothing is changed. <strong>DNS that stops answering</strong>, <strong>a DNS server that is not running</strong>,{" "} Read every two minutes (see <Link to="/integrations">Integrations</Link>), with a real DNS question put to it each time — its web interface can be up while DNS is not. Nothing is changed. <strong>DNS that stops answering</strong>, <strong>a DNS server that is not running</strong>,{" "}
<strong>protection left off for an hour</strong> and <strong>filter lists that stopped updating</strong> are alerts — see <Link to="/alerts">Alerts</Link>. <strong>protection left off for an hour</strong> and <strong>filter lists that stopped updating</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -9,6 +9,7 @@ import { guessAdminUrl, portOptionLabel } from "../utils/adminLinkUrl";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import TableToolbar from "../components/TableToolbar"; import TableToolbar from "../components/TableToolbar";
import { EmptyRow, LoadingRow } from "../components/EmptyState"; import { EmptyRow, LoadingRow } from "../components/EmptyState";
import PageIntro from "../components/PageIntro";
interface LinkForm { interface LinkForm {
serverId: number | ""; serverId: number | "";
@@ -152,10 +153,10 @@ export default function AdminLinks({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title mb-3">Admin Links</h2> <h2 className="page-title mb-3">Admin Links</h2>
<p className="text-secondary"> <PageIntro>
Every admin bookmark added to a server's own page (Infrastructure → Servers → a server → Admin Links) — Dockge, Every admin bookmark added to a server's own page (Infrastructure → Servers → a server → Admin Links) — Dockge,
Webmin, Cockpit, and the like — in one place, instead of visiting each server to find them. Webmin, Cockpit, and the like — in one place, instead of visiting each server to find them.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{canEdit && showForm && ( {canEdit && showForm && (
+3 -2
View File
@@ -9,6 +9,7 @@ import { confirmDialog } from "../utils/dialogs";
import { formatDate } from "../utils/date"; import { formatDate } from "../utils/date";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
const EXPIRY = [ const EXPIRY = [
{ value: "90", label: "90 days" }, { value: "90", label: "90 days" },
@@ -87,9 +88,9 @@ export default function ApiTokens() {
<div className="d-flex align-items-center mb-1"> <div className="d-flex align-items-center mb-1">
<h2 className="page-title mb-0">API tokens</h2> <h2 className="page-title mb-0">API tokens</h2>
</div> </div>
<div className="text-secondary mb-3"> <PageIntro>
Read-only access to your installation&rsquo;s data for scripts, Home Assistant and dashboards. A token can only read, sees what you see, and stops working when you are removed. Make one for each thing that reads, so each can be removed on its own. Read-only access to your installation&rsquo;s data for scripts, Home Assistant and dashboards. A token can only read, sees what you see, and stops working when you are removed. Make one for each thing that reads, so each can be removed on its own.
</div> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{fresh && ( {fresh && (
+3 -2
View File
@@ -10,6 +10,7 @@ import TimeAgo from "../components/TimeAgo";
import { BlockSkeleton } from "../components/Skeleton"; import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ a }: { a: AuthentikInfo }) { function Badge({ a }: { a: AuthentikInfo }) {
if (!a.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!a.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -194,7 +195,7 @@ export default function Authentik({ user }: { user: CurrentUser }) {
/> />
)} )}
{view === "status" ? ( {view === "status" ? (
<p className="text-secondary"> <PageIntro>
The sign-in in front of everything else. It is read every few minutes with an API token (see <Link to="/integrations">Integrations</Link>). An <strong>outpost that goes quiet</strong> (the apps it guards stop letting anyone in), a <strong>certificate</strong> or an{" "} The sign-in in front of everything else. It is read every few minutes with an API token (see <Link to="/integrations">Integrations</Link>). An <strong>outpost that goes quiet</strong> (the apps it guards stop letting anyone in), a <strong>certificate</strong> or an{" "}
<strong>API token</strong> that is about to run out, <strong>no worker</strong> and a burst of <strong>failed sign-ins</strong> are alerts — see <Link to="/alerts">Alerts</Link>. <strong>API token</strong> that is about to run out, <strong>no worker</strong> and a burst of <strong>failed sign-ins</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
{isAdmin && ( {isAdmin && (
@@ -203,7 +204,7 @@ export default function Authentik({ user }: { user: CurrentUser }) {
Making users and looking after users and groups is under <Link to="/authentik?view=users">Users and groups</Link>. Making users and looking after users and groups is under <Link to="/authentik?view=users">Users and groups</Link>.
</> </>
)} )}
</p> </PageIntro>
) : ( ) : (
<p className="text-secondary"> <p className="text-secondary">
Make a user — with a one-time link for them to choose their own password — switch users off, edit or delete them, and make and rename groups and change who is in them. It needs a token that may do that on the integration (<Link to="/integrations">Integrations</Link> → edit), Make a user — with a one-time link for them to choose their own password — switch users off, edit or delete them, and make and rename groups and change who is in them. It needs a token that may do that on the integration (<Link to="/integrations">Integrations</Link> → edit),
+3 -2
View File
@@ -15,6 +15,7 @@ import { useTableSearch } from "../hooks/useTableSearch";
import { downloadCsv } from "../utils/csv"; import { downloadCsv } from "../utils/csv";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { EmptyRow } from "../components/EmptyState"; import { EmptyRow } from "../components/EmptyState";
import PageIntro from "../components/PageIntro";
interface Row extends CoverageGuest { interface Row extends CoverageGuest {
/** Worst first, so a default sort puts what needs attention at the top. */ /** Worst first, so a default sort puts what needs attention at the top. */
@@ -179,9 +180,9 @@ export default function Backups({ user, tabs }: { user?: CurrentUser; /** The ta
</button> </button>
</div> </div>
{tabs} {tabs}
<p className="text-secondary"> <PageIntro>
Every Proxmox guest: is a backup job covering it, when was it last backed up, and did that go well. {report && trouble > 0 ? `${trouble} need a look.` : ""} Every Proxmox guest: is a backup job covering it, when was it last backed up, and did that go well. {report && trouble > 0 ? `${trouble} need a look.` : ""}
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{badSources.length > 0 && ( {badSources.length > 0 && (
<div className="alert alert-warning"> <div className="alert alert-warning">
+3 -2
View File
@@ -7,6 +7,7 @@ import EmptyState from "../components/EmptyState";
import { downloadCsv } from "../utils/csv"; import { downloadCsv } from "../utils/csv";
import { formatDate, formatTime } from "../utils/date"; import { formatDate, formatTime } from "../utils/date";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
const KINDS: { id: AgendaKind; label: string }[] = [ const KINDS: { id: AgendaKind; label: string }[] = [
{ id: "secret", label: "Secrets" }, { id: "secret", label: "Secrets" },
@@ -195,7 +196,7 @@ export default function ComingUp({ user }: { user: CurrentUser }) {
Export CSV Export CSV
</button> </button>
</div> </div>
<p className="text-secondary"> <PageIntro>
What is about to need attention, nearest first: things that expire, hardware that ages out, planned maintenance, restore tests that are due. Each also raises its own alert when it gets close. What is about to need attention, nearest first: things that expire, hardware that ages out, planned maintenance, restore tests that are due. Each also raises its own alert when it gets close.
{user.role === "admin" ? ( {user.role === "admin" ? (
<> <>
@@ -205,7 +206,7 @@ export default function ComingUp({ user }: { user: CurrentUser }) {
) : ( ) : (
" An administrator can make a calendar feed of it for your phone." " An administrator can make a calendar feed of it for your phone."
)} )}
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{agenda && agenda.notes.length > 0 && ( {agenda && agenda.notes.length > 0 && (
<div className="alert alert-warning" role="status"> <div className="alert alert-warning" role="status">
+3 -2
View File
@@ -8,6 +8,7 @@ import { formatAgo } from "../utils/duration";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { promptDialog } from "../utils/dialogs"; import { promptDialog } from "../utils/dialogs";
import { ErrorNotice, SuccessNotice } from "../components/Notice"; import { ErrorNotice, SuccessNotice } from "../components/Notice";
import PageIntro from "../components/PageIntro";
const KINDS: { kind: ConsistencyKind; title: string; blurb: string }[] = [ const KINDS: { kind: ConsistencyKind; title: string; blurb: string }[] = [
{ kind: "ip_conflict", title: "Address conflicts", blurb: "The same address reported by more than one server." }, { kind: "ip_conflict", title: "Address conflicts", blurb: "The same address reported by more than one server." },
@@ -167,10 +168,10 @@ export default function Consistency({ user }: { user: CurrentUser }) {
</button> </button>
</div> </div>
</div> </div>
<div className="text-secondary mb-3"> <PageIntro>
Where IPAM, DNS and your servers disagree about what lives at an address. It compares what's already stored — nothing is Where IPAM, DNS and your servers disagree about what lives at an address. It compares what's already stored — nothing is
fetched from the servers or DNS providers when you open this page. fetched from the servers or DNS providers when you open this page.
</div> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
<SuccessNotice notice={notice} /> <SuccessNotice notice={notice} />
+3 -2
View File
@@ -9,6 +9,7 @@ import { confirmDialog } from "../utils/dialogs";
import { formatDate } from "../utils/date"; import { formatDate } from "../utils/date";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
const money = (n: number, currency: string) => { const money = (n: number, currency: string) => {
try { try {
@@ -140,9 +141,9 @@ export default function Costs({ user }: { user: CurrentUser }) {
<div className="d-flex flex-wrap align-items-center gap-3 mb-3"> <div className="d-flex flex-wrap align-items-center gap-3 mb-3">
<div style={{ flex: "1 1 320px", minWidth: 0 }}> <div style={{ flex: "1 1 320px", minWidth: 0 }}>
<h2 className="page-title mb-0">Costs</h2> <h2 className="page-title mb-0">Costs</h2>
<div className="text-secondary small mt-1"> <PageIntro className="small mt-1">
What the homelab costs, in one place: what you pay for by hand and what can be read (a Hetzner project&rsquo;s estimate — see <Link to="/hetzner">Hetzner Cloud</Link>). Each currency has its own total; none is converted into another. A day a bill falls on shows under <Link to="/coming-up">Coming up</Link>. What the homelab costs, in one place: what you pay for by hand and what can be read (a Hetzner project&rsquo;s estimate — see <Link to="/hetzner">Hetzner Cloud</Link>). Each currency has its own total; none is converted into another. A day a bill falls on shows under <Link to="/coming-up">Coming up</Link>.
</div> </PageIntro>
</div> </div>
{isAdmin && !form && ( {isAdmin && !form && (
<button className="btn btn-primary ms-auto flex-shrink-0" onClick={() => setForm({ id: null, value: blank(defaultCurrency) })}> <button className="btn btn-primary ms-auto flex-shrink-0" onClick={() => setForm({ id: null, value: blank(defaultCurrency) })}>
+3 -2
View File
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { formatBytes } from "./settings/StorageSettings"; import { formatBytes } from "./settings/StorageSettings";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
const KIND_NAMES: Record<DownloadClient["kind"], string> = { qbittorrent: "qBittorrent", sabnzbd: "SABnzbd" }; const KIND_NAMES: Record<DownloadClient["kind"], string> = { qbittorrent: "qBittorrent", sabnzbd: "SABnzbd" };
const SHOWN = 25; const SHOWN = 25;
@@ -259,10 +260,10 @@ export default function Downloads({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">Download clients</h2> <h2 className="page-title">Download clients</h2>
<p className="text-secondary"> <PageIntro>
qBittorrent and SABnzbd, read every few minutes (see <Link to="/integrations">Integrations</Link>) — nothing is added, paused or removed. <strong>Downloads that are stuck</strong>, <strong>no connection</strong>, <strong>a queue left paused or getting nothing</strong> and{" "} qBittorrent and SABnzbd, read every few minutes (see <Link to="/integrations">Integrations</Link>) — nothing is added, paused or removed. <strong>Downloads that are stuck</strong>, <strong>no connection</strong>, <strong>a queue left paused or getting nothing</strong> and{" "}
<strong>a disk nearly full</strong> are alerts — see <Link to="/alerts">Alerts</Link>. What Sonarr, Radarr and the others think of their downloads is on <Link to="/media">Media managers</Link>. <strong>a disk nearly full</strong> are alerts — see <Link to="/alerts">Alerts</Link>. What Sonarr, Radarr and the others think of their downloads is on <Link to="/media">Media managers</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -11,6 +11,7 @@ import { formatBytes } from "./settings/StorageSettings";
import { confirmDialog } from "../utils/dialogs"; import { confirmDialog } from "../utils/dialogs";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
const STATE: Record<DuplicatiBackup["state"], { label: string; cls: string }> = { const STATE: Record<DuplicatiBackup["state"], { label: string; cls: string }> = {
ok: { label: "In order", cls: "bg-green-lt text-green" }, ok: { label: "In order", cls: "bg-green-lt text-green" },
@@ -267,10 +268,10 @@ export default function Duplicati({ user }: { user: CurrentUser }) {
</button> </button>
)} )}
</div> </div>
<p className="text-secondary"> <PageIntro>
Whether the backups Duplicati makes are being made. Duplicati tells this app how each backup went (its own <em>send-http-url</em> option), so nothing here calls Duplicati and no password for it is kept. A backup that <strong>fails</strong>, Whether the backups Duplicati makes are being made. Duplicati tells this app how each backup went (its own <em>send-http-url</em> option), so nothing here calls Duplicati and no password for it is kept. A backup that <strong>fails</strong>,
or has <strong>not succeeded for longer than it should</strong>, is an alert — see <Link to="/alerts">Alerts</Link>. A run that finishes with <strong>warnings</strong> still counts as a good backup; open a job&rsquo;s warnings to see what they said, and switch on <em>Alert on warnings</em> for the jobs where they matter. or has <strong>not succeeded for longer than it should</strong>, is an alert — see <Link to="/alerts">Alerts</Link>. A run that finishes with <strong>warnings</strong> still counts as a good backup; open a job&rsquo;s warnings to see what they said, and switch on <em>Alert on warnings</em> for the jobs where they matter.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{fresh && <Address path={fresh.path} name={fresh.name} onDone={() => setFresh(null)} />} {fresh && <Address path={fresh.path} name={fresh.name} onDone={() => setFresh(null)} />}
+3 -2
View File
@@ -17,6 +17,7 @@ import { toast } from "../utils/toast";
import { EmptyRow } from "../components/EmptyState"; import { EmptyRow } from "../components/EmptyState";
import EndpointSuggestions from "../components/EndpointSuggestions"; import EndpointSuggestions from "../components/EndpointSuggestions";
import EndpointHistory from "../components/EndpointHistory"; import EndpointHistory from "../components/EndpointHistory";
import PageIntro from "../components/PageIntro";
const KIND_LABELS: Record<EndpointKind, string> = { http: "Web address", tcp: "Port", tls: "Certificate" }; const KIND_LABELS: Record<EndpointKind, string> = { http: "Web address", tcp: "Port", tls: "Certificate" };
const KIND_HINTS: Record<EndpointKind, string> = { const KIND_HINTS: Record<EndpointKind, string> = {
@@ -255,10 +256,10 @@ export default function Endpoints({ user }: { user: CurrentUser }) {
</button> </button>
)} )}
</div> </div>
<p className="text-secondary"> <PageIntro>
The app asks a web address, a port or a certificate whether it is fine, every few minutes, and says so on the <Link to="/alerts">Alerts</Link> page and in notifications when it keeps failing or a The app asks a web address, a port or a certificate whether it is fine, every few minutes, and says so on the <Link to="/alerts">Alerts</Link> page and in notifications when it keeps failing or a
certificate is about to run out. certificate is about to run out.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
<div className="row row-cards mb-3"> <div className="row row-cards mb-3">
+3 -2
View File
@@ -12,6 +12,7 @@ import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import { barPosition, eventText, onHeadline } from "../utils/gamePower"; import { barPosition, eventText, onHeadline } from "../utils/gamePower";
import { formatDateTime } from "../utils/date"; import { formatDateTime } from "../utils/date";
import PageIntro from "../components/PageIntro";
type Server = FragnetServerInfo; type Server = FragnetServerInfo;
@@ -538,10 +539,10 @@ export default function GameServers({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">Game servers</h2> <h2 className="page-title">Game servers</h2>
<p className="text-secondary"> <PageIntro>
What Fragnet&rsquo;s game panel says about your servers, read every few minutes (see <Link to="/integrations">Integrations</Link>). <strong>A backup that is late</strong> and <strong>a disk or memory nearly full</strong> are alerts — see <Link to="/alerts">Alerts</Link>; a server that is stopped is not, since a game server is often stopped on purpose. What Fragnet&rsquo;s game panel says about your servers, read every few minutes (see <Link to="/integrations">Integrations</Link>). <strong>A backup that is late</strong> and <strong>a disk or memory nearly full</strong> are alerts — see <Link to="/alerts">Alerts</Link>; a server that is stopped is not, since a game server is often stopped on purpose.
{canAct ? " Start, stop and restart are sent to the panel when you press them; nothing else is ever changed." : " Operators can start, stop and restart them from here."} What they cost is added by hand under <Link to="/costs">Costs</Link>. {canAct ? " Start, stop and restart are sent to the panel when you press them; nothing else is ever changed." : " Operators can start, stop and restart them from here."} What they cost is added by hand under <Link to="/costs">Costs</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -14,6 +14,7 @@ import {
type PasswordOptions, type PasswordOptions,
} from "../utils/generators"; } from "../utils/generators";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import PageIntro from "../components/PageIntro";
const MIXED = "mixed"; const MIXED = "mixed";
@@ -85,10 +86,10 @@ export default function Generator({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title mb-3">Generator</h2> <h2 className="page-title mb-3">Generator</h2>
<div className="text-secondary mb-3"> <PageIntro>
Usernames and passwords are generated locally in your browser — nothing is sent to or stored on the server. Server names are Usernames and passwords are generated locally in your browser — nothing is sent to or stored on the server. Server names are
picked in your browser too, from name lists the server hands out. picked in your browser too, from name lists the server hands out.
</div> </PageIntro>
<div className="row row-cards"> <div className="row row-cards">
<div className="col-md-6 col-lg-4"> <div className="col-md-6 col-lg-4">
+3 -2
View File
@@ -7,6 +7,7 @@ import TimeAgo from "../components/TimeAgo";
import { BlockSkeleton } from "../components/Skeleton"; import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ g }: { g: GrafanaInstance }) { function Badge({ g }: { g: GrafanaInstance }) {
if (!g.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!g.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -149,10 +150,10 @@ export default function Grafana({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">Grafana</h2> <h2 className="page-title">Grafana</h2>
<p className="text-secondary"> <PageIntro>
Read every few minutes (see <Link to="/integrations">Integrations</Link>) — nothing is silenced, paused or changed. <strong>A rule that is firing</strong>, <strong>a rule Grafana cannot evaluate</strong> and <strong>a data source that fails its check</strong> are alerts — see <Link to="/alerts">Alerts</Link>. Read every few minutes (see <Link to="/integrations">Integrations</Link>) — nothing is silenced, paused or changed. <strong>A rule that is firing</strong>, <strong>a rule Grafana cannot evaluate</strong> and <strong>a data source that fails its check</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
Grafana can notify about its own alerts too; with both you hear twice. Grafana can notify about its own alerts too; with both you hear twice.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -17,6 +17,7 @@ import { confirmDialog } from "../utils/dialogs";
import { formatDateTime } from "../utils/date"; import { formatDateTime } from "../utils/date";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
const STATE_BADGE: Record<HeartbeatState, { label: string; badge: string }> = { const STATE_BADGE: Record<HeartbeatState, { label: string; badge: string }> = {
waiting: { label: "Waiting for the first call", badge: "bg-secondary-lt text-secondary" }, waiting: { label: "Waiting for the first call", badge: "bg-secondary-lt text-secondary" },
@@ -237,10 +238,10 @@ export default function Heartbeats({ user }: { user: CurrentUser }) {
</button> </button>
)} )}
</div> </div>
<p className="text-secondary"> <PageIntro>
For jobs that should run on their own — a backup, a sync, a cleanup. The job calls an address when it finishes; if the call doesn&rsquo;t come in time, or the job says it failed, it appears on the{" "} For jobs that should run on their own — a backup, a sync, a cleanup. The job calls an address when it finishes; if the call doesn&rsquo;t come in time, or the job says it failed, it appears on the{" "}
<Link to="/alerts">Alerts</Link> page and in notifications. <Link to="/alerts">Alerts</Link> page and in notifications.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{showing && <HowToCall name={showing.name} url={urlOf(showing.path)} onClose={() => setShowing(null)} />} {showing && <HowToCall name={showing.name} url={urlOf(showing.path)} onClose={() => setShowing(null)} />}
+3 -2
View File
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { formatBytes } from "./settings/StorageSettings"; import { formatBytes } from "./settings/StorageSettings";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ p }: { p: HetznerProject }) { function Badge({ p }: { p: HetznerProject }) {
if (!p.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!p.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -352,10 +353,10 @@ export default function Hetzner({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">Hetzner Cloud</h2> <h2 className="page-title">Hetzner Cloud</h2>
<p className="text-secondary"> <PageIntro>
One project per integration, read every few minutes (see <Link to="/integrations">Integrations</Link>) — nothing is started, stopped or changed. <strong>A server that was running and is now off</strong>, <strong>traffic close to the month&rsquo;s quota</strong>,{" "} One project per integration, read every few minutes (see <Link to="/integrations">Integrations</Link>) — nothing is started, stopped or changed. <strong>A server that was running and is now off</strong>, <strong>traffic close to the month&rsquo;s quota</strong>,{" "}
<strong>rescue mode left on</strong>, <strong>backups that are late</strong>, <strong>a traffic quota the month is on course to pass</strong>, <strong>unhealthy load balancer targets</strong>, <strong>certificates about to end</strong> and <strong>floating IPs that point at nothing</strong> are alerts — see <Link to="/alerts">Alerts</Link>. <strong>rescue mode left on</strong>, <strong>backups that are late</strong>, <strong>a traffic quota the month is on course to pass</strong>, <strong>unhealthy load balancer targets</strong>, <strong>certificates about to end</strong> and <strong>floating IPs that point at nothing</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -7,6 +7,7 @@ import TimeAgo from "../components/TimeAgo";
import { BlockSkeleton } from "../components/Skeleton"; import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ a }: { a: RobotAccount }) { function Badge({ a }: { a: RobotAccount }) {
if (!a.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!a.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -207,10 +208,10 @@ export default function HetznerRobot({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">Hetzner Robot</h2> <h2 className="page-title">Hetzner Robot</h2>
<p className="text-secondary"> <PageIntro>
Dedicated servers and storage boxes at Hetzner (Robot — the cloud servers are on <Link to="/hetzner">Hetzner Cloud</Link>), read every fifteen minutes (see <Link to="/integrations">Integrations</Link>) — nothing is reset, ordered or cancelled.{" "} Dedicated servers and storage boxes at Hetzner (Robot — the cloud servers are on <Link to="/hetzner">Hetzner Cloud</Link>), read every fifteen minutes (see <Link to="/integrations">Integrations</Link>) — nothing is reset, ordered or cancelled.{" "}
<strong>A server or storage box that is cancelled and about to shut down</strong>, <strong>a locked storage box</strong>, <strong>a rescue system left on</strong> and <strong>a server stuck being set up</strong> are alerts — see <Link to="/alerts">Alerts</Link>. <strong>A server or storage box that is cancelled and about to shut down</strong>, <strong>a locked storage box</strong>, <strong>a rescue system left on</strong> and <strong>a server stuck being set up</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -10,6 +10,7 @@ import { ErrorNotice } from "../components/Notice";
import { useChartRange } from "../utils/chartRanges"; import { useChartRange } from "../utils/chartRanges";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
type Integration = HaOverview["integrations"][number]; type Integration = HaOverview["integrations"][number];
@@ -284,10 +285,10 @@ export default function HomeAssistant({ user }: { user: CurrentUser }) {
</div> </div>
)} )}
</div> </div>
<div className="text-secondary mb-3"> <PageIntro>
The few things worth an alert in Home Assistant — a UPS battery, a freezer, a pump — chosen here rather than every entity it has. Each is read every five minutes and its history is kept for 35 days. It only The few things worth an alert in Home Assistant — a UPS battery, a freezer, a pump — chosen here rather than every entity it has. Each is read every five minutes and its history is kept for 35 days. It only
reads; nothing is ever sent to Home Assistant. reads; nothing is ever sent to Home Assistant.
</div> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{data === null && !error && <BlockSkeleton lines={4} />} {data === null && !error && <BlockSkeleton lines={4} />}
{data && live.length === 0 && ( {data && live.length === 0 && (
+3 -2
View File
@@ -7,6 +7,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { formatBytes } from "./settings/StorageSettings"; import { formatBytes } from "./settings/StorageSettings";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ i }: { i: ImmichInfo }) { function Badge({ i }: { i: ImmichInfo }) {
if (!i.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!i.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -148,10 +149,10 @@ export default function Immich() {
return ( return (
<> <>
<h2 className="page-title">Immich</h2> <h2 className="page-title">Immich</h2>
<p className="text-secondary"> <PageIntro>
Photos are what cannot be made again, and Immich fails quietly. It is read every few minutes with an API key (see <Link to="/integrations">Integrations</Link>). A <strong>disk under the library that is filling up</strong> and <strong>background jobs that have failed</strong> (thumbnails and Photos are what cannot be made again, and Immich fails quietly. It is read every few minutes with an API key (see <Link to="/integrations">Integrations</Link>). A <strong>disk under the library that is filling up</strong> and <strong>background jobs that have failed</strong> (thumbnails and
metadata that were never made) are alerts — see <Link to="/alerts">Alerts</Link>. metadata that were never made) are alerts — see <Link to="/alerts">Alerts</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -20,6 +20,7 @@ import { groupOfType, INSPECTABLE, TYPE_GROUPS, TYPE_LABELS, TYPE_PAGES } from "
import { hostOf, integrationRow, integrationStatus, type IntegrationRow } from "../utils/integrationRows"; import { hostOf, integrationRow, integrationStatus, type IntegrationRow } from "../utils/integrationRows";
import { useSortable } from "../hooks/useSortable"; import { useSortable } from "../hooks/useSortable";
import SortableTh from "../components/SortableTh"; import SortableTh from "../components/SortableTh";
import PageIntro from "../components/PageIntro";
function HealthBadge({ i }: { i: IntegrationSummary }) { function HealthBadge({ i }: { i: IntegrationSummary }) {
const status = integrationStatus(i); const status = integrationStatus(i);
@@ -246,9 +247,9 @@ function IntegrationsList({ user, tabs }: { user: CurrentUser; tabs: ReactNode }
<div className="d-flex flex-wrap align-items-center gap-2 mb-3"> <div className="d-flex flex-wrap align-items-center gap-2 mb-3">
<div> <div>
<h2 className="page-title mb-0">Integrations</h2> <h2 className="page-title mb-0">Integrations</h2>
<div className="text-secondary small mt-1"> <PageIntro className="small mt-1">
Each connected system gets its own page — open it from here or from the sidebar, in the group shown. 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> </PageIntro>
</div> </div>
{isAdmin && !adding && !editingIntegration && ( {isAdmin && !adding && !editingIntegration && (
<button className="btn btn-primary ms-auto flex-shrink-0 text-nowrap" onClick={() => setAdding(true)}> <button className="btn btn-primary ms-auto flex-shrink-0 text-nowrap" onClick={() => setAdding(true)}>
+3 -2
View File
@@ -8,6 +8,7 @@ import { downloadCsv } from "../utils/csv";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { KIND_LABELS, money } from "../utils/inventory"; import { KIND_LABELS, money } from "../utils/inventory";
import type { AssetKind } from "../api/client"; import type { AssetKind } from "../api/client";
import PageIntro from "../components/PageIntro";
const YEARS = [3, 5, 7, 10]; const YEARS = [3, 5, 7, 10];
@@ -108,10 +109,10 @@ export default function InventoryLifecycle() {
</Link> </Link>
</div> </div>
</div> </div>
<p className="text-secondary"> <PageIntro>
What ages out, year by year, and roughly what replacing it will cost. Give a piece of hardware an <strong>end of support</strong> and a <strong>replacement cost</strong> in the inventory; until it has What ages out, year by year, and roughly what replacing it will cost. Give a piece of hardware an <strong>end of support</strong> and a <strong>replacement cost</strong> in the inventory; until it has
an end of support, the end of its warranty stands in, and until it has a replacement cost, what it was bought for. an end of support, the end of its warranty stands in, and until it has a replacement cost, what it was bought for.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!report && !error && <BlockSkeleton lines={5} />} {!report && !error && <BlockSkeleton lines={5} />}
+3 -2
View File
@@ -6,6 +6,7 @@ import { ErrorNotice } from "../components/Notice";
import { BlockSkeleton } from "../components/Skeleton"; import { BlockSkeleton } from "../components/Skeleton";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { KIND_LABELS } from "../utils/inventory"; import { KIND_LABELS } from "../utils/inventory";
import PageIntro from "../components/PageIntro";
type Rack = Awaited<ReturnType<typeof api.inventory.racks>>["racks"][number]; type Rack = Awaited<ReturnType<typeof api.inventory.racks>>["racks"][number];
@@ -79,9 +80,9 @@ export default function InventoryRacks() {
</Link> </Link>
</div> </div>
</div> </div>
<div className="text-secondary mb-3 no-print"> <PageIntro className="mb-3 no-print">
Each piece of hardware that gives a unit (&ldquo;U12&rdquo;, or &ldquo;U12-13&rdquo; for a tall one) and the rack&rsquo;s name as its location is drawn where it sits, from the bottom up. Two pieces in the same unit are shown in red. Each piece of hardware that gives a unit (&ldquo;U12&rdquo;, or &ldquo;U12-13&rdquo; for a tall one) and the rack&rsquo;s name as its location is drawn where it sits, from the bottom up. Two pieces in the same unit are shown in red.
</div> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{racks === null && !error && <BlockSkeleton lines={4} />} {racks === null && !error && <BlockSkeleton lines={4} />}
{racks !== null && racks.length === 0 && ( {racks !== null && racks.length === 0 && (
+3 -2
View File
@@ -9,6 +9,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { useChartRange } from "../utils/chartRanges"; import { useChartRange } from "../utils/chartRanges";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ j }: { j: JellyfinInfo }) { function Badge({ j }: { j: JellyfinInfo }) {
if (!j.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!j.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -180,10 +181,10 @@ export default function Jellyfin() {
return ( return (
<> <>
<h2 className="page-title">Jellyfin</h2> <h2 className="page-title">Jellyfin</h2>
<p className="text-secondary"> <PageIntro>
Whether Jellyfin is up and who is watching. It is read every couple of minutes with an API key (see <Link to="/integrations">Integrations</Link>). A Jellyfin that <strong>wants a restart</strong>, a <strong>scheduled task that failed</strong> or a burst of{" "} Whether Jellyfin is up and who is watching. It is read every couple of minutes with an API key (see <Link to="/integrations">Integrations</Link>). A Jellyfin that <strong>wants a restart</strong>, a <strong>scheduled task that failed</strong> or a burst of{" "}
<strong>failed sign-ins</strong> is an alert; and an update run on the machine it lives on <strong>asks first when somebody is streaming</strong>. <strong>failed sign-ins</strong> is an alert; and an update run on the machine it lives on <strong>asks first when somebody is streaming</strong>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -22,6 +22,7 @@ import MaintenanceTimeline from "../components/MaintenanceTimeline";
import RecurringMaintenance from "../components/RecurringMaintenance"; import RecurringMaintenance from "../components/RecurringMaintenance";
import ExportTableButton from "../components/ExportTableButton"; import ExportTableButton from "../components/ExportTableButton";
import { EmptyRow, LoadingRow } from "../components/EmptyState"; import { EmptyRow, LoadingRow } from "../components/EmptyState";
import PageIntro from "../components/PageIntro";
const DURATIONS: { minutes: number; label: string }[] = [ const DURATIONS: { minutes: number; label: string }[] = [
{ minutes: 30, label: "30 minutes" }, { minutes: 30, label: "30 minutes" },
@@ -248,10 +249,10 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title mb-3">Maintenance</h2> <h2 className="page-title mb-3">Maintenance</h2>
<div className="text-secondary mb-3"> <PageIntro>
Silence alerts about one server or integration while you work on it. Every window ends on its own — anything Silence alerts about one server or integration while you work on it. Every window ends on its own — anything
still wrong when it ends alerts then, so nothing stays hidden. still wrong when it ends alerts then, so nothing stays hidden.
</div> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{canEdit && ( {canEdit && (
+3 -2
View File
@@ -7,6 +7,7 @@ import { api, type MapData, type MapNode } from "../api/client";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { PageSkeleton } from "../components/Skeleton"; import { PageSkeleton } from "../components/Skeleton";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
const NODE_W = 210; const NODE_W = 210;
const NODE_H = 46; const NODE_H = 46;
@@ -115,9 +116,9 @@ export default function MapPage({ user }: { user: CurrentUser }) {
<ConnectionsMap /> <ConnectionsMap />
) : ( ) : (
<> <>
<p className="text-secondary"> <PageIntro>
A server that runs on another, a service that needs the server it is installed on. Pick a box to see what would go down with it before you reboot it. A server that runs on another, a service that needs the server it is installed on. Pick a box to see what would go down with it before you reboot it.
</p> </PageIntro>
<DependencyMap /> <DependencyMap />
<h3 className="mt-4 mb-2">Say what needs what</h3> <h3 className="mt-4 mb-2">Say what needs what</h3>
<DependencyEditor user={user} /> <DependencyEditor user={user} />
+3 -2
View File
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { formatBytes } from "./settings/StorageSettings"; import { formatBytes } from "./settings/StorageSettings";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
const KIND_NAMES: Record<ArrApp["kind"], string> = { sonarr: "Sonarr", radarr: "Radarr", prowlarr: "Prowlarr", lidarr: "Lidarr", readarr: "Readarr" }; const KIND_NAMES: Record<ArrApp["kind"], string> = { sonarr: "Sonarr", radarr: "Radarr", prowlarr: "Prowlarr", lidarr: "Lidarr", readarr: "Readarr" };
const QUEUE_SHOWN = 25; const QUEUE_SHOWN = 25;
@@ -218,10 +219,10 @@ export default function Media({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">Media managers</h2> <h2 className="page-title">Media managers</h2>
<p className="text-secondary"> <PageIntro>
Sonarr, Radarr, Prowlarr, Lidarr and Readarr, read every few minutes (see <Link to="/integrations">Integrations</Link>) — nothing is searched, grabbed or changed. <strong>What an application says is wrong with itself</strong>, <strong>downloads stuck for two hours</strong> and{" "} Sonarr, Radarr, Prowlarr, Lidarr and Readarr, read every few minutes (see <Link to="/integrations">Integrations</Link>) — nothing is searched, grabbed or changed. <strong>What an application says is wrong with itself</strong>, <strong>downloads stuck for two hours</strong> and{" "}
<strong>a disk nearly full</strong> are alerts — see <Link to="/alerts">Alerts</Link>. <strong>a disk nearly full</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -8,6 +8,7 @@ import { CATEGORY_NAMES, incidentPath, SEVERITY_BADGE } from "../components/Inci
import { formatDate, formatDateTime } from "../utils/date"; import { formatDate, formatDateTime } from "../utils/date";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
/** "2 h 40 min", "35 min", "3 d 4 h". */ /** "2 h 40 min", "35 min", "3 d 4 h". */
function span(minutes: number): string { function span(minutes: number): string {
@@ -196,7 +197,7 @@ export default function MonthlyReport({ user }: { user: CurrentUser }) {
</button> </button>
</div> </div>
</div> </div>
<p className="text-secondary no-print"> <PageIntro className="no-print mb-3">
How the {stretch} went, in one page: availability, how each service-level target did, incidents and how long they took, updates applied, restore tests and backups, and what was renewed. How the {stretch} went, in one page: availability, how each service-level target did, incidents and how long they took, updates applied, restore tests and backups, and what was renewed.
{user.role === "admin" ? ( {user.role === "admin" ? (
<> <>
@@ -204,7 +205,7 @@ export default function MonthlyReport({ user }: { user: CurrentUser }) {
It can be sent on a day of the month, and a quarter's and year's report after the month that ends it: <Link to="/settings/notifications">Settings → Notifications</Link>. It can be sent on a day of the month, and a quarter's and year's report after the month that ends it: <Link to="/settings/notifications">Settings → Notifications</Link>.
</> </>
) : null} ) : null}
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={6} />} {!data && !error && <BlockSkeleton lines={6} />}
+3 -2
View File
@@ -10,6 +10,7 @@ import { useMyWork } from "../hooks/useMyWork";
import { formatRemaining } from "../utils/duration"; import { formatRemaining } from "../utils/duration";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
const SEVERITY: Record<string, string> = { critical: "bg-red-lt text-red", warning: "bg-yellow-lt text-yellow", info: "bg-blue-lt text-blue" }; const SEVERITY: Record<string, string> = { critical: "bg-red-lt text-red", warning: "bg-yellow-lt text-yellow", info: "bg-blue-lt text-blue" };
@@ -102,9 +103,9 @@ export default function MyWorkPage({ user }: { user: CurrentUser }) {
<div className="d-flex flex-wrap align-items-center gap-2 mb-1"> <div className="d-flex flex-wrap align-items-center gap-2 mb-1">
<h2 className="page-title mb-0">My work</h2> <h2 className="page-title mb-0">My work</h2>
</div> </div>
<div className="text-secondary mb-3"> <PageIntro>
What has your name on it: alerts you acknowledged or were handed, maintenance you started and update runs you started, and jobs handed to you. Whatever is about to run out is marked, and listed first. What has your name on it: alerts you acknowledged or were handed, maintenance you started and update runs you started, and jobs handed to you. Whatever is about to run out is marked, and listed first.
</div> </PageIntro>
{work === null && <BlockSkeleton lines={4} />} {work === null && <BlockSkeleton lines={4} />}
+3 -2
View File
@@ -6,6 +6,7 @@ import TimeAgo from "../components/TimeAgo";
import { BlockSkeleton } from "../components/Skeleton"; import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ n }: { n: N8nInfo }) { function Badge({ n }: { n: N8nInfo }) {
if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -108,9 +109,9 @@ export default function N8n() {
return ( return (
<> <>
<h2 className="page-title">n8n</h2> <h2 className="page-title">n8n</h2>
<p className="text-secondary"> <PageIntro>
Which automations have quietly stopped working. It is read every few minutes with an API key (see <Link to="/integrations">Integrations</Link>). A <strong>workflow that is switched on and failed on its last run</strong> is an alert — see <Link to="/alerts">Alerts</Link>; it clears when the workflow next succeeds. Which automations have quietly stopped working. It is read every few minutes with an API key (see <Link to="/integrations">Integrations</Link>). A <strong>workflow that is switched on and failed on its last run</strong> is an alert — see <Link to="/alerts">Alerts</Link>; it clears when the workflow next succeeds.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -6,6 +6,7 @@ import TimeAgo from "../components/TimeAgo";
import { BlockSkeleton } from "../components/Skeleton"; import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ n }: { n: NetBoxInfo }) { function Badge({ n }: { n: NetBoxInfo }) {
if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -105,9 +106,9 @@ export default function NetBox() {
return ( return (
<> <>
<h2 className="page-title">NetBox</h2> <h2 className="page-title">NetBox</h2>
<p className="text-secondary"> <PageIntro>
Whether NetBox is working, and whether it is complete. It is read every few minutes with an API token (see <Link to="/integrations">Integrations</Link>). <strong>No background worker running</strong> is an alert — see <Link to="/alerts">Alerts</Link>; the servers missing from NetBox are only listed. Whether NetBox is working, and whether it is complete. It is read every few minutes with an API token (see <Link to="/integrations">Integrations</Link>). <strong>No background worker running</strong> is an alert — see <Link to="/alerts">Alerts</Link>; the servers missing from NetBox are only listed.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -22,6 +22,7 @@ import { usePagination } from "../hooks/usePagination";
import { downloadCsv } from "../utils/csv"; import { downloadCsv } from "../utils/csv";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
const KIND_LABELS: Record<NetworkDeviceKind, string> = { gateway: "Gateway", switch: "Switch", access_point: "Access point", other: "Other" }; const KIND_LABELS: Record<NetworkDeviceKind, string> = { gateway: "Gateway", switch: "Switch", access_point: "Access point", other: "Other" };
@@ -155,10 +156,10 @@ export default function NetworkDevices({ user }: { user: CurrentUser }) {
)} )}
</div> </div>
{tabs} {tabs}
<div className="text-secondary mb-3"> <PageIntro>
Switches, access points and gateways from your UniFi controller: whether each is up, its address, how long it has been running, and what it is connected through. The same devices take part in the Switches, access points and gateways from your UniFi controller: whether each is up, its address, how long it has been running, and what it is connected through. The same devices take part in the
dependency map, so when one is down what hangs off it is folded under its alert. dependency map, so when one is down what hangs off it is folded under its alert.
</div> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{data === null && !error && <BlockSkeleton lines={4} />} {data === null && !error && <BlockSkeleton lines={4} />}
+3 -2
View File
@@ -7,6 +7,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { formatBytes } from "./settings/StorageSettings"; import { formatBytes } from "./settings/StorageSettings";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ n }: { n: NextcloudInfo }) { function Badge({ n }: { n: NextcloudInfo }) {
if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -135,9 +136,9 @@ export default function Nextcloud() {
return ( return (
<> <>
<h2 className="page-title">Nextcloud</h2> <h2 className="page-title">Nextcloud</h2>
<p className="text-secondary"> <PageIntro>
Whether people can sign in. It is read every few minutes (see <Link to="/integrations">Integrations</Link>). <strong>Maintenance mode left on</strong>, <strong>a database that wants upgrading</strong>, <strong>background jobs that have stopped</strong> and <strong>the data disk running low</strong> are alerts — see <Link to="/alerts">Alerts</Link>. Whether people can sign in. It is read every few minutes (see <Link to="/integrations">Integrations</Link>). <strong>Maintenance mode left on</strong>, <strong>a database that wants upgrading</strong>, <strong>background jobs that have stopped</strong> and <strong>the data disk running low</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -9,6 +9,7 @@ import { formatDateTime } from "../utils/date";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { channelName, isLogStatus, STATUS_BADGE, STATUS_HINT, STATUS_LABEL, STATUS_ORDER, type LogStatus } from "../utils/notificationLog"; import { channelName, isLogStatus, STATUS_BADGE, STATUS_HINT, STATUS_LABEL, STATUS_ORDER, type LogStatus } from "../utils/notificationLog";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
/** /**
* What was sent: every notification, newest first, with how it went through each channel — or why it did not: held for quiet hours, a routing rule said nobody, no channel to send it to. * What was sent: every notification, newest first, with how it went through each channel — or why it did not: held for quiet hours, a routing rule said nobody, no channel to send it to.
@@ -77,9 +78,9 @@ export default function NotificationHistory() {
<div className="d-flex align-items-center mb-1"> <div className="d-flex align-items-center mb-1">
<h2 className="page-title mb-0">Notification history</h2> <h2 className="page-title mb-0">Notification history</h2>
</div> </div>
<p className="text-secondary"> <PageIntro>
What was sent, to which channel, and whether it got through — or why it was not sent. Kept 30 days. The channels are set up under <Link to="/settings/notifications">Settings → Notifications</Link>. What was sent, to which channel, and whether it got through — or why it was not sent. Kept 30 days. The channels are set up under <Link to="/settings/notifications">Settings → Notifications</Link>.
</p> </PageIntro>
<div className="row g-2 mb-3"> <div className="row g-2 mb-3">
<div className="col-sm-4 col-md-3"> <div className="col-sm-4 col-md-3">
<select className="form-select" aria-label="Show" value={status} onChange={(e) => setParam("status", e.target.value || null)}> <select className="form-select" aria-label="Show" value={status} onChange={(e) => setParam("status", e.target.value || null)}>
+3 -2
View File
@@ -7,6 +7,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { formatBytes } from "./settings/StorageSettings"; import { formatBytes } from "./settings/StorageSettings";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
const NAMES: Record<string, string> = { database: "Database", redis: "Redis", celery: "Document worker", index: "Search index", classifier: "Classifier", sanity_check: "Sanity check" }; const NAMES: Record<string, string> = { database: "Database", redis: "Redis", celery: "Document worker", index: "Search index", classifier: "Classifier", sanity_check: "Sanity check" };
@@ -149,10 +150,10 @@ export default function Paperless() {
return ( return (
<> <>
<h2 className="page-title">Paperless-ngx</h2> <h2 className="page-title">Paperless-ngx</h2>
<p className="text-secondary"> <PageIntro>
Whether documents are being taken in. It is read every few minutes with an API token (see <Link to="/integrations">Integrations</Link>). <strong>A component in error</strong> (above all the worker that consumes documents), <strong>documents that failed to import</strong> and a{" "} Whether documents are being taken in. It is read every few minutes with an API token (see <Link to="/integrations">Integrations</Link>). <strong>A component in error</strong> (above all the worker that consumes documents), <strong>documents that failed to import</strong> and a{" "}
<strong>disk that is filling up</strong> are alerts — see <Link to="/alerts">Alerts</Link>. <strong>disk that is filling up</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -6,6 +6,7 @@ import TimeAgo from "../components/TimeAgo";
import { BlockSkeleton } from "../components/Skeleton"; import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
/** Alerts every pipeline carries to prove it works: they are always firing, so they are not shown as firing. */ /** Alerts every pipeline carries to prove it works: they are always firing, so they are not shown as firing. */
const BY_DESIGN = /^(watchdog|deadmansswitch|deadmanssnitch|infoinhibitor)$/i; const BY_DESIGN = /^(watchdog|deadmansswitch|deadmanssnitch|infoinhibitor)$/i;
@@ -136,10 +137,10 @@ export default function Prometheus() {
return ( return (
<> <>
<h2 className="page-title">Prometheus</h2> <h2 className="page-title">Prometheus</h2>
<p className="text-secondary"> <PageIntro>
What Prometheus already measures, in the same list as everything else. It is read every couple of minutes (see <Link to="/integrations">Integrations</Link>). A <strong>target that has not answered for five minutes</strong> and an <strong>alert that Prometheus&rsquo;s rules are firing</strong> are What Prometheus already measures, in the same list as everything else. It is read every couple of minutes (see <Link to="/integrations">Integrations</Link>). A <strong>target that has not answered for five minutes</strong> and an <strong>alert that Prometheus&rsquo;s rules are firing</strong> are
alerts — see <Link to="/alerts">Alerts</Link>. Alerts that Grafana manages itself are not seen. alerts — see <Link to="/alerts">Alerts</Link>. Alerts that Grafana manages itself are not seen.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -17,6 +17,7 @@ import { confirmDialog, promptDialog } from "../utils/dialogs";
import { formatDate } from "../utils/date"; import { formatDate } from "../utils/date";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
type Row = NpmHost & { integrationId: number; canManage: boolean; integrationName: string; domain: string; target: string; certDays: number | null; certName: string; statusRank: number; serverName: string }; type Row = NpmHost & { integrationId: number; canManage: boolean; integrationName: string; domain: string; target: string; certDays: number | null; certName: string; statusRank: number; serverName: string };
@@ -177,10 +178,10 @@ export default function ProxyHosts({ user }: { user: CurrentUser }) {
</div> </div>
)} )}
</div> </div>
<div className="text-secondary mb-3"> <PageIntro>
What Nginx Proxy Manager serves: the name, where it forwards to, the certificate and whether NPM could set it up. {canManageAny ? "An administrator can also make, change, switch off and delete hosts here. " : "It only reads — nothing here changes anything in NPM. "}A certificate in its last What Nginx Proxy Manager serves: the name, where it forwards to, the certificate and whether NPM could set it up. {canManageAny ? "An administrator can also make, change, switch off and delete hosts here. " : "It only reads — nothing here changes anything in NPM. "}A certificate in its last
two weeks, or a host NPM can&rsquo;t set up, is an alert. two weeks, or a host NPM can&rsquo;t set up, is an alert.
</div> </PageIntro>
{isAdmin && data && data.integrations.length > 0 && !canManageAny && ( {isAdmin && data && data.integrations.length > 0 && !canManageAny && (
<div className="text-secondary small mb-3"> <div className="text-secondary small mb-3">
To make and change proxy hosts from here, give the Nginx Proxy Manager integration a user with <em>Manage</em> on Proxy Hosts: <Link to="/integrations">Integrations</Link> → edit → <em>Email of a user that may manage</em>. To make and change proxy hosts from here, give the Nginx Proxy Manager integration a user with <em>Manage</em> on Proxy Hosts: <Link to="/integrations">Integrations</Link> → edit → <em>Email of a user that may manage</em>.
+3 -2
View File
@@ -10,6 +10,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { useChartRange } from "../utils/chartRanges"; import { useChartRange } from "../utils/chartRanges";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ s }: { s: SpeedtestInfo }) { function Badge({ s }: { s: SpeedtestInfo }) {
if (!s.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!s.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -168,9 +169,9 @@ export default function Speedtest({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">Speedtest</h2> <h2 className="page-title">Speedtest</h2>
<p className="text-secondary"> <PageIntro>
What Speedtest Tracker has measured, read every few minutes (see <Link to="/integrations">Integrations</Link>) — this app never starts a test. <strong>The internet slower than it is sold at</strong> and <strong>speed tests that keep failing</strong> are alerts — see <Link to="/alerts">Alerts</Link>. What Speedtest Tracker has measured, read every few minutes (see <Link to="/integrations">Integrations</Link>) — this app never starts a test. <strong>The internet slower than it is sold at</strong> and <strong>speed tests that keep failing</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { formatAgo } from "../utils/duration"; import { formatAgo } from "../utils/duration";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
function Badge({ a }: { a: TechnitiumInstance }) { function Badge({ a }: { a: TechnitiumInstance }) {
if (!a.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>; if (!a.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
@@ -315,10 +316,10 @@ export default function TechnitiumDns({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">Technitium DNS</h2> <h2 className="page-title">Technitium DNS</h2>
<p className="text-secondary"> <PageIntro>
Read every two minutes (see <Link to="/integrations">Integrations</Link>), with a real DNS question put to it each time — its web console can be up while DNS is not. Nothing is changed. <strong>DNS that stops answering</strong>, <strong>blocking left off for an hour</strong>,{" "} Read every two minutes (see <Link to="/integrations">Integrations</Link>), with a real DNS question put to it each time — its web console can be up while DNS is not. Nothing is changed. <strong>DNS that stops answering</strong>, <strong>blocking left off for an hour</strong>,{" "}
<strong>block lists that stopped updating</strong> and <strong>an expired or unsynced zone</strong>, <strong>a cluster node that cannot be reached</strong> and <strong>a secondary that has stopped taking the primary's configuration</strong> are alerts — see <Link to="/alerts">Alerts</Link>. Technitium does not report the CPU, memory or disk of the machine it runs on: put a <Link to="/servers">server agent</Link> there for that. <strong>block lists that stopped updating</strong> and <strong>an expired or unsynced zone</strong>, <strong>a cluster node that cannot be reached</strong> and <strong>a secondary that has stopped taking the primary's configuration</strong> are alerts — see <Link to="/alerts">Alerts</Link>. Technitium does not report the CPU, memory or disk of the machine it runs on: put a <Link to="/servers">server agent</Link> there for that.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && data.length === 0 && ( {data && data.length === 0 && (
+3 -2
View File
@@ -11,6 +11,7 @@ import { formatDate } from "../utils/date";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import { removeWithUndo } from "../utils/undoable"; import { removeWithUndo } from "../utils/undoable";
import PageIntro from "../components/PageIntro";
type Person = { id: number; name: string; role: string }; type Person = { id: number; name: string; role: string };
type Place = { type: "server" | "device"; id: number; name: string }; type Place = { type: "server" | "device"; id: number; name: string };
@@ -254,9 +255,9 @@ export default function Todo({ user }: { user: CurrentUser }) {
</button> </button>
</div> </div>
</div> </div>
<div className="text-secondary mb-3"> <PageIntro>
The small jobs: replace the battery, move the NAS to the new switch. A job with a day is in <Link to="/coming-up?kinds=todo">Coming up</Link>; one handed to somebody is in their <Link to="/my-work">My work</Link>. The small jobs: replace the battery, move the NAS to the new switch. A job with a day is in <Link to="/coming-up?kinds=todo">Coming up</Link>; one handed to somebody is in their <Link to="/my-work">My work</Link>.
</div> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{canEdit && ( {canEdit && (
+3 -2
View File
@@ -9,6 +9,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { useChartRange } from "../utils/chartRanges"; import { useChartRange } from "../utils/chartRanges";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import PageIntro from "../components/PageIntro";
const minutes = (seconds: number) => { const minutes = (seconds: number) => {
const m = Math.max(0, Math.round(seconds / 60)); const m = Math.max(0, Math.round(seconds / 60));
@@ -238,10 +239,10 @@ export default function Ups({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title mb-1">UPS</h2> <h2 className="page-title mb-1">UPS</h2>
<p className="text-secondary"> <PageIntro>
The battery backups the app reads (over NUT or SNMP): whether mains power is there, how much battery is left and for how long, and what each one carries. Mains power lost is a critical alert and a notification; while it lasts, what The battery backups the app reads (over NUT or SNMP): whether mains power is there, how much battery is left and for how long, and what each one carries. Mains power lost is a critical alert and a notification; while it lasts, what
goes offline with the UPS is folded under it. goes offline with the UPS is folded under it.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{list === null && !error && <BlockSkeleton lines={4} />} {list === null && !error && <BlockSkeleton lines={4} />}
{list?.length === 0 && ( {list?.length === 0 && (
+3 -2
View File
@@ -7,6 +7,7 @@ import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice"; import { ErrorNotice } from "../components/Notice";
import { readableError } from "../utils/errors"; import { readableError } from "../utils/errors";
import { toast } from "../utils/toast"; import { toast } from "../utils/toast";
import PageIntro from "../components/PageIntro";
type Row = AppVersions["rows"][number]; type Row = AppVersions["rows"][number];
@@ -70,10 +71,10 @@ export default function Versions({ user }: { user: CurrentUser }) {
return ( return (
<> <>
<h2 className="page-title">App versions</h2> <h2 className="page-title">App versions</h2>
<p className="text-secondary"> <PageIntro>
The version each connected application runs — as it was last read (see <Link to="/integrations">Integrations</Link>) — against the newest release of it. It looks the newest ones up on GitHub once a day; <strong>that is the only thing this app asks of an address that is not yours</strong>, so it is switched The version each connected application runs — as it was last read (see <Link to="/integrations">Integrations</Link>) — against the newest release of it. It looks the newest ones up on GitHub once a day; <strong>that is the only thing this app asks of an address that is not yours</strong>, so it is switched
off until you switch it on. Proxmox, Synology and the rest, which have no release to compare with, are not listed. off until you switch it on. Proxmox, Synology and the rest, which have no release to compare with, are not listed.
</p> </PageIntro>
<ErrorNotice error={error} /> <ErrorNotice error={error} />
{!data && !error && <BlockSkeleton lines={4} />} {!data && !error && <BlockSkeleton lines={4} />}
{data && ( {data && (
+24
View File
@@ -2066,3 +2066,27 @@ tr.alert-row-child > td:first-child {
margin-bottom: 0; margin-bottom: 0;
} }
} }
/* ── The few lines under a page title: folded to two lines when longer (components/PageIntro.tsx); a printout shows all of it. ── */
.page-intro-clamp {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
overflow: hidden;
}
.page-intro-toggle {
margin-top: 0.125rem;
}
@media print {
.page-intro-clamp {
display: block;
overflow: visible;
}
.page-intro-toggle {
display: none;
}
}
+36
View File
@@ -0,0 +1,36 @@
/** Which pages' introductions the person has opened out (a long one is folded to two lines until they do): kept in this browser, by the page's path. */
const KEY = "pageIntro.open";
const MAX_REMEMBERED = 200;
/** Pure: the list as stored — anything that is not a list of paths is an empty list. */
export function parseOpen(raw: string | null): string[] {
try {
const v = raw ? JSON.parse(raw) : [];
return Array.isArray(v) ? v.filter((x): x is string => typeof x === "string") : [];
} catch {
return [];
}
}
/** Pure: the list with a page opened or folded; the newest are kept when it grows too long. */
export function withOpen(list: string[], path: string, open: boolean): string[] {
const rest = list.filter((p) => p !== path);
return (open ? [...rest, path] : rest).slice(-MAX_REMEMBERED);
}
export function isIntroOpen(path: string): boolean {
try {
return parseOpen(localStorage.getItem(KEY)).includes(path);
} catch {
return false;
}
}
export function rememberIntroOpen(path: string, open: boolean): void {
try {
localStorage.setItem(KEY, JSON.stringify(withOpen(parseOpen(localStorage.getItem(KEY)), path, open)));
} catch {
// private window or blocked storage: it just is not remembered
}
}