ServiceMap: update tests and backend/app (+7 areas)

Public changes compared with the previous published export:
89 files changed.

Affected areas:
- backend/app: 21 files
- dependencies: 5 files
- deployment and CI: 6 files
- documentation: 2 files
- frontend: 3 files
- frontend/src: 20 files
- project files: 1 file
- tests: 30 files
- unraid: 1 file

Changed files:
- Updated: ".env.example"
- Updated: "Dockerfile.unraid"
- Updated: "README.md"
- Updated: "backend/Dockerfile"
- Added: "backend/app/alerts.py"
- Updated: "backend/app/auth.py"
- Added: "backend/app/backups.py"
- Updated: "backend/app/config_io.py"
- Updated: "backend/app/demo.py"
- Updated: "backend/app/discovery.py"
- Updated: "backend/app/discovery_store.py"
- Updated: "backend/app/docker_discovery.py"
- Updated: "backend/app/events.py"
- Updated: "backend/app/evidence.py"
- Updated: "backend/app/health.py"
- Updated: "backend/app/incidents.py"
- Added: "backend/app/loops.py"
- Updated: "backend/app/main.py"
- Updated: "backend/app/models.py"
- Updated: "backend/app/observation.py"
- Updated: "backend/app/probes.py"
- Added: "backend/app/response_cache.py"
- Updated: "backend/app/scheduler.py"
- Updated: "backend/app/semantic.py"
- Updated: "backend/app/store.py"
- Updated: "backend/pyproject.toml"
- Updated: "backend/tests/test_api.py"
- Updated: "backend/tests/test_config_io.py"
- Updated: "backend/tests/test_demo.py"
- Updated: "backend/tests/test_discovery_v120.py"
- Updated: "backend/tests/test_health.py"
- Updated: "backend/tests/test_probes.py"
- Updated: "backend/tests/test_scheduler.py"
- Updated: "backend/tests/test_v130_probe_reachability.py"
- Updated: "backend/tests/test_v160_evidence_changes.py"
- Added: "backend/tests/test_v163_alerts.py"
- Added: "backend/tests/test_v163_backups.py"
- Added: "backend/tests/test_v163_data_integrity.py"
- Added: "backend/tests/test_v163_efficiency.py"
- Added: "backend/tests/test_v163_health_performance.py"
- Added: "backend/tests/test_v163_loops.py"
- Added: "backend/tests/test_v163_management.py"
- Added: "backend/tests/test_v163_realtime.py"
- Added: "backend/tests/test_v163_security.py"
- Added: "backend/tests/test_v163_semantic_etag.py"
- Added: "compose.demo.yaml"
- Updated: "compose.yaml"
- Added: "docker-compose.broker.yml"
- Updated: "docker-compose.yml"
- Updated: "docs/ARCHITECTURE.md"
- Added: "frontend/e2e/a11y.spec.ts"
- Updated: "frontend/e2e/demo.spec.ts"
- Updated: "frontend/index.html"
- Updated: "frontend/nginx.conf"
- Updated: "frontend/package-lock.json"
- Updated: "frontend/package.json"
- Updated: "frontend/playwright.config.ts"
- Updated: "frontend/src/App.tsx"
- Updated: "frontend/src/LivingEdge.tsx"
- Added: "frontend/src/activityView.test.ts"
- Added: "frontend/src/activityView.ts"
- Updated: "frontend/src/api.ts"
- Added: "frontend/src/apiAuth.test.ts"
- Added: "frontend/src/components/ActionsMenu.tsx"
- Added: "frontend/src/components/ConfirmDialog.test.tsx"
- Added: "frontend/src/components/ConfirmDialog.tsx"
- Added: "frontend/src/components/StatusIcon.tsx"
- Updated: "frontend/src/demo/DemoWalkthrough.test.ts"
- Updated: "frontend/src/demo/DemoWalkthrough.tsx"
- Added: "frontend/src/elk-worker-url.d.ts"
- Added: "frontend/src/labels.ts"
- Updated: "frontend/src/main.tsx"
- Added: "frontend/src/realtime/refreshPlan.test.ts"
- Added: "frontend/src/realtime/refreshPlan.ts"
- Updated: "frontend/src/realtime/useRealtimeEvents.ts"
- Added: "frontend/src/routing/urlState.test.ts"
- Added: "frontend/src/routing/urlState.ts"
- Updated: "frontend/src/styles.css"
- Added: "frontend/src/topology/GraphListView.test.tsx"
- Added: "frontend/src/topology/GraphListView.tsx"
- Updated: "frontend/src/topology/ServiceNode.tsx"
- Updated: "frontend/src/topology/TopologyCommandBar.tsx"
- Added: "frontend/src/topology/semanticGraph.test.ts"
- Updated: "frontend/src/topology/semanticGraph.ts"
- Added: "frontend/src/topologyLayout.test.ts"
- Updated: "frontend/src/topologyLayout.ts"
- Updated: "package-lock.json"
- Updated: "package.json"
- Updated: "unraid/my-servicemap.xml"

Export provenance/manifests refreshed; excluded from the change summary.

Publish curated ServiceMap source from af46f684e468dffd3a5190e28d3b572d4c26bfd7
This commit is contained in:
NuklearRabbit committed 2026-11-20 13:51:46 +01:00
1 parent d7319250e8
commit adc2c70c21
91 files changed
+9205 -1691

No files matched your search

+59 -61
View File
@@ -1,5 +1,10 @@
import { Handle, Position, type Node, type NodeProps } from "@xyflow/react";
import { Box, Boxes, Crosshair, Layers } from "lucide-react";
import { StatusIcon } from "../components/StatusIcon";
import { criticalityText, statusText } from "../labels";
import type {
ComponentRole,
Criticality,
@@ -33,63 +38,60 @@ export type ServiceNodeData = {
export type ServiceNode = Node<ServiceNodeData, "service">;
const statusLabel = (status: HealthStatus) =>
status === "unmonitored"
? "Not monitored"
: status[0].toUpperCase() + status.slice(1);
const statusIcon = (status: HealthStatus) =>
({
healthy: "✓",
degraded: "△",
down: "!",
recovering: "↻",
maintenance: "Ⅱ",
unknown: "?",
unmonitored: "○",
})[status];
export const statusLabel = (status: HealthStatus) => statusText(status);
/** Splits "2/4 resolved · 2 unresolved · 1 incident" into separate chips. */
function factChips(text: string | undefined): string[] {
return (text ?? "").split(" · ").map((part) => part.trim()).filter(Boolean);
}
export function ServiceNodeView({ data }: NodeProps<ServiceNode>) {
const targetLabel =
data.nodeKind === "domain"
? `${data.memberIds?.length ?? 0} components`
: data.applicationNode
? `${data.monitoredComponents ?? 0} resolved · ${data.unmonitoredComponents ?? 0} unresolved`
: data.latency != null
? `${data.latency} ms · ${data.kind.toUpperCase()}`
: data.kind.toUpperCase();
const kind = data.nodeKind ?? (data.applicationNode ? "application" : "component");
const KindIcon = kind === "domain" ? Layers : kind === "application" ? Boxes : Box;
const memberCount = data.memberIds?.length ?? 0;
const kicker =
kind === "domain"
? `Domein · ${memberCount} ${memberCount === 1 ? "component" : "componenten"}`
: kind === "application"
? `Applicatie · ${memberCount} ${memberCount === 1 ? "component" : "componenten"}`
: `${data.role ?? data.category.replace("_", " ")} · ${data.kind.toUpperCase()}`;
const chips =
kind === "domain"
? factChips(data.explanation)
: kind === "application"
? [`${data.monitoredComponents ?? 0} opgelost`, `${data.unmonitoredComponents ?? 0} onopgelost`]
: [
...(data.latency != null ? [`${data.latency} ms`] : []),
`${data.dependencyCount} ${data.dependencyCount === 1 ? "afhankelijkheid" : "afhankelijkheden"}`,
];
const note = kind === "domain" ? null : data.explanation;
return (
<>
<Handle type="target" position={Position.Left} />
<div
className={`service-node-body status-${data.status}`}
aria-label={`${data.name}, ${statusLabel(data.status)}${data.rootCause ? ", likely root cause" : ""}`}
className={`service-node-body node-${kind}`}
aria-label={`${data.name}, ${statusLabel(data.status)}${data.rootCause ? ", waarschijnlijke hoofdoorzaak" : ""}`}
>
<div className="node-badges">
{data.rootCause && (
<span className="node-badge root-cause-badge">ROOT CAUSE</span>
)}
{!data.rootCause && data.impacted && (
<span className="node-badge impacted-badge">IMPACTED</span>
)}
{data.flapping && (
<span className="node-badge flap-badge">FLAPPING</span>
)}
<div className="node-head">
<KindIcon className="node-kind-icon" size={13} aria-hidden="true" />
<span className="node-kicker">{kicker}</span>
</div>
{data.nodeKind === "domain" && (
<span className="node-kicker">
DOMAIN · {data.memberIds?.length ?? 0} components
<strong className="node-name">{data.name}</strong>
<div className="node-state">
<span className={`node-status status-${data.status}`}>
<StatusIcon status={data.status} />
{statusLabel(data.status)}
</span>
)}
{data.applicationNode && (
<span className="node-kicker">
APPLICATION · {data.memberIds?.length ?? 0} components
</span>
)}
{data.applicationNode && data.roles?.length ? (
<span
className="app-micro-topology"
aria-label={`Component roles: ${data.roles.join(", ")}`}
>
{data.rootCause && (
<span className="node-flag root-cause-badge">
<Crosshair size={12} aria-hidden="true" />
Hoofdoorzaak
</span>
)}
{!data.rootCause && data.impacted && <span className="node-flag impacted-badge">Geraakt</span>}
{data.flapping && <span className="node-flag flap-badge">Wisselvallig</span>}
</div>
{kind === "application" && data.roles?.length ? (
<span className="app-micro-topology" aria-label={`Componentrollen: ${data.roles.join(", ")}`}>
{data.roles.slice(0, 5).map((role) => (
<i key={role} className={`role-${role}`}>
{role.slice(0, 1).toUpperCase()}
@@ -97,19 +99,15 @@ export function ServiceNodeView({ data }: NodeProps<ServiceNode>) {
))}
</span>
) : null}
{data.nodeKind === "component" && (
<span className="node-kicker">{data.role ?? data.category}</span>
)}
<strong>{data.name}</strong>
<span className={`node-status status-${data.status}`}>
<i aria-hidden="true">{statusIcon(data.status)}</i>{" "}
{statusLabel(data.status)}
</span>
<small>{targetLabel} · {data.criticality}</small>
<small>
{data.explanation ??
`${data.category.replace("_", " ")} · ${data.dependencyCount} ${data.dependencyCount === 1 ? "dependency" : "dependencies"}`}
</small>
<div className="node-chips">
<span className={`node-chip criticality-${data.criticality}`}>{criticalityText(data.criticality)}</span>
{chips.map((chip) => (
<span key={chip} className={`node-chip${/incident/.test(chip) ? " node-chip-alert" : ""}`}>
{chip}
</span>
))}
</div>
{note && <small className="node-note">{note}</small>}
</div>
<Handle type="source" position={Position.Right} />
</>