feat(hosts): Host-Tabelle mit Filtern, CSV-Export und Detailansicht (#007)

Suche ueber Hostname, Key, Server-ID, IP und Rechnungsnummer, fuenf Filter,
Sortierung mit nulls-last, Seitenblaettern und CSV-Export. Detailansicht mit
sechs Tabs, Notizen, Tags und Token-Widerruf. 59 Tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-17 21:12:41 +02:00
co-authored by Claude Opus 5
parent 6aa6a20f63
commit 0ae96a50cd
18 changed files with 1289 additions and 286 deletions
+24
View File
@@ -0,0 +1,24 @@
import { describe, expect, it } from "vitest";
import { csvDatei, csvZelle } from "@/lib/csv";
describe("CSV-Export", () => {
it("formatiert Werte deutsch", () => {
expect(csvZelle(new Date("2027-03-02T00:00:00Z"))).toBe("02.03.2027");
expect(csvZelle(1)).toBe("1");
expect(csvZelle(1234.5)).toBe("1.234,50");
expect(csvZelle(null)).toBe("");
expect(csvZelle(undefined)).toBe("");
});
it("maskiert Semikolon, Anführungszeichen und Zeilenumbrüche", () => {
expect(csvZelle("Firma; GmbH")).toBe('"Firma; GmbH"');
expect(csvZelle('Er sagte "hallo"')).toBe('"Er sagte ""hallo"""');
expect(csvZelle("Zeile1\nZeile2")).toBe('"Zeile1\nZeile2"');
});
it("schreibt BOM und Zeilenenden für Excel", () => {
const datei = csvDatei(["A", "B"], [["x", 2]]);
expect(datei.startsWith("")).toBe(true);
expect(datei).toContain("A;B\r\nx;2\r\n");
});
});