From 18352a99d59b2c147278e537367f9c061c19180b Mon Sep 17 00:00:00 2001 From: Brandon Zhang Date: Fri, 27 Mar 2026 18:19:26 +0800 Subject: [PATCH] Show server type in the web UI --- app/api/routes_status.py | 1 + app/models.py | 1 + go-server/internal/api/status.go | 1 + static/index.html | 1 + static/js/status.js | 10 ++++++++++ 5 files changed, 14 insertions(+) diff --git a/app/api/routes_status.py b/app/api/routes_status.py index f438b7e..5a62ee9 100644 --- a/app/api/routes_status.py +++ b/app/api/routes_status.py @@ -51,6 +51,7 @@ def get_status(): status="up", started_at=status_service.server_started_at(), version=APP_VERSION, + type="python", ), agent=agent_info, queue=QueueCounts(**counts), diff --git a/app/models.py b/app/models.py index b188df0..23f42cb 100644 --- a/app/models.py +++ b/app/models.py @@ -80,6 +80,7 @@ class ServerInfo(BaseModel): status: str started_at: datetime version: str + type: str class AgentInfo(BaseModel): diff --git a/go-server/internal/api/status.go b/go-server/internal/api/status.go index 2732dec..9561bf8 100644 --- a/go-server/internal/api/status.go +++ b/go-server/internal/api/status.go @@ -58,6 +58,7 @@ func handleStatus(stores Stores) http.HandlerFunc { "server": map[string]any{ "status": "up", "started_at": serverStartTime.Format(time.RFC3339Nano), + "type": "go", "version": config.AppVersion, }, "agent": agent, diff --git a/static/index.html b/static/index.html index 31ee5de..a016570 100644 --- a/static/index.html +++ b/static/index.html @@ -30,6 +30,7 @@ local-mcp + server v– diff --git a/static/js/status.js b/static/js/status.js index 75e86a3..cc077c9 100644 --- a/static/js/status.js +++ b/static/js/status.js @@ -58,6 +58,7 @@ function updateHeaderLeds(serverOnline, status) { function renderStatusPanel(status) { const el = document.getElementById('status-panel-body'); + const serverTypeBadge = document.getElementById('server-type-badge'); const versionBadge = document.getElementById('app-version-badge'); if (!el || !status) return; @@ -66,8 +67,13 @@ function renderStatusPanel(status) { pending_count: status.queue?.pending_count ?? 0, consumed_count: status.queue?.consumed_count ?? 0, }; + const serverType = status.server?.type || 'unknown'; const version = status.server?.version || '–'; + if (serverTypeBadge) { + serverTypeBadge.textContent = escapeHtml(serverType); + } + if (versionBadge) { versionBadge.textContent = `v${version}`; } @@ -81,6 +87,10 @@ function renderStatusPanel(status) { Version v${escapeHtml(version)} +
+ Server Type + ${escapeHtml(serverType)} +
Pending ${queue.pending_count}