feat(server): Standardwerte für Node, Storage und Bridge

Der Server kannte die Standards schon für kurze CLI-Befehle, aber nichts setzte sie. Jetzt im Server-Formular (Auswahl aus dem Verbindungstest) und als Vorbelegung im Assistenten.

Closes #023

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 21:57:31 +02:00
co-authored by Claude Opus 5.5
parent 8b37329c92
commit 2b6381de41
9 changed files with 182 additions and 18 deletions
+21
View File
@@ -130,6 +130,27 @@ describe.runIf(datenbankVerfuegbar)("Server-Verwaltung", () => {
expect(alles).not.toContain(MOCK_TOKEN_GEHEIMNIS);
});
it("Standardwerte: gespeichert, leere Felder fallen weg, ganz leer ist null", async () => {
await liste.POST(anfrage("POST", "/api/v1/server", admin, eingabe()));
const setzen = async (standards: unknown) =>
await (
await einzeln.PATCH(
anfrage("PATCH", "/api/v1/server/rz1", admin, eingabe({ tokenGeheimnis: "", standards })),
kontext({ name: "rz1" }),
)
).json();
expect((await setzen({ knoten: "pve01", storage: " local-zfs ", bridge: "" })).standards).toEqual({
knoten: "pve01",
storage: "local-zfs",
});
expect((await testPrisma.server.findFirstOrThrow()).standards).toEqual({
knoten: "pve01",
storage: "local-zfs",
});
expect((await setzen({ knoten: "", storage: "", bridge: "" })).standards).toBeNull();
expect((await testPrisma.server.findFirstOrThrow()).standards).toBeNull();
});
it("löscht und protokolliert", async () => {
await liste.POST(anfrage("POST", "/api/v1/server", admin, eingabe()));
expect(