feat(ops): Consolidate usage analytics into Operations Hub with popout option
This commit is contained in:
31
src/gui_2.py
31
src/gui_2.py
@@ -127,6 +127,8 @@ class App:
|
||||
self.ui_separate_response_panel = gui_cfg.get("separate_response_panel", False)
|
||||
self.ui_separate_tool_calls_panel = gui_cfg.get("separate_tool_calls_panel", False)
|
||||
self.ui_separate_task_dag = gui_cfg.get("separate_task_dag", False)
|
||||
self.ui_separate_usage_analytics = gui_cfg.get("separate_usage_analytics", False)
|
||||
self.show_windows.setdefault("Usage Analytics", False)
|
||||
self.ui_multi_viewport = gui_cfg.get("multi_viewport", False)
|
||||
self.layout_presets = self.config.get("layout_presets", {})
|
||||
self._new_preset_name = ""
|
||||
@@ -412,13 +414,15 @@ class App:
|
||||
self._render_provider_panel()
|
||||
if imgui.collapsing_header("System Prompts"):
|
||||
self._render_system_prompts_panel()
|
||||
if imgui.collapsing_header("Token Budget"):
|
||||
self._render_token_budget_panel()
|
||||
self._render_cache_panel()
|
||||
self._render_tool_analytics_panel()
|
||||
self._render_session_insights_panel()
|
||||
|
||||
imgui.end()
|
||||
if self.ui_separate_usage_analytics and self.show_windows.get("Usage Analytics", False):
|
||||
exp, opened = imgui.begin("Usage Analytics", self.show_windows["Usage Analytics"])
|
||||
self.show_windows["Usage Analytics"] = bool(opened)
|
||||
if exp:
|
||||
self._render_usage_analytics_panel()
|
||||
imgui.end()
|
||||
if self.show_windows.get("MMA Dashboard", False):
|
||||
exp, opened = imgui.begin("MMA Dashboard", self.show_windows["MMA Dashboard"])
|
||||
self.show_windows["MMA Dashboard"] = bool(opened)
|
||||
@@ -525,11 +529,15 @@ class App:
|
||||
self.ui_focus_agent = None
|
||||
if exp:
|
||||
imgui.push_style_var(imgui.StyleVar_.item_spacing, imgui.ImVec2(10, 4))
|
||||
ch, self.ui_separate_tool_calls_panel = imgui.checkbox("Pop Out Tool Calls", self.ui_separate_tool_calls_panel)
|
||||
if ch: self.show_windows["Tool Calls"] = self.ui_separate_tool_calls_panel
|
||||
ch1, self.ui_separate_tool_calls_panel = imgui.checkbox("Pop Out Tool Calls", self.ui_separate_tool_calls_panel)
|
||||
if ch1: self.show_windows["Tool Calls"] = self.ui_separate_tool_calls_panel
|
||||
imgui.same_line()
|
||||
ch2, self.ui_separate_usage_analytics = imgui.checkbox("Pop Out Usage Analytics", self.ui_separate_usage_analytics)
|
||||
if ch2: self.show_windows["Usage Analytics"] = self.ui_separate_usage_analytics
|
||||
imgui.pop_style_var()
|
||||
|
||||
show_tc_tab = not self.ui_separate_tool_calls_panel
|
||||
show_usage_tab = not self.ui_separate_usage_analytics
|
||||
|
||||
if imgui.begin_tab_bar("ops_tabs"):
|
||||
if imgui.begin_tab_item("Comms History")[0]:
|
||||
@@ -539,6 +547,10 @@ class App:
|
||||
if imgui.begin_tab_item("Tool Calls")[0]:
|
||||
self._render_tool_calls_panel()
|
||||
imgui.end_tab_item()
|
||||
if show_usage_tab:
|
||||
if imgui.begin_tab_item("Usage Analytics")[0]:
|
||||
self._render_usage_analytics_panel()
|
||||
imgui.end_tab_item()
|
||||
imgui.end_tab_bar()
|
||||
imgui.end()
|
||||
|
||||
@@ -1972,6 +1984,13 @@ def hello():
|
||||
imgui.text(f"Tokens/Ticket: {efficiency:.0f}" if efficiency > 0 else "Tokens/Ticket: N/A")
|
||||
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_session_insights_panel")
|
||||
|
||||
def _render_usage_analytics_panel(self) -> None:
|
||||
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_usage_analytics_panel")
|
||||
self._render_token_budget_panel()
|
||||
self._render_tool_analytics_panel()
|
||||
self._render_session_insights_panel()
|
||||
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_usage_analytics_panel")
|
||||
|
||||
def _render_message_panel(self) -> None:
|
||||
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_message_panel")
|
||||
# LIVE indicator
|
||||
|
||||
Reference in New Issue
Block a user