Private
Public Access
feat(ops-hub): add Vendor State tab with quota + context + cache
- New module-level render_vendor_state(app) in gui_2.py - New 'Vendor State' tab in render_operations_hub tab_bar - Renders 5 stable metrics: provider_model, context_window, cache, quota, last_error - Each row: Metric label | Value | State (colored ok/warn/error/info) - Tooltips via imgui.set_tooltip on the value cell ImGui scope linter: render_vendor_state OK. Pre-existing 2 errors at lines 2684 and 4994 unrelated to this commit.
This commit is contained in:
@@ -4028,6 +4028,30 @@ def render_operations_hub(app: App) -> None:
|
|||||||
curr = app.controller.ui_tier_layout_bindings.get(t, ""); idx = profiles.index(curr) if curr in profiles else 0
|
curr = app.controller.ui_tier_layout_bindings.get(t, ""); idx = profiles.index(curr) if curr in profiles else 0
|
||||||
ch_combo, new_idx = imgui.combo(t, idx, profiles)
|
ch_combo, new_idx = imgui.combo(t, idx, profiles)
|
||||||
if ch_combo: app.controller.ui_tier_layout_bindings[t] = profiles[new_idx]
|
if ch_combo: app.controller.ui_tier_layout_bindings[t] = profiles[new_idx]
|
||||||
|
with imscope.tab_item("Vendor State") as (exp, _):
|
||||||
|
if exp: render_vendor_state(app)
|
||||||
|
|
||||||
|
def render_vendor_state(app: App) -> None:
|
||||||
|
"""Render the Operations Hub > Vendor State panel.
|
||||||
|
[C: src/vendor_state.py:get_vendor_state]
|
||||||
|
"""
|
||||||
|
from src.vendor_state import get_vendor_state
|
||||||
|
metrics = get_vendor_state(app)
|
||||||
|
if imgui.begin_table("vendor_state", 3, imgui.TableFlags_.row_bg | imgui.TableFlags_.borders):
|
||||||
|
imgui.table_setup_column("Metric", imgui.TableColumnFlags_.width_fixed, 180)
|
||||||
|
imgui.table_setup_column("Value", imgui.TableColumnFlags_.width_stretch)
|
||||||
|
imgui.table_setup_column("State", imgui.TableColumnFlags_.width_fixed, 60)
|
||||||
|
imgui.table_headers_row()
|
||||||
|
state_colors = {"ok": vec4(120, 220, 120), "warn": vec4(240, 200, 80), "error": vec4(240, 80, 80), "info": vec4(180, 180, 180)}
|
||||||
|
for m in metrics:
|
||||||
|
imgui.table_next_row()
|
||||||
|
imgui.table_next_column(); imgui.text(m.label)
|
||||||
|
imgui.table_next_column()
|
||||||
|
imgui.text(m.value)
|
||||||
|
if imgui.is_item_hovered(): imgui.set_tooltip(m.tooltip)
|
||||||
|
imgui.table_next_column()
|
||||||
|
imgui.text_colored(state_colors.get(m.state, vec4(180, 180, 180)), m.state)
|
||||||
|
imgui.end_table()
|
||||||
|
|
||||||
def render_message_panel(app: App) -> None:
|
def render_message_panel(app: App) -> None:
|
||||||
if app.perf_profiling_enabled: app.perf_monitor.start_component("_render_message_panel")
|
if app.perf_profiling_enabled: app.perf_monitor.start_component("_render_message_panel")
|
||||||
|
|||||||
Reference in New Issue
Block a user