feat(gui): Integrate External MCPs into Operations Hub with status indicators

This commit is contained in:
2026-03-12 15:54:52 -04:00
parent 828fadf829
commit 3b2588ad61
3 changed files with 71 additions and 1 deletions

View File

@@ -608,6 +608,9 @@ class App:
if imgui.begin_tab_item("Usage Analytics")[0]:
self._render_usage_analytics_panel()
imgui.end_tab_item()
if imgui.begin_tab_item("External Tools")[0]:
self._render_external_tools_panel()
imgui.end_tab_item()
imgui.end_tab_bar()
imgui.end()
@@ -2573,6 +2576,54 @@ def hello():
imgui.pop_style_color(2)
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_response_panel")
def _render_external_tools_panel(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_external_tools_panel")
if imgui.button("Refresh External MCPs"):
self.event_queue.put("refresh_external_mcps", None)
imgui.separator()
# Server status indicators
manager = mcp_client.get_external_mcp_manager()
statuses = manager.get_servers_status()
if statuses:
imgui.text("Servers:")
for sname, status in statuses.items():
imgui.same_line()
# Green for running, Yellow for starting, Red for error, Gray for idle
col = (0.5, 0.5, 0.5, 1.0)
if status == 'running':
col = (0.0, 1.0, 0.0, 1.0)
elif status == 'starting':
col = (1.0, 1.0, 0.0, 1.0)
elif status == 'error':
col = (1.0, 0.0, 0.0, 1.0)
imgui.color_button(f"##status_{sname}", col)
imgui.same_line()
imgui.text(sname)
imgui.separator()
tools = manager.get_all_tools()
if not tools:
imgui.text_disabled("No external tools found.")
else:
if imgui.begin_table("external_tools_table", 3, imgui.TableFlags_.borders | imgui.TableFlags_.row_bg | imgui.TableFlags_.resizable):
imgui.table_setup_column("Name")
imgui.table_setup_column("Server")
imgui.table_setup_column("Description")
imgui.table_headers_row()
for tname, tinfo in tools.items():
imgui.table_next_row()
imgui.table_next_column()
imgui.text(tname)
imgui.table_next_column()
imgui.text(tinfo.get('server', 'unknown'))
imgui.table_next_column()
imgui.text(tinfo.get('description', ''))
imgui.end_table()
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_external_tools_panel")
def _render_comms_history_panel(self) -> None:
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_comms_history_panel")
st_col = vec4(200, 220, 160)