From 4bb4ad4fba8d4f7b581d211cf4c3763aa935366e Mon Sep 17 00:00:00 2001 From: William Valentin Date: Sat, 14 Feb 2026 09:19:57 -0800 Subject: [PATCH] fix(ui): show services in settings page --- docs/plans/state.json | 1 + src/gateway/ui/pages/settings.js | 46 +++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/docs/plans/state.json b/docs/plans/state.json index 36447b3..dafe55d 100644 --- a/docs/plans/state.json +++ b/docs/plans/state.json @@ -71,6 +71,7 @@ "src/gateway/handlers/handlers.test.ts", "src/gateway/server.ts", "src/gateway/ui/pages/dashboard.js", + "src/gateway/ui/pages/settings.js", "src/gateway/ui/style.css" ], "test_status": "pnpm test:run src/gateway/handlers/services.test.ts src/gateway/handlers/handlers.test.ts + pnpm typecheck passing" diff --git a/src/gateway/ui/pages/settings.js b/src/gateway/ui/pages/settings.js index 22584eb..51e0387 100644 --- a/src/gateway/ui/pages/settings.js +++ b/src/gateway/ui/pages/settings.js @@ -17,13 +17,14 @@ let _el = null; async function loadSettings() { if (!_client || !_el) {return;} - let config, tools, channels; + let config, tools, channels; + let services; try { - [config, tools, channels] = await Promise.all([ + [config, tools, services] = await Promise.all([ _client.call('config.get'), _client.call('tools.list'), - _client.call('system.channels'), + _client.call('system.services'), ]); } catch (err) { _el.innerHTML = ` @@ -45,8 +46,8 @@ async function loadSettings() { // Build tool list const toolList = tools?.tools ?? []; - // Build channel list - const channelList = channels?.channels ?? []; + // Build services list + const serviceList = services?.services ?? []; _el.innerHTML = `

Settings

@@ -95,18 +96,33 @@ async function loadSettings() { ` : '
No tools available
'} -

Channels

+

Services

- ${channelList.length > 0 ? ` -
- ${channelList.map(ch => ` -
- - ${escapeHtml(ch.name)} -
- `).join('')} + ${serviceList.length > 0 ? ` +
+ ${serviceList.map(svc => { + const typeIcon = svc.type === 'channel' ? '📡' : svc.type === 'automation' ? '⚙️' : '🔧'; + const statusClass = svc.status === 'connected' + ? 'connected' + : svc.status === 'configured' + ? 'configured' + : svc.status === 'error' + ? 'error' + : svc.status === 'not_configured' + ? 'not-configured' + : 'disconnected'; + const itemCount = svc.itemCount ? ` (${svc.itemCount})` : ''; + return ` +
+ ${typeIcon} + ${escapeHtml(svc.name)}${itemCount} + ${escapeHtml(svc.status)} + ${escapeHtml(svc.description ?? '')} +
+ `; + }).join('')}
- ` : '
No channels registered
'} + ` : '
No services found
'}

Configuration (read-only)