feat(ops): Consolidate usage analytics into Operations Hub with popout option
This commit is contained in:
@@ -344,7 +344,8 @@ class AppController:
|
||||
'_editing_preset_max_output_tokens': '_editing_preset_max_output_tokens',
|
||||
'_editing_preset_scope': '_editing_preset_scope',
|
||||
'show_windows': 'show_windows',
|
||||
'ui_separate_task_dag': 'ui_separate_task_dag'
|
||||
'ui_separate_task_dag': 'ui_separate_task_dag',
|
||||
'ui_separate_usage_analytics': 'ui_separate_usage_analytics'
|
||||
}
|
||||
self._gettable_fields = dict(self._settable_fields)
|
||||
self._gettable_fields.update({
|
||||
@@ -382,7 +383,8 @@ class AppController:
|
||||
'_editing_preset_top_p': '_editing_preset_top_p',
|
||||
'_editing_preset_max_output_tokens': '_editing_preset_max_output_tokens',
|
||||
'_editing_preset_scope': '_editing_preset_scope',
|
||||
'ui_separate_task_dag': 'ui_separate_task_dag'
|
||||
'ui_separate_task_dag': 'ui_separate_task_dag',
|
||||
'ui_separate_usage_analytics': 'ui_separate_usage_analytics'
|
||||
})
|
||||
self.perf_monitor = performance_monitor.get_monitor()
|
||||
self._perf_profiling_enabled = False
|
||||
@@ -783,6 +785,7 @@ class AppController:
|
||||
def init_state(self):
|
||||
"""Initializes the application state from configurations."""
|
||||
self.ui_separate_task_dag = False
|
||||
self.ui_separate_usage_analytics = False
|
||||
self.config = models.load_config()
|
||||
theme.load_from_config(self.config)
|
||||
ai_cfg = self.config.get("ai", {})
|
||||
@@ -842,6 +845,7 @@ class AppController:
|
||||
"AI Settings": True,
|
||||
"MMA Dashboard": True,
|
||||
"Task DAG": False,
|
||||
"Usage Analytics": False,
|
||||
"Tier 1: Strategy": True,
|
||||
"Tier 2: Tech Lead": True,
|
||||
"Tier 3: Workers": True,
|
||||
@@ -2184,6 +2188,7 @@ class AppController:
|
||||
"separate_response_panel": getattr(self, "ui_separate_response_panel", False),
|
||||
"separate_tool_calls_panel": getattr(self, "ui_separate_tool_calls_panel", False),
|
||||
"separate_task_dag": self.ui_separate_task_dag,
|
||||
"separate_usage_analytics": self.ui_separate_usage_analytics,
|
||||
"bg_shader_enabled": bg_shader.get_bg().enabled
|
||||
})
|
||||
self.config["gui"] = gui_cfg
|
||||
|
||||
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