UniFi: servers plugged into switches; server page in sections; My work; settings search and undo
UniFi: the controller's client list is matched to servers by IP address, so a server is connected through a switch or access point (and port). That is a dependency made by itself, shown on the server page, the Network devices page and the Connections map. IP Addresses can sync the devices' addresses. A server's page is split into Overview, Health, Network, History, Tasks and Settings, by ?view=; alerts link to the section they are about. My work lists what has your name on it: alerts you have, maintenance you started (extend, end with undo) and update runs you started, with a badge. Settings has a search box (and the command palette lists every setting). Removing a dependency, admin link, runbook, hand-made IP address, port opening or restore test is undone from the message instead of asked about first. Two backup tests used a fixed date and failed as days passed; they follow the real clock now. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
396e074108
commit
5e26e77340
45 files changed
+6224
-194
No files matched your search
+14
-7
@@ -15,7 +15,7 @@ const COL_GAP = 130;
|
||||
|
||||
const STATUS_SYMBOL: Record<MapNode["status"], string> = { ok: "✓", bad: "✕", warn: "▲", unknown: "·" };
|
||||
const STATUS_WORD: Record<MapNode["status"], string> = { ok: "working", bad: "problem", warn: "check", unknown: "no status" };
|
||||
const KIND_WORD: Record<MapNode["kind"], string> = { host: "Proxmox host", server: "Server", dns: "DNS name", monitor: "Uptime Kuma monitor" };
|
||||
const KIND_WORD: Record<MapNode["kind"], string> = { host: "Proxmox host", server: "Server", dns: "DNS name", monitor: "Uptime Kuma monitor", device: "Network device" };
|
||||
|
||||
interface Placed extends MapNode {
|
||||
x: number;
|
||||
@@ -30,15 +30,22 @@ function layout(data: MapData): { placed: Map<string, Placed>; width: number; he
|
||||
neighbours.set(e.to, [...(neighbours.get(e.to) ?? []), e.from]);
|
||||
}
|
||||
const byKind = (kinds: MapNode["kind"][]) => data.nodes.filter((n) => kinds.includes(n.kind));
|
||||
const hosts = byKind(["host"]).sort((a, b) => a.label.localeCompare(b.label));
|
||||
// Proxmox hosts and the switches and access points servers are plugged into share the left-hand column.
|
||||
const hosts = byKind(["host", "device"]).sort((a, b) => a.label.localeCompare(b.label));
|
||||
const serverNodes = byKind(["server"]);
|
||||
const rightNodes = byKind(["dns", "monitor"]);
|
||||
|
||||
// Servers grouped under their host, then those with none.
|
||||
const hostOf = (s: MapNode) => (neighbours.get(s.id) ?? []).find((id) => id.startsWith("host:"));
|
||||
const hostOf = (s: MapNode) => (neighbours.get(s.id) ?? []).find((id) => id.startsWith("host:")) ?? (neighbours.get(s.id) ?? []).find((id) => id.startsWith("device:"));
|
||||
const servers: MapNode[] = [];
|
||||
for (const h of hosts) servers.push(...serverNodes.filter((s) => hostOf(s) === h.id).sort((a, b) => a.label.localeCompare(b.label)));
|
||||
servers.push(...serverNodes.filter((s) => !hostOf(s)).sort((a, b) => a.label.localeCompare(b.label)));
|
||||
const placedServers = new Set<string>();
|
||||
for (const h of hosts) {
|
||||
for (const s of serverNodes.filter((s) => hostOf(s) === h.id && !placedServers.has(s.id)).sort((a, b) => a.label.localeCompare(b.label))) {
|
||||
servers.push(s);
|
||||
placedServers.add(s.id);
|
||||
}
|
||||
}
|
||||
servers.push(...serverNodes.filter((s) => !placedServers.has(s.id)).sort((a, b) => a.label.localeCompare(b.label)));
|
||||
|
||||
const step = NODE_H + GAP_Y;
|
||||
const placed = new Map<string, Placed>();
|
||||
@@ -69,7 +76,7 @@ function layout(data: MapData): { placed: Map<string, Placed>; width: number; he
|
||||
const height = all.length ? Math.max(...all.map((p) => p.y)) + NODE_H : 0;
|
||||
const width = Math.max(...all.map((p) => p.x), 0) + NODE_W;
|
||||
const columns = [
|
||||
...(hasHosts ? [{ x: colX[0], title: "Proxmox hosts" }] : []),
|
||||
...(hasHosts ? [{ x: colX[0], title: byKind(["host"]).length > 0 && byKind(["device"]).length > 0 ? "Proxmox hosts & network devices" : byKind(["device"]).length > 0 ? "Network devices" : "Proxmox hosts" }] : []),
|
||||
...(servers.length > 0 ? [{ x: colX[1], title: "Servers" }] : []),
|
||||
...(hasRight ? [{ x: colX[2], title: "DNS names & monitors" }] : []),
|
||||
];
|
||||
@@ -146,7 +153,7 @@ function ConnectionsMap() {
|
||||
return (
|
||||
<>
|
||||
<p className="text-secondary">
|
||||
How things connect: which Proxmox host a server runs on, which DNS names point at it, and which Uptime Kuma monitors watch it. Hover or tab to a box to light up what it is
|
||||
How things connect: which Proxmox host a server runs on, which switch or access point it is plugged into (from a UniFi controller), which DNS names point at it, and which Uptime Kuma monitors watch it. Hover or tab to a box to light up what it is
|
||||
connected to.
|
||||
</p>
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
Reference in new issue
Block a user