feat: add navigation for remote machines

This commit is contained in:
Developer
2026-07-14 21:06:25 +00:00
parent 37533dd219
commit 4562a9dfca
3 changed files with 68 additions and 8 deletions
@@ -1,5 +1,9 @@
import { describe, expect, it } from "vitest";
import { configuredNavEntries, SERVICE_TYPE_NAV_ENTRIES } from "../navEntries";
import {
configuredNavEntries,
remoteMachineNavEntries,
SERVICE_TYPE_NAV_ENTRIES,
} from "../navEntries";
describe("navEntries", () => {
it("returns no entries when no types are configured", () => {
@@ -13,8 +17,33 @@ describe("navEntries", () => {
expect(entries[0].path).toBe("/services/jellyfin");
});
it("does not expose remote machines as a top-level entry", () => {
expect(configuredNavEntries(new Set(["remote_machine"]))).toEqual([]);
it("creates one top-level entry per enabled remote machine", () => {
const entries = remoteMachineNavEntries([
{
id: "storage",
name: "Storage",
service_type: "remote_machine",
enabled: true,
},
{
id: "worker",
name: "Worker",
service_type: "remote_machine",
enabled: true,
},
{
id: "disabled",
name: "Disabled",
service_type: "remote_machine",
enabled: false,
},
]);
expect(entries.map((entry) => entry.label)).toEqual(["Storage", "Worker"]);
expect(entries.map((entry) => entry.path)).toEqual([
"/services/remote_machine/storage",
"/services/remote_machine/worker",
]);
});
it("returns all observability entries", () => {