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:
1 parent
a2b43bcd5d
commit
9937ab2202
46 files changed
+307
-82
No files matched your search
@@ -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>
|
||||
);
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { formatAgo } from "../utils/duration";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ a }: { a: AdguardInstance }) {
|
||||
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 (
|
||||
<>
|
||||
<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>,{" "}
|
||||
<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} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -9,6 +9,7 @@ import { guessAdminUrl, portOptionLabel } from "../utils/adminLinkUrl";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import TableToolbar from "../components/TableToolbar";
|
||||
import { EmptyRow, LoadingRow } from "../components/EmptyState";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
interface LinkForm {
|
||||
serverId: number | "";
|
||||
@@ -152,10 +153,10 @@ export default function AdminLinks({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<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,
|
||||
Webmin, Cockpit, and the like — in one place, instead of visiting each server to find them.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{canEdit && showForm && (
|
||||
|
||||
@@ -9,6 +9,7 @@ import { confirmDialog } from "../utils/dialogs";
|
||||
import { formatDate } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const EXPIRY = [
|
||||
{ value: "90", label: "90 days" },
|
||||
@@ -87,9 +88,9 @@ export default function ApiTokens() {
|
||||
<div className="d-flex align-items-center mb-1">
|
||||
<h2 className="page-title mb-0">API tokens</h2>
|
||||
</div>
|
||||
<div className="text-secondary mb-3">
|
||||
<PageIntro>
|
||||
Read-only access to your installation’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} />
|
||||
|
||||
{fresh && (
|
||||
|
||||
@@ -10,6 +10,7 @@ import TimeAgo from "../components/TimeAgo";
|
||||
import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ a }: { a: AuthentikInfo }) {
|
||||
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" ? (
|
||||
<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{" "}
|
||||
<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 && (
|
||||
@@ -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>.
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
</PageIntro>
|
||||
) : (
|
||||
<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),
|
||||
|
||||
@@ -15,6 +15,7 @@ import { useTableSearch } from "../hooks/useTableSearch";
|
||||
import { downloadCsv } from "../utils/csv";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { EmptyRow } from "../components/EmptyState";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
interface Row extends CoverageGuest {
|
||||
/** 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>
|
||||
</div>
|
||||
{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.` : ""}
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{badSources.length > 0 && (
|
||||
<div className="alert alert-warning">
|
||||
|
||||
@@ -7,6 +7,7 @@ import EmptyState from "../components/EmptyState";
|
||||
import { downloadCsv } from "../utils/csv";
|
||||
import { formatDate, formatTime } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const KINDS: { id: AgendaKind; label: string }[] = [
|
||||
{ id: "secret", label: "Secrets" },
|
||||
@@ -195,7 +196,7 @@ export default function ComingUp({ user }: { user: CurrentUser }) {
|
||||
Export CSV
|
||||
</button>
|
||||
</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.
|
||||
{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."
|
||||
)}
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{agenda && agenda.notes.length > 0 && (
|
||||
<div className="alert alert-warning" role="status">
|
||||
|
||||
@@ -8,6 +8,7 @@ import { formatAgo } from "../utils/duration";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { promptDialog } from "../utils/dialogs";
|
||||
import { ErrorNotice, SuccessNotice } from "../components/Notice";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const KINDS: { kind: ConsistencyKind; title: string; blurb: string }[] = [
|
||||
{ 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>
|
||||
</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
|
||||
fetched from the servers or DNS providers when you open this page.
|
||||
</div>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
<SuccessNotice notice={notice} />
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import { confirmDialog } from "../utils/dialogs";
|
||||
import { formatDate } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const money = (n: number, currency: string) => {
|
||||
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 style={{ flex: "1 1 320px", minWidth: 0 }}>
|
||||
<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’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>
|
||||
{isAdmin && !form && (
|
||||
<button className="btn btn-primary ms-auto flex-shrink-0" onClick={() => setForm({ id: null, value: blank(defaultCurrency) })}>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { formatBytes } from "./settings/StorageSettings";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const KIND_NAMES: Record<DownloadClient["kind"], string> = { qbittorrent: "qBittorrent", sabnzbd: "SABnzbd" };
|
||||
const SHOWN = 25;
|
||||
@@ -259,10 +260,10 @@ export default function Downloads({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<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{" "}
|
||||
<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} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -11,6 +11,7 @@ import { formatBytes } from "./settings/StorageSettings";
|
||||
import { confirmDialog } from "../utils/dialogs";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const STATE: Record<DuplicatiBackup["state"], { label: string; cls: string }> = {
|
||||
ok: { label: "In order", cls: "bg-green-lt text-green" },
|
||||
@@ -267,10 +268,10 @@ export default function Duplicati({ user }: { user: CurrentUser }) {
|
||||
</button>
|
||||
)}
|
||||
</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>,
|
||||
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’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} />
|
||||
{fresh && <Address path={fresh.path} name={fresh.name} onDone={() => setFresh(null)} />}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import { toast } from "../utils/toast";
|
||||
import { EmptyRow } from "../components/EmptyState";
|
||||
import EndpointSuggestions from "../components/EndpointSuggestions";
|
||||
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_HINTS: Record<EndpointKind, string> = {
|
||||
@@ -255,10 +256,10 @@ export default function Endpoints({ user }: { user: CurrentUser }) {
|
||||
</button>
|
||||
)}
|
||||
</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
|
||||
certificate is about to run out.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
<div className="row row-cards mb-3">
|
||||
|
||||
@@ -12,6 +12,7 @@ import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import { barPosition, eventText, onHeadline } from "../utils/gamePower";
|
||||
import { formatDateTime } from "../utils/date";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
type Server = FragnetServerInfo;
|
||||
|
||||
@@ -538,10 +539,10 @@ export default function GameServers({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<h2 className="page-title">Game servers</h2>
|
||||
<p className="text-secondary">
|
||||
<PageIntro>
|
||||
What Fragnet’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>.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
type PasswordOptions,
|
||||
} from "../utils/generators";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const MIXED = "mixed";
|
||||
|
||||
@@ -85,10 +86,10 @@ export default function Generator({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<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
|
||||
picked in your browser too, from name lists the server hands out.
|
||||
</div>
|
||||
</PageIntro>
|
||||
|
||||
<div className="row row-cards">
|
||||
<div className="col-md-6 col-lg-4">
|
||||
|
||||
@@ -7,6 +7,7 @@ import TimeAgo from "../components/TimeAgo";
|
||||
import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ g }: { g: GrafanaInstance }) {
|
||||
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 (
|
||||
<>
|
||||
<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>.
|
||||
Grafana can notify about its own alerts too; with both you hear twice.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -17,6 +17,7 @@ import { confirmDialog } from "../utils/dialogs";
|
||||
import { formatDateTime } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const STATE_BADGE: Record<HeartbeatState, { label: string; badge: string }> = {
|
||||
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>
|
||||
)}
|
||||
</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’t come in time, or the job says it failed, it appears on the{" "}
|
||||
<Link to="/alerts">Alerts</Link> page and in notifications.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{showing && <HowToCall name={showing.name} url={urlOf(showing.path)} onClose={() => setShowing(null)} />}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { formatBytes } from "./settings/StorageSettings";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ p }: { p: HetznerProject }) {
|
||||
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 (
|
||||
<>
|
||||
<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’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>.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -7,6 +7,7 @@ import TimeAgo from "../components/TimeAgo";
|
||||
import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ a }: { a: RobotAccount }) {
|
||||
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 (
|
||||
<>
|
||||
<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.{" "}
|
||||
<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} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ErrorNotice } from "../components/Notice";
|
||||
import { useChartRange } from "../utils/chartRanges";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
type Integration = HaOverview["integrations"][number];
|
||||
|
||||
@@ -284,10 +285,10 @@ export default function HomeAssistant({ user }: { user: CurrentUser }) {
|
||||
</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
|
||||
reads; nothing is ever sent to Home Assistant.
|
||||
</div>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{data === null && !error && <BlockSkeleton lines={4} />}
|
||||
{data && live.length === 0 && (
|
||||
|
||||
@@ -7,6 +7,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { formatBytes } from "./settings/StorageSettings";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ i }: { i: ImmichInfo }) {
|
||||
if (!i.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
|
||||
@@ -148,10 +149,10 @@ export default function Immich() {
|
||||
return (
|
||||
<>
|
||||
<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
|
||||
metadata that were never made) are alerts — see <Link to="/alerts">Alerts</Link>.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -20,6 +20,7 @@ import { groupOfType, INSPECTABLE, TYPE_GROUPS, TYPE_LABELS, TYPE_PAGES } from "
|
||||
import { hostOf, integrationRow, integrationStatus, type IntegrationRow } from "../utils/integrationRows";
|
||||
import { useSortable } from "../hooks/useSortable";
|
||||
import SortableTh from "../components/SortableTh";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function HealthBadge({ i }: { i: IntegrationSummary }) {
|
||||
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>
|
||||
<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.
|
||||
</div>
|
||||
</PageIntro>
|
||||
</div>
|
||||
{isAdmin && !adding && !editingIntegration && (
|
||||
<button className="btn btn-primary ms-auto flex-shrink-0 text-nowrap" onClick={() => setAdding(true)}>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { downloadCsv } from "../utils/csv";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { KIND_LABELS, money } from "../utils/inventory";
|
||||
import type { AssetKind } from "../api/client";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const YEARS = [3, 5, 7, 10];
|
||||
|
||||
@@ -108,10 +109,10 @@ export default function InventoryLifecycle() {
|
||||
</Link>
|
||||
</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
|
||||
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} />
|
||||
{!report && !error && <BlockSkeleton lines={5} />}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { ErrorNotice } from "../components/Notice";
|
||||
import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { KIND_LABELS } from "../utils/inventory";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
type Rack = Awaited<ReturnType<typeof api.inventory.racks>>["racks"][number];
|
||||
|
||||
@@ -79,9 +80,9 @@ export default function InventoryRacks() {
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-secondary mb-3 no-print">
|
||||
<PageIntro className="mb-3 no-print">
|
||||
Each piece of hardware that gives a unit (“U12”, or “U12-13” for a tall one) and the rack’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} />
|
||||
{racks === null && !error && <BlockSkeleton lines={4} />}
|
||||
{racks !== null && racks.length === 0 && (
|
||||
|
||||
@@ -9,6 +9,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { useChartRange } from "../utils/chartRanges";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ j }: { j: JellyfinInfo }) {
|
||||
if (!j.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
|
||||
@@ -180,10 +181,10 @@ export default function Jellyfin() {
|
||||
return (
|
||||
<>
|
||||
<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{" "}
|
||||
<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} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -22,6 +22,7 @@ import MaintenanceTimeline from "../components/MaintenanceTimeline";
|
||||
import RecurringMaintenance from "../components/RecurringMaintenance";
|
||||
import ExportTableButton from "../components/ExportTableButton";
|
||||
import { EmptyRow, LoadingRow } from "../components/EmptyState";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const DURATIONS: { minutes: number; label: string }[] = [
|
||||
{ minutes: 30, label: "30 minutes" },
|
||||
@@ -248,10 +249,10 @@ export default function Maintenance({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<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
|
||||
still wrong when it ends alerts then, so nothing stays hidden.
|
||||
</div>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{canEdit && (
|
||||
|
||||
@@ -7,6 +7,7 @@ import { api, type MapData, type MapNode } from "../api/client";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { PageSkeleton } from "../components/Skeleton";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const NODE_W = 210;
|
||||
const NODE_H = 46;
|
||||
@@ -115,9 +116,9 @@ export default function MapPage({ user }: { user: CurrentUser }) {
|
||||
<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.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<DependencyMap />
|
||||
<h3 className="mt-4 mb-2">Say what needs what</h3>
|
||||
<DependencyEditor user={user} />
|
||||
|
||||
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { formatBytes } from "./settings/StorageSettings";
|
||||
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 QUEUE_SHOWN = 25;
|
||||
@@ -218,10 +219,10 @@ export default function Media({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<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{" "}
|
||||
<strong>a disk nearly full</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -8,6 +8,7 @@ import { CATEGORY_NAMES, incidentPath, SEVERITY_BADGE } from "../components/Inci
|
||||
import { formatDate, formatDateTime } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
/** "2 h 40 min", "35 min", "3 d 4 h". */
|
||||
function span(minutes: number): string {
|
||||
@@ -196,7 +197,7 @@ export default function MonthlyReport({ user }: { user: CurrentUser }) {
|
||||
</button>
|
||||
</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.
|
||||
{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>.
|
||||
</>
|
||||
) : null}
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={6} />}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useMyWork } from "../hooks/useMyWork";
|
||||
import { formatRemaining } from "../utils/duration";
|
||||
import { readableError } from "../utils/errors";
|
||||
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" };
|
||||
|
||||
@@ -102,9 +103,9 @@ export default function MyWorkPage({ user }: { user: CurrentUser }) {
|
||||
<div className="d-flex flex-wrap align-items-center gap-2 mb-1">
|
||||
<h2 className="page-title mb-0">My work</h2>
|
||||
</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.
|
||||
</div>
|
||||
</PageIntro>
|
||||
|
||||
{work === null && <BlockSkeleton lines={4} />}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import TimeAgo from "../components/TimeAgo";
|
||||
import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ n }: { n: N8nInfo }) {
|
||||
if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
|
||||
@@ -108,9 +109,9 @@ export default function N8n() {
|
||||
return (
|
||||
<>
|
||||
<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.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -6,6 +6,7 @@ import TimeAgo from "../components/TimeAgo";
|
||||
import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ n }: { n: NetBoxInfo }) {
|
||||
if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
|
||||
@@ -105,9 +106,9 @@ export default function NetBox() {
|
||||
return (
|
||||
<>
|
||||
<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.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -22,6 +22,7 @@ import { usePagination } from "../hooks/usePagination";
|
||||
import { downloadCsv } from "../utils/csv";
|
||||
import { readableError } from "../utils/errors";
|
||||
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" };
|
||||
|
||||
@@ -155,10 +156,10 @@ export default function NetworkDevices({ user }: { user: CurrentUser }) {
|
||||
)}
|
||||
</div>
|
||||
{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
|
||||
dependency map, so when one is down what hangs off it is folded under its alert.
|
||||
</div>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{data === null && !error && <BlockSkeleton lines={4} />}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { formatBytes } from "./settings/StorageSettings";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ n }: { n: NextcloudInfo }) {
|
||||
if (!n.enabled) return <span className="badge bg-secondary-lt text-secondary">Off</span>;
|
||||
@@ -135,9 +136,9 @@ export default function Nextcloud() {
|
||||
return (
|
||||
<>
|
||||
<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>.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -9,6 +9,7 @@ import { formatDateTime } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { channelName, isLogStatus, STATUS_BADGE, STATUS_HINT, STATUS_LABEL, STATUS_ORDER, type LogStatus } from "../utils/notificationLog";
|
||||
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.
|
||||
@@ -77,9 +78,9 @@ export default function NotificationHistory() {
|
||||
<div className="d-flex align-items-center mb-1">
|
||||
<h2 className="page-title mb-0">Notification history</h2>
|
||||
</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>.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<div className="row g-2 mb-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)}>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { formatBytes } from "./settings/StorageSettings";
|
||||
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" };
|
||||
|
||||
@@ -149,10 +150,10 @@ export default function Paperless() {
|
||||
return (
|
||||
<>
|
||||
<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{" "}
|
||||
<strong>disk that is filling up</strong> are alerts — see <Link to="/alerts">Alerts</Link>.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -6,6 +6,7 @@ import TimeAgo from "../components/TimeAgo";
|
||||
import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
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. */
|
||||
const BY_DESIGN = /^(watchdog|deadmansswitch|deadmanssnitch|infoinhibitor)$/i;
|
||||
@@ -136,10 +137,10 @@ export default function Prometheus() {
|
||||
return (
|
||||
<>
|
||||
<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’s rules are firing</strong> are
|
||||
alerts — see <Link to="/alerts">Alerts</Link>. Alerts that Grafana manages itself are not seen.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -17,6 +17,7 @@ import { confirmDialog, promptDialog } from "../utils/dialogs";
|
||||
import { formatDate } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
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 };
|
||||
|
||||
@@ -177,10 +178,10 @@ export default function ProxyHosts({ user }: { user: CurrentUser }) {
|
||||
</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
|
||||
two weeks, or a host NPM can’t set up, is an alert.
|
||||
</div>
|
||||
</PageIntro>
|
||||
{isAdmin && data && data.integrations.length > 0 && !canManageAny && (
|
||||
<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>.
|
||||
|
||||
@@ -10,6 +10,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { useChartRange } from "../utils/chartRanges";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ s }: { s: SpeedtestInfo }) {
|
||||
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 (
|
||||
<>
|
||||
<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>.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -8,6 +8,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { formatAgo } from "../utils/duration";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
function Badge({ a }: { a: TechnitiumInstance }) {
|
||||
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 (
|
||||
<>
|
||||
<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>,{" "}
|
||||
<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} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && data.length === 0 && (
|
||||
|
||||
@@ -11,6 +11,7 @@ import { formatDate } from "../utils/date";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import { removeWithUndo } from "../utils/undoable";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
type Person = { id: number; name: string; role: string };
|
||||
type Place = { type: "server" | "device"; id: number; name: string };
|
||||
@@ -254,9 +255,9 @@ export default function Todo({ user }: { user: CurrentUser }) {
|
||||
</button>
|
||||
</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>.
|
||||
</div>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{canEdit && (
|
||||
|
||||
@@ -9,6 +9,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { useChartRange } from "../utils/chartRanges";
|
||||
import { readableError } from "../utils/errors";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
const minutes = (seconds: number) => {
|
||||
const m = Math.max(0, Math.round(seconds / 60));
|
||||
@@ -238,10 +239,10 @@ export default function Ups({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<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
|
||||
goes offline with the UPS is folded under it.
|
||||
</p>
|
||||
</PageIntro>
|
||||
<ErrorNotice error={error} />
|
||||
{list === null && !error && <BlockSkeleton lines={4} />}
|
||||
{list?.length === 0 && (
|
||||
|
||||
@@ -7,6 +7,7 @@ import { BlockSkeleton } from "../components/Skeleton";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { toast } from "../utils/toast";
|
||||
import PageIntro from "../components/PageIntro";
|
||||
|
||||
type Row = AppVersions["rows"][number];
|
||||
|
||||
@@ -70,10 +71,10 @@ export default function Versions({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<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
|
||||
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} />
|
||||
{!data && !error && <BlockSkeleton lines={4} />}
|
||||
{data && (
|
||||
|
||||
@@ -2066,3 +2066,27 @@ tr.alert-row-child > td:first-child {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user