File size: 2,859 Bytes
bbe2211 7655fd6 bbe2211 d203412 7655fd6 d6a094c 7655fd6 1d377e2 7655fd6 1d377e2 7655fd6 ebdbbf6 1d377e2 ebdbbf6 1d377e2 ebdbbf6 1d377e2 7655fd6 ebdbbf6 7655fd6 ebdbbf6 7655fd6 d203412 7655fd6 d6a094c ebdbbf6 7655fd6 ebdbbf6 7655fd6 d6a094c 7655fd6 d6a094c ebdbbf6 7655fd6 16a1427 7655fd6 16a1427 7655fd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | """
Minimalist, Math-First ARF UI Components
Compatible with Gradio 6+ and Hugging Face Spaces
"""
from __future__ import annotations
from typing import Dict, List, Any, Optional
import gradio as gr
# -----------------------------
# Header & Footer
# -----------------------------
def create_header(version: str = "3.3.6", is_enterprise: bool = False):
"""Minimalist header with version and mode."""
header_text = f"🚀 Agentic Reliability Framework v{version} · "
header_text += "ENTERPRISE" if is_enterprise else "OSS Edition"
return gr.Markdown(header_text, elem_classes=["mono"])
def create_footer():
return gr.Markdown("ARF © 2025 · Self-Healing Agentic Systems", elem_classes=["mono"])
# -----------------------------
# Tab 1: Incident Demo
# -----------------------------
def create_tab1_incident_demo(
scenarios: Dict[str, Any],
healing_intents: Optional[List[Dict[str, Any]]] = None
):
"""Minimalist Incident Demo tab (matches app.py signature)."""
with gr.Column():
scenario_dropdown = gr.Dropdown(
label="Scenario",
choices=list(scenarios.keys()),
value=list(scenarios.keys())[0],
)
execution_mode = gr.Radio(
label="Execution Mode",
choices=["advisory", "approval", "autonomous"],
value="advisory",
)
run_button = gr.Button("Run Analysis", variant="primary")
metrics_display = gr.Markdown("execution_state = idle", elem_classes=["mono"])
return scenario_dropdown, execution_mode, run_button, metrics_display
# -----------------------------
# Tab 2: Business ROI
# -----------------------------
def create_tab2_business_roi():
with gr.Column():
roi_markdown = gr.Markdown("## Business Impact & ROI\n```\nROI calculations will appear here\n```", elem_classes=["mono"])
return roi_markdown
# -----------------------------
# Tab 3: Enterprise Features
# -----------------------------
def create_tab3_enterprise_features():
with gr.Column():
features_markdown = gr.Markdown(
"## Enterprise Features\n- Full audit trail\n- Approval modes\n- Automated healing\n",
elem_classes=["mono"]
)
return features_markdown
# -----------------------------
# Tab 4: Audit Trail
# -----------------------------
def create_tab4_audit_trail():
with gr.Column():
audit_markdown = gr.Markdown("## Audit Trail & History\n```\nRecent actions will appear here\n```", elem_classes=["mono"])
return audit_markdown
# -----------------------------
# Tab 5: Learning Engine
# -----------------------------
def create_tab5_learning_engine():
with gr.Column():
learning_markdown = gr.Markdown("## Learning Engine Stats\n```\nModel improvements and patterns\n```", elem_classes=["mono"])
return learning_markdown
|