feat(health): expose external in /services payload and accept on add/edit

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-08 00:55:19 +10:00
parent 789dc2442e
commit d7a1a47b28
2 changed files with 14 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ router.get('/services', asyncWrap(async (_req, res) => {
const list = g.services.map(s => {
const st = statuses[s.id];
return {
id: s.id, name: s.name, host: s.host, url: s.url, icon: iconSlug(s),
id: s.id, name: s.name, host: s.host, url: s.url, external: s.external ?? null, icon: iconSlug(s),
status: st?.status || 'unknown', latency_ms: st?.latency_ms ?? null,
detail: st?.detail || null, checked_at: st?.checked_at || null
};
@@ -39,6 +39,7 @@ const svcBody = z.object({
category: z.enum(['agents', 'infrastructure', 'media', 'other']).default('other'),
host: z.string().max(120).optional(),
url: z.string().url(),
external: z.string().url().optional(),
icon: z.string().max(64).optional(),
check: checkCfg.optional()
});