Update ui/components.py
Browse files- ui/components.py +20 -20
ui/components.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
"""
|
| 2 |
Gradio-only UI components for ARF
|
| 3 |
Ensures full compatibility with app.py
|
| 4 |
-
Updated with proper imports and error handling
|
| 5 |
NOW WITH REAL ARF INSTALLATION DETECTION
|
| 6 |
UPDATED: Added realism panel integration for Tab 1
|
| 7 |
UPDATED: Added dynamic performance metrics function for Phase 2
|
|
@@ -274,6 +273,26 @@ def create_tab1_incident_demo(scenarios=INCIDENT_SCENARIOS, default_scenario="Ca
|
|
| 274 |
|
| 275 |
# Middle Column: Agent Workflow
|
| 276 |
with gr.Column(scale=2, variant="panel") as middle_col:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
# Agent Workflow Header
|
| 278 |
workflow_header = gr.Markdown("## 🔄 ARF Agent Workflow")
|
| 279 |
workflow_subheader = gr.Markdown("### How ARF transforms incidents into autonomous healing")
|
|
@@ -404,25 +423,6 @@ def create_tab1_incident_demo(scenarios=INCIDENT_SCENARIOS, default_scenario="Ca
|
|
| 404 |
)
|
| 405 |
enterprise_info = gr.Markdown("*Requires Enterprise license*")
|
| 406 |
|
| 407 |
-
# Mode Selection & Safety Controls
|
| 408 |
-
with gr.Row():
|
| 409 |
-
with gr.Column(scale=1):
|
| 410 |
-
approval_toggle = gr.CheckboxGroup(
|
| 411 |
-
choices=["👤 Require Human Approval"],
|
| 412 |
-
label="Safety Controls",
|
| 413 |
-
value=[],
|
| 414 |
-
info="Toggle human oversight"
|
| 415 |
-
)
|
| 416 |
-
|
| 417 |
-
with gr.Column(scale=2):
|
| 418 |
-
mcp_mode = gr.Radio(
|
| 419 |
-
choices=["🛡️ Advisory (OSS Only)", "👥 Approval", "⚡ Autonomous"],
|
| 420 |
-
value="🛡️ Advisory (OSS Only)",
|
| 421 |
-
label="MCP Safety Mode",
|
| 422 |
-
info="Control execution safety level",
|
| 423 |
-
interactive=True
|
| 424 |
-
)
|
| 425 |
-
|
| 426 |
# Timeline visualization
|
| 427 |
timeline_header = gr.Markdown("### ⏰ Incident Timeline")
|
| 428 |
timeline_viz = gr.Plot(
|
|
|
|
| 1 |
"""
|
| 2 |
Gradio-only UI components for ARF
|
| 3 |
Ensures full compatibility with app.py
|
|
|
|
| 4 |
NOW WITH REAL ARF INSTALLATION DETECTION
|
| 5 |
UPDATED: Added realism panel integration for Tab 1
|
| 6 |
UPDATED: Added dynamic performance metrics function for Phase 2
|
|
|
|
| 273 |
|
| 274 |
# Middle Column: Agent Workflow
|
| 275 |
with gr.Column(scale=2, variant="panel") as middle_col:
|
| 276 |
+
# ============ MOVED: Safety Controls Section (Now appears BEFORE Agent Workflow) ============
|
| 277 |
+
# Mode Selection & Safety Controls
|
| 278 |
+
with gr.Row():
|
| 279 |
+
with gr.Column(scale=1):
|
| 280 |
+
approval_toggle = gr.CheckboxGroup(
|
| 281 |
+
choices=["👤 Require Human Approval"],
|
| 282 |
+
label="Safety Controls",
|
| 283 |
+
value=[],
|
| 284 |
+
info="Toggle human oversight"
|
| 285 |
+
)
|
| 286 |
+
|
| 287 |
+
with gr.Column(scale=2):
|
| 288 |
+
mcp_mode = gr.Radio(
|
| 289 |
+
choices=["🛡️ Advisory (OSS Only)", "👥 Approval", "⚡ Autonomous"],
|
| 290 |
+
value="🛡️ Advisory (OSS Only)",
|
| 291 |
+
label="MCP Safety Mode",
|
| 292 |
+
info="Control execution safety level",
|
| 293 |
+
interactive=True
|
| 294 |
+
)
|
| 295 |
+
|
| 296 |
# Agent Workflow Header
|
| 297 |
workflow_header = gr.Markdown("## 🔄 ARF Agent Workflow")
|
| 298 |
workflow_subheader = gr.Markdown("### How ARF transforms incidents into autonomous healing")
|
|
|
|
| 423 |
)
|
| 424 |
enterprise_info = gr.Markdown("*Requires Enterprise license*")
|
| 425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 426 |
# Timeline visualization
|
| 427 |
timeline_header = gr.Markdown("### ⏰ Incident Timeline")
|
| 428 |
timeline_viz = gr.Plot(
|