Split Settings into sub-pages and add DNS cache clearing

Settings was a single long page. Break it into a sub-nav (Notifications,
DNS Badges, Cache) with its own route per section, each loading and
saving independently. Also add the DNS record-cache clearing action
that Sloth Manager had — a new admin-only POST /api/dns/cache/clear
truncates the zone/record cache tables so stale data can be wiped and
zones re-synced from scratch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5 committed 2026-09-15 12:23:12 +02:00
1 parent 3255314402
commit 1f0e6a9d4c
7 files changed
+721 -566

No files matched your search

+16
View File
@@ -506,3 +506,19 @@ dnsRouter.delete("/providers/:id/zones/:zoneId/records/:recordId", requireRole("
res.status(502).json({ error: err instanceof Error ? err.message : String(err) });
}
}));
// ─── Cache ───────────────────────────────────────────────────────────────────
dnsRouter.post("/cache/clear", requireRole("admin"), asyncHandler(async (req, res) => {
await db.delete(dnsRecordsCache);
await db.delete(dnsZonesCache);
await recordAudit({
actor: req.currentUser!,
category: "dns",
action: "clear_cache",
targetType: "dns_cache",
});
res.json({ ok: true });
}));