refactor: share admin contracts and isolate page styles

This commit is contained in:
illusia committed 2026-10-01 10:55:36 +08:00
1 parent e2f0a43762
commit f0712fa3fc
26 files changed
+2231 -1733

No files matched your search

+2 -13
View File
@@ -261,7 +261,7 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
options.getActiveSessions(),
options.getPeakSessions(),
options.startedAt,
) as unknown as AdminOverview;
);
response.json({
generatedAt: new Date().toISOString(),
gateway: {
@@ -288,7 +288,7 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
options.getActiveSessions(),
options.getPeakSessions(),
options.startedAt,
) as unknown as AdminOverview;
);
const report = {
generatedAt: new Date().toISOString(),
gateway: {
@@ -688,17 +688,6 @@ function readStructuredLogs(logFile: string): StructuredLogEntry[] {
return entries.sort((left, right) => Date.parse(left.timestamp ?? "") - Date.parse(right.timestamp ?? ""));
}
interface AdminOverview {
gateway: { uptimeSeconds: number };
teamSpeak: {
target: string;
status: string;
lastTestAt: string | null;
latencyMs: number | null;
lastError: string | null;
};
}
function logLevelName(level: unknown): string {
if (level === 10) return "DEBUG";
if (level === 30) return "INFO";