Show server type in the web UI

This commit is contained in:
Brandon Zhang
2026-03-27 18:19:26 +08:00
parent 3360c2ad85
commit 18352a99d5
5 changed files with 14 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ def get_status():
status="up", status="up",
started_at=status_service.server_started_at(), started_at=status_service.server_started_at(),
version=APP_VERSION, version=APP_VERSION,
type="python",
), ),
agent=agent_info, agent=agent_info,
queue=QueueCounts(**counts), queue=QueueCounts(**counts),

View File

@@ -80,6 +80,7 @@ class ServerInfo(BaseModel):
status: str status: str
started_at: datetime started_at: datetime
version: str version: str
type: str
class AgentInfo(BaseModel): class AgentInfo(BaseModel):

View File

@@ -58,6 +58,7 @@ func handleStatus(stores Stores) http.HandlerFunc {
"server": map[string]any{ "server": map[string]any{
"status": "up", "status": "up",
"started_at": serverStartTime.Format(time.RFC3339Nano), "started_at": serverStartTime.Format(time.RFC3339Nano),
"type": "go",
"version": config.AppVersion, "version": config.AppVersion,
}, },
"agent": agent, "agent": agent,

View File

@@ -30,6 +30,7 @@
<line x1="12" y1="17" x2="12" y2="21"/> <line x1="12" y1="17" x2="12" y2="21"/>
</svg> </svg>
<span class="header-brand-name">local<span>-mcp</span></span> <span class="header-brand-name">local<span>-mcp</span></span>
<span id="server-type-badge" class="badge badge--muted header-version-badge">server</span>
<span id="app-version-badge" class="badge badge--muted header-version-badge">v&ndash;</span> <span id="app-version-badge" class="badge badge--muted header-version-badge">v&ndash;</span>
</div> </div>

View File

@@ -58,6 +58,7 @@ function updateHeaderLeds(serverOnline, status) {
function renderStatusPanel(status) { function renderStatusPanel(status) {
const el = document.getElementById('status-panel-body'); const el = document.getElementById('status-panel-body');
const serverTypeBadge = document.getElementById('server-type-badge');
const versionBadge = document.getElementById('app-version-badge'); const versionBadge = document.getElementById('app-version-badge');
if (!el || !status) return; if (!el || !status) return;
@@ -66,8 +67,13 @@ function renderStatusPanel(status) {
pending_count: status.queue?.pending_count ?? 0, pending_count: status.queue?.pending_count ?? 0,
consumed_count: status.queue?.consumed_count ?? 0, consumed_count: status.queue?.consumed_count ?? 0,
}; };
const serverType = status.server?.type || 'unknown';
const version = status.server?.version || ''; const version = status.server?.version || '';
if (serverTypeBadge) {
serverTypeBadge.textContent = escapeHtml(serverType);
}
if (versionBadge) { if (versionBadge) {
versionBadge.textContent = `v${version}`; versionBadge.textContent = `v${version}`;
} }
@@ -81,6 +87,10 @@ function renderStatusPanel(status) {
<span class="stat-label">Version</span> <span class="stat-label">Version</span>
<span class="stat-value">v${escapeHtml(version)}</span> <span class="stat-value">v${escapeHtml(version)}</span>
</div> </div>
<div class="stat-row">
<span class="stat-label">Server Type</span>
<span class="stat-value">${escapeHtml(serverType)}</span>
</div>
<div class="stat-row"> <div class="stat-row">
<span class="stat-label">Pending</span> <span class="stat-label">Pending</span>
<span class="stat-value stat-value--cyan">${queue.pending_count}</span> <span class="stat-value stat-value--cyan">${queue.pending_count}</span>