KI-AGENT: Systemstatus und Node Exporter ergänzen

This commit is contained in:
2026-05-20 20:41:48 +02:00
parent 3796bc2953
commit 8df587f9e2
7 changed files with 494 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ import { sendMail } from "../utils/mailer";
import { ensureTenantBaseData } from "../modules/bootstrap.service";
import { buildTenantFullExport, importTenantFullExport } from "../utils/tenantFullExport";
import type { TenantFullExport } from "../utils/tenantFullExport";
import { buildSystemStatus } from "../modules/system-status.service";
export default async function adminRoutes(server: FastifyInstance) {
const deriveNameFromEmail = (email: string) => {
@@ -393,6 +394,21 @@ export default async function adminRoutes(server: FastifyInstance) {
}
});
// -------------------------------------------------------------
// GET /admin/system-status
// -------------------------------------------------------------
server.get("/admin/system-status", async (req, reply) => {
try {
const currentUser = await requireAdmin(req, reply);
if (!currentUser) return;
return await buildSystemStatus(server);
} catch (err) {
console.error("ERROR /admin/system-status:", err);
return reply.code(500).send({ error: "Internal Server Error" });
}
});
// -------------------------------------------------------------
// POST /admin/users
// -------------------------------------------------------------