Update ui/components.py
Browse files- ui/components.py +437 -173
ui/components.py
CHANGED
|
@@ -1,194 +1,458 @@
|
|
| 1 |
"""
|
| 2 |
-
|
| 3 |
"""
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
-
from typing import Dict, List, Optional,
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
| 14 |
-
<div style=
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
</div>
|
| 24 |
-
"""
|
| 25 |
-
return gr.HTML(value=html)
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
justify-content: space-between;
|
| 40 |
-
padding: 10px 15px;
|
| 41 |
-
background: {'rgba(255,107,107,0.05)' if is_loss else 'rgba(78,205,196,0.05)'};
|
| 42 |
-
border-radius: 6px;
|
| 43 |
-
margin: 8px 0;
|
| 44 |
-
border-left: 3px solid {'#FF6B6B' if is_loss else '#4ECDC4'};
|
| 45 |
-
'>
|
| 46 |
-
<span>{icon} {key}</span>
|
| 47 |
-
<span style='font-weight: bold; color: {'#FF6B6B' if is_loss else '#4ECDC4'};'>{value}</span>
|
| 48 |
</div>
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
</div>
|
| 130 |
|
| 131 |
-
<div
|
| 132 |
-
<
|
| 133 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
</div>
|
| 135 |
|
| 136 |
-
<div
|
| 137 |
-
|
| 138 |
-
padding:
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
|
|
|
| 143 |
</div>
|
| 144 |
</div>
|
| 145 |
-
"""
|
| 146 |
-
|
| 147 |
-
return gr.HTML(value=html)
|
| 148 |
-
|
| 149 |
-
def create_roi_comparison_table() -> gr.HTML:
|
| 150 |
-
"""Create ROI comparison table"""
|
| 151 |
-
html = """
|
| 152 |
-
<div style='margin: 20px 0;'>
|
| 153 |
-
<h4 style='margin: 0 0 15px 0; color: #2c3e50;'>📊 Capability Comparison</h4>
|
| 154 |
|
| 155 |
-
<
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
border-radius: 8px;
|
| 160 |
-
overflow: hidden;
|
| 161 |
-
'>
|
| 162 |
-
<thead>
|
| 163 |
-
<tr style='background: #f8f9fa;'>
|
| 164 |
-
<th style='padding: 12px; text-align: left; border-bottom: 2px solid #dee2e6;'>Feature</th>
|
| 165 |
-
<th style='padding: 12px; text-align: left; border-bottom: 2px solid #dee2e6;'>OSS (Free)</th>
|
| 166 |
-
<th style='padding: 12px; text-align: left; border-bottom: 2px solid #dee2e6;'>Enterprise</th>
|
| 167 |
-
</tr>
|
| 168 |
-
</thead>
|
| 169 |
-
<tbody>
|
| 170 |
-
<tr>
|
| 171 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6;'>Execution</td>
|
| 172 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6; color: #dc3545;'>❌ Advisory only</td>
|
| 173 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6; color: #28a745;'>✅ Autonomous</td>
|
| 174 |
-
</tr>
|
| 175 |
-
<tr>
|
| 176 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6;'>Learning</td>
|
| 177 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6; color: #dc3545;'>❌ None</td>
|
| 178 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6; color: #28a745;'>✅ Continuous</td>
|
| 179 |
-
</tr>
|
| 180 |
-
<tr>
|
| 181 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6;'>ROI Measurement</td>
|
| 182 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6; color: #dc3545;'>❌ No ROI</td>
|
| 183 |
-
<td style='padding: 10px; border-bottom: 1px solid #dee2e6; color: #28a745;'>✅ 5.2× average</td>
|
| 184 |
-
</tr>
|
| 185 |
-
<tr>
|
| 186 |
-
<td style='padding: 10px;'>Payback Period</td>
|
| 187 |
-
<td style='padding: 10px;'>N/A</td>
|
| 188 |
-
<td style='padding: 10px; color: #28a745;'>✅ 2-3 months</td>
|
| 189 |
-
</tr>
|
| 190 |
-
</tbody>
|
| 191 |
-
</table>
|
| 192 |
</div>
|
| 193 |
-
"""
|
| 194 |
-
return gr.HTML(value=html)
|
|
|
|
| 1 |
"""
|
| 2 |
+
UI components for the 5-tab demo
|
| 3 |
"""
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
+
from typing import Dict, List, Any, Optional, Tuple
|
| 7 |
+
import plotly.graph_objects as go
|
| 8 |
|
| 9 |
+
|
| 10 |
+
def create_header(oss_version: str, oss_available: bool) -> gr.Markdown:
|
| 11 |
+
"""Create the demo header"""
|
| 12 |
+
status_badge = "✅ Connected" if oss_available else "⚠️ Mock Mode"
|
| 13 |
|
| 14 |
+
return gr.Markdown(f"""
|
| 15 |
+
<div style="text-align: center; padding: 30px 20px 20px 20px; background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%); border-radius: 0 0 20px 20px; margin-bottom: 30px; border-bottom: 3px solid #4ECDC4;">
|
| 16 |
+
<h1 style="margin-bottom: 10px;">🚀 Agentic Reliability Framework</h1>
|
| 17 |
+
<h2 style="color: #4a5568; font-weight: 600; margin-bottom: 20px;">Investor Demo v3.8.0</h2>
|
| 18 |
+
|
| 19 |
+
<div style="display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 20px;">
|
| 20 |
+
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 8px 16px; border-radius: 20px; font-weight: 700; font-size: 0.85rem;">
|
| 21 |
+
🏢 Enterprise Edition
|
| 22 |
+
</div>
|
| 23 |
+
<div style="background: linear-gradient(135deg, #4299e1 0%, #38b2ac 100%); color: white; padding: 8px 16px; border-radius: 20px; font-weight: 700; font-size: 0.85rem;">
|
| 24 |
+
🆓 OSS v{oss_version}
|
| 25 |
+
</div>
|
| 26 |
+
<div style="background: #e8f5e8; color: #2d3748; padding: 8px 16px; border-radius: 20px; font-weight: 600; font-size: 0.85rem;">
|
| 27 |
+
📈 5.2× ROI
|
| 28 |
+
</div>
|
| 29 |
+
<div style="background: #fff3cd; color: #856404; padding: 8px 16px; border-radius: 20px; font-weight: 600; font-size: 0.85rem;">
|
| 30 |
+
⚡ 85% MTTR Reduction
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
<div style="color: #718096; font-size: 16px; max-width: 800px; margin: 0 auto; line-height: 1.6;">
|
| 35 |
+
From <span style="font-weight: 700; color: #4299e1;">OSS Advisory</span>
|
| 36 |
+
to <span style="font-weight: 700; color: #764ba2;">Enterprise Autonomous Healing</span>.
|
| 37 |
+
Experience the complete journey in 5 focused tabs.
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
<div style="margin-top: 15px; font-size: 0.9rem; color: #4ECDC4; font-weight: 600;">
|
| 41 |
+
{status_badge}
|
| 42 |
+
</div>
|
| 43 |
</div>
|
| 44 |
+
""")
|
|
|
|
| 45 |
|
| 46 |
+
|
| 47 |
+
def create_status_bar() -> gr.HTML:
|
| 48 |
+
"""Create system status bar"""
|
| 49 |
+
return gr.HTML("""
|
| 50 |
+
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px;">
|
| 51 |
+
<div style="background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-left: 4px solid #4ECDC4;">
|
| 52 |
+
<div style="font-size: 0.9rem; color: #718096; margin-bottom: 5px;">System Status</div>
|
| 53 |
+
<div style="display: flex; align-items: center; gap: 8px;">
|
| 54 |
+
<div style="width: 10px; height: 10px; background: #4ECDC4; border-radius: 50%;"></div>
|
| 55 |
+
<div style="font-weight: 700; color: #2d3748;">Operational</div>
|
| 56 |
+
</div>
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<div style="background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-left: 4px solid #FFA726;">
|
| 60 |
+
<div style="font-size: 0.9rem; color: #718096; margin-bottom: 5px;">Performance</div>
|
| 61 |
+
<div style="font-weight: 700; color: #2d3748; font-size: 1.1rem;">8.2 min avg resolution</div>
|
| 62 |
+
</div>
|
| 63 |
|
| 64 |
+
<div style="background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-left: 4px solid #42A5F5;">
|
| 65 |
+
<div style="font-size: 0.9rem; color: #718096; margin-bottom: 5px;">Learning Engine</div>
|
| 66 |
+
<div style="font-weight: 700; color: #2d3748; font-size: 1.1rem;">5 patterns detected</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
</div>
|
| 68 |
+
</div>
|
| 69 |
+
""")
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def create_tab1_incident_demo(scenarios: Dict, default_scenario: str = "Cache Miss Storm") -> Tuple:
|
| 73 |
+
"""Create Tab 1: Live Incident Demo"""
|
| 74 |
+
with gr.Row():
|
| 75 |
+
# Left Panel
|
| 76 |
+
with gr.Column(scale=1):
|
| 77 |
+
gr.Markdown("### 🎬 Select Incident Scenario")
|
| 78 |
+
|
| 79 |
+
scenario_dropdown = gr.Dropdown(
|
| 80 |
+
choices=list(scenarios.keys()),
|
| 81 |
+
value=default_scenario,
|
| 82 |
+
label="Choose an incident to analyze:",
|
| 83 |
+
interactive=True
|
| 84 |
+
)
|
| 85 |
+
|
| 86 |
+
scenario_description = gr.Markdown(
|
| 87 |
+
value=scenarios[default_scenario]["description"]
|
| 88 |
+
)
|
| 89 |
+
|
| 90 |
+
gr.Markdown("### 📊 Current Metrics")
|
| 91 |
+
metrics_display = gr.JSON(
|
| 92 |
+
value=scenarios[default_scenario].get("metrics", {}),
|
| 93 |
+
label="",
|
| 94 |
+
show_label=False
|
| 95 |
+
)
|
| 96 |
+
|
| 97 |
+
gr.Markdown("### 💰 Business Impact")
|
| 98 |
+
impact_display = gr.JSON(
|
| 99 |
+
value=scenarios[default_scenario].get("impact", {}),
|
| 100 |
+
label="",
|
| 101 |
+
show_label=False
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
# Right Panel
|
| 105 |
+
with gr.Column(scale=2):
|
| 106 |
+
gr.Markdown("### 📈 Incident Timeline")
|
| 107 |
+
timeline_output = gr.Plot(label="")
|
| 108 |
+
|
| 109 |
+
gr.Markdown("### ⚡ Take Action")
|
| 110 |
+
with gr.Row():
|
| 111 |
+
oss_btn = gr.Button(
|
| 112 |
+
"🆓 Run OSS Analysis",
|
| 113 |
+
variant="secondary",
|
| 114 |
+
size="lg",
|
| 115 |
+
min_width=150
|
| 116 |
+
)
|
| 117 |
+
enterprise_btn = gr.Button(
|
| 118 |
+
"🚀 Execute Enterprise Healing",
|
| 119 |
+
variant="primary",
|
| 120 |
+
size="lg",
|
| 121 |
+
min_width=150
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
with gr.Row():
|
| 125 |
+
approval_toggle = gr.Checkbox(
|
| 126 |
+
label="🔐 Require Manual Approval",
|
| 127 |
+
value=True,
|
| 128 |
+
interactive=True
|
| 129 |
+
)
|
| 130 |
+
demo_btn = gr.Button(
|
| 131 |
+
"⚡ Quick Demo",
|
| 132 |
+
variant="secondary",
|
| 133 |
+
size="sm"
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
approval_display = gr.HTML(
|
| 137 |
+
value="<div style='padding: 15px; background: #f8f9fa; border-radius: 8px; color: #6c757d;'>"
|
| 138 |
+
"Approval workflow will appear here after execution"
|
| 139 |
+
"</div>"
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
+
gr.Markdown("### ⚙️ Configuration")
|
| 143 |
+
config_display = gr.JSON(
|
| 144 |
+
value={"mode": "approval", "safety_guardrails": "active"},
|
| 145 |
+
label=""
|
| 146 |
+
)
|
| 147 |
+
|
| 148 |
+
gr.Markdown("### 🎯 Results")
|
| 149 |
+
results_display = gr.JSON(
|
| 150 |
+
value={"status": "Ready to analyze incident..."},
|
| 151 |
+
label=""
|
| 152 |
+
)
|
| 153 |
|
| 154 |
+
return (scenario_dropdown, scenario_description, metrics_display, impact_display,
|
| 155 |
+
timeline_output, oss_btn, enterprise_btn, approval_toggle, demo_btn,
|
| 156 |
+
approval_display, config_display, results_display)
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
def create_tab2_business_roi() -> Tuple:
|
| 160 |
+
"""Create Tab 2: Business Impact & ROI"""
|
| 161 |
+
with gr.Column():
|
| 162 |
+
gr.Markdown("### 📊 Executive Dashboard")
|
| 163 |
+
dashboard_output = gr.Plot(label="")
|
| 164 |
+
|
| 165 |
+
gr.Markdown("### 🧮 ROI Calculator")
|
| 166 |
+
with gr.Row():
|
| 167 |
+
with gr.Column(scale=1):
|
| 168 |
+
monthly_slider = gr.Slider(
|
| 169 |
+
1, 100, value=15, step=1,
|
| 170 |
+
label="Monthly incidents",
|
| 171 |
+
interactive=True
|
| 172 |
+
)
|
| 173 |
+
impact_slider = gr.Slider(
|
| 174 |
+
1000, 50000, value=8500, step=500,
|
| 175 |
+
label="Average cost per incident ($)",
|
| 176 |
+
interactive=True
|
| 177 |
+
)
|
| 178 |
+
team_slider = gr.Slider(
|
| 179 |
+
1, 20, value=5, step=1,
|
| 180 |
+
label="Reliability team size",
|
| 181 |
+
interactive=True
|
| 182 |
+
)
|
| 183 |
+
calculate_btn = gr.Button(
|
| 184 |
+
"Calculate My ROI",
|
| 185 |
+
variant="primary",
|
| 186 |
+
size="lg"
|
| 187 |
+
)
|
| 188 |
|
| 189 |
+
with gr.Column(scale=2):
|
| 190 |
+
roi_output = gr.JSON(
|
| 191 |
+
value={},
|
| 192 |
+
label="Your Analysis"
|
| 193 |
+
)
|
| 194 |
+
|
| 195 |
+
with gr.Row():
|
| 196 |
+
with gr.Column():
|
| 197 |
+
gr.Markdown("""
|
| 198 |
+
**📈 Industry Benchmarks**
|
| 199 |
+
- **5.2×** Average ROI (first year)
|
| 200 |
+
- **2-3 months** Payback period
|
| 201 |
+
- **81.7%** Auto-heal rate
|
| 202 |
+
- **85%** MTTR reduction
|
| 203 |
+
- **$6.2M** Average annual savings
|
| 204 |
+
""")
|
| 205 |
|
| 206 |
+
with gr.Column():
|
| 207 |
+
gr.Markdown("""
|
| 208 |
+
**🎯 Business Outcomes**
|
| 209 |
+
- **325+ hours** Engineer time reclaimed
|
| 210 |
+
- **99.9%** SLA compliance maintained
|
| 211 |
+
- **+40%** Customer satisfaction
|
| 212 |
+
- **60%** Increased innovation capacity
|
| 213 |
+
- **Zero** Audit findings
|
| 214 |
+
""")
|
| 215 |
+
|
| 216 |
+
return (dashboard_output, monthly_slider, impact_slider, team_slider,
|
| 217 |
+
calculate_btn, roi_output)
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
def create_tab3_audit_trail() -> Tuple:
|
| 221 |
+
"""Create Tab 3: Audit Trail & History"""
|
| 222 |
+
with gr.Row():
|
| 223 |
+
# Left Column
|
| 224 |
+
with gr.Column(scale=1):
|
| 225 |
+
gr.Markdown("### 📋 Execution History")
|
| 226 |
+
|
| 227 |
+
with gr.Row():
|
| 228 |
+
refresh_btn = gr.Button("🔄 Refresh", variant="secondary", size="sm")
|
| 229 |
+
clear_btn = gr.Button("🗑️ Clear", variant="stop", size="sm")
|
| 230 |
+
export_btn = gr.Button("📥 Export", variant="secondary", size="sm")
|
| 231 |
+
|
| 232 |
+
execution_table = gr.Dataframe(
|
| 233 |
+
headers=["Time", "Scenario", "Actions", "Status", "Savings", "Details"],
|
| 234 |
+
value=[],
|
| 235 |
+
label="",
|
| 236 |
+
interactive=False
|
| 237 |
+
)
|
| 238 |
+
|
| 239 |
+
gr.Markdown("### 📈 Cost Savings")
|
| 240 |
+
savings_chart = gr.Plot(label="")
|
| 241 |
+
|
| 242 |
+
# Right Column
|
| 243 |
+
with gr.Column(scale=1):
|
| 244 |
+
gr.Markdown("### 📊 Incident History")
|
| 245 |
+
|
| 246 |
+
incident_table = gr.Dataframe(
|
| 247 |
+
headers=["Time", "Service", "Type", "Severity", "Description"],
|
| 248 |
+
value=[],
|
| 249 |
+
label="",
|
| 250 |
+
interactive=False
|
| 251 |
+
)
|
| 252 |
+
|
| 253 |
+
gr.Markdown("### 🧠 Memory Graph")
|
| 254 |
+
memory_graph = gr.Plot(label="")
|
| 255 |
+
|
| 256 |
+
gr.Markdown("### 📤 Export")
|
| 257 |
+
export_text = gr.Textbox(
|
| 258 |
+
label="Audit Trail (JSON)",
|
| 259 |
+
lines=6,
|
| 260 |
+
interactive=False
|
| 261 |
+
)
|
| 262 |
+
|
| 263 |
+
return (refresh_btn, clear_btn, export_btn, execution_table, savings_chart,
|
| 264 |
+
incident_table, memory_graph, export_text)
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
def create_tab4_enterprise_features() -> Tuple:
|
| 268 |
+
"""Create Tab 4: Enterprise Features"""
|
| 269 |
+
with gr.Row():
|
| 270 |
+
# Left Column
|
| 271 |
+
with gr.Column(scale=1):
|
| 272 |
+
gr.Markdown("### 🔐 License Management")
|
| 273 |
+
|
| 274 |
+
license_display = gr.JSON(
|
| 275 |
+
value={},
|
| 276 |
+
label="Current License"
|
| 277 |
+
)
|
| 278 |
+
|
| 279 |
+
with gr.Row():
|
| 280 |
+
validate_btn = gr.Button("🔍 Validate", variant="secondary")
|
| 281 |
+
trial_btn = gr.Button("🆓 Start Trial", variant="primary")
|
| 282 |
+
upgrade_btn = gr.Button("🚀 Upgrade", variant="secondary")
|
| 283 |
+
|
| 284 |
+
gr.Markdown("### ⚡ Feature Comparison")
|
| 285 |
+
|
| 286 |
+
features_table = gr.Dataframe(
|
| 287 |
+
headers=["Feature", "OSS", "Starter", "Enterprise"],
|
| 288 |
+
value=[
|
| 289 |
+
["Autonomous Healing", "❌", "✅ Auto", "✅ AI-Driven"],
|
| 290 |
+
["Compliance Automation", "❌", "✅", "✅ SOC2/GDPR"],
|
| 291 |
+
["Predictive Analytics", "❌", "Basic", "✅ ML-Powered"],
|
| 292 |
+
["Multi-Cloud Support", "❌", "❌", "✅ Native"],
|
| 293 |
+
["Audit Trail", "Basic", "✅", "✅ Comprehensive"],
|
| 294 |
+
["Role-Based Access", "❌", "✅", "✅ Granular"],
|
| 295 |
+
],
|
| 296 |
+
label="",
|
| 297 |
+
interactive=False
|
| 298 |
+
)
|
| 299 |
+
|
| 300 |
+
# Right Column
|
| 301 |
+
with gr.Column(scale=1):
|
| 302 |
+
gr.Markdown("### 📋 Compliance")
|
| 303 |
+
|
| 304 |
+
compliance_display = gr.JSON(
|
| 305 |
+
value={
|
| 306 |
+
"SOC2": "✅ Certified",
|
| 307 |
+
"GDPR": "✅ Compliant",
|
| 308 |
+
"ISO27001": "✅ Certified",
|
| 309 |
+
"CCPA": "✅ Compliant"
|
| 310 |
+
},
|
| 311 |
+
label="Certifications"
|
| 312 |
+
)
|
| 313 |
+
|
| 314 |
+
gr.Markdown("### 🔗 Integrations")
|
| 315 |
+
|
| 316 |
+
integrations_table = gr.Dataframe(
|
| 317 |
+
headers=["Platform", "Status", "Last Sync"],
|
| 318 |
+
value=[
|
| 319 |
+
["AWS", "✅ Connected", "5 min ago"],
|
| 320 |
+
["Azure", "✅ Connected", "8 min ago"],
|
| 321 |
+
["GCP", "✅ Connected", "3 min ago"],
|
| 322 |
+
["Datadog", "✅ Connected", "Active"],
|
| 323 |
+
["PagerDuty", "✅ Connected", "Active"],
|
| 324 |
+
["ServiceNow", "✅ Connected", "15 min ago"],
|
| 325 |
+
],
|
| 326 |
+
label="",
|
| 327 |
+
interactive=False
|
| 328 |
+
)
|
| 329 |
+
|
| 330 |
+
gr.Markdown("### ⚙️ MCP Mode")
|
| 331 |
+
mcp_mode = gr.Radio(
|
| 332 |
+
choices=["advisory", "approval", "autonomous"],
|
| 333 |
+
value="approval",
|
| 334 |
+
label="Execution Mode",
|
| 335 |
+
interactive=True
|
| 336 |
+
)
|
| 337 |
+
|
| 338 |
+
return (license_display, validate_btn, trial_btn, upgrade_btn, features_table,
|
| 339 |
+
compliance_display, integrations_table, mcp_mode)
|
| 340 |
+
|
| 341 |
+
|
| 342 |
+
def create_tab5_learning_engine() -> Tuple:
|
| 343 |
+
"""Create Tab 5: Learning Engine"""
|
| 344 |
+
with gr.Row():
|
| 345 |
+
# Left Column
|
| 346 |
+
with gr.Column(scale=2):
|
| 347 |
+
gr.Markdown("### 🧠 Incident Memory Graph")
|
| 348 |
+
|
| 349 |
+
learning_graph = gr.Plot(label="")
|
| 350 |
+
|
| 351 |
+
with gr.Row():
|
| 352 |
+
graph_type = gr.Radio(
|
| 353 |
+
choices=["Force", "Hierarchical", "Circular"],
|
| 354 |
+
value="Force",
|
| 355 |
+
label="Layout",
|
| 356 |
+
interactive=True
|
| 357 |
+
)
|
| 358 |
+
show_labels = gr.Checkbox(label="Show Labels", value=True, interactive=True)
|
| 359 |
+
|
| 360 |
+
gr.Markdown("### 🔍 Similarity Search")
|
| 361 |
+
|
| 362 |
+
search_query = gr.Textbox(
|
| 363 |
+
label="Describe incident or paste metrics",
|
| 364 |
+
placeholder="e.g., 'Redis cache miss causing database overload'",
|
| 365 |
+
lines=2,
|
| 366 |
+
interactive=True
|
| 367 |
+
)
|
| 368 |
+
|
| 369 |
+
with gr.Row():
|
| 370 |
+
search_btn = gr.Button("🔍 Search", variant="primary")
|
| 371 |
+
clear_btn = gr.Button("Clear", variant="secondary")
|
| 372 |
+
|
| 373 |
+
search_results = gr.Dataframe(
|
| 374 |
+
headers=["Incident", "Similarity", "Resolution", "Actions"],
|
| 375 |
+
value=[],
|
| 376 |
+
label="",
|
| 377 |
+
interactive=False
|
| 378 |
+
)
|
| 379 |
+
|
| 380 |
+
# Right Column
|
| 381 |
+
with gr.Column(scale=1):
|
| 382 |
+
gr.Markdown("### 📊 Learning Stats")
|
| 383 |
+
|
| 384 |
+
stats_display = gr.JSON(
|
| 385 |
+
value={
|
| 386 |
+
"total_incidents": 0,
|
| 387 |
+
"patterns_detected": 0,
|
| 388 |
+
"similarity_searches": 0,
|
| 389 |
+
"confidence_threshold": 0.85
|
| 390 |
+
},
|
| 391 |
+
label="Statistics"
|
| 392 |
+
)
|
| 393 |
+
|
| 394 |
+
gr.Markdown("### 🎯 Pattern Detection")
|
| 395 |
+
|
| 396 |
+
patterns_display = gr.JSON(
|
| 397 |
+
value={},
|
| 398 |
+
label="Detected Patterns"
|
| 399 |
+
)
|
| 400 |
+
|
| 401 |
+
gr.Markdown("### 📈 Performance")
|
| 402 |
+
|
| 403 |
+
performance_display = gr.JSON(
|
| 404 |
+
value={
|
| 405 |
+
"avg_resolution_time": "0 min",
|
| 406 |
+
"success_rate": "0%",
|
| 407 |
+
"auto_heal_rate": "0%"
|
| 408 |
+
},
|
| 409 |
+
label="Performance Metrics"
|
| 410 |
+
)
|
| 411 |
+
|
| 412 |
+
return (learning_graph, graph_type, show_labels, search_query, search_btn,
|
| 413 |
+
clear_btn, search_results, stats_display, patterns_display, performance_display)
|
| 414 |
+
|
| 415 |
+
|
| 416 |
+
def create_footer() -> gr.Markdown:
|
| 417 |
+
"""Create the demo footer"""
|
| 418 |
+
return gr.Markdown("""
|
| 419 |
+
<div style="margin-top: 40px; padding: 30px; background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%); border-radius: 20px; color: white;">
|
| 420 |
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 30px;">
|
| 421 |
+
<div>
|
| 422 |
+
<h4 style="color: white; margin-bottom: 15px;">🚀 User Journey</h4>
|
| 423 |
+
<ol style="color: #cbd5e0; padding-left: 20px;">
|
| 424 |
+
<li style="margin-bottom: 8px;">Start with OSS Analysis</li>
|
| 425 |
+
<li style="margin-bottom: 8px;">Calculate Your ROI</li>
|
| 426 |
+
<li style="margin-bottom: 8px;">Execute Enterprise Healing</li>
|
| 427 |
+
<li style="margin-bottom: 8px;">Explore Audit Trail</li>
|
| 428 |
+
<li>Discover Learning Engine</li>
|
| 429 |
+
</ol>
|
| 430 |
</div>
|
| 431 |
|
| 432 |
+
<div>
|
| 433 |
+
<h4 style="color: white; margin-bottom: 15px;">📞 Get Started</h4>
|
| 434 |
+
<ul style="color: #cbd5e0; list-style: none; padding: 0;">
|
| 435 |
+
<li style="margin-bottom: 8px;">📧 sales@arfinvestor.com</li>
|
| 436 |
+
<li style="margin-bottom: 8px;">📚 docs.arfinvestor.com</li>
|
| 437 |
+
<li style="margin-bottom: 8px;">💬 Join Slack Community</li>
|
| 438 |
+
<li>🆓 30-Day Enterprise Trial</li>
|
| 439 |
+
</ul>
|
| 440 |
</div>
|
| 441 |
|
| 442 |
+
<div>
|
| 443 |
+
<h4 style="color: white; margin-bottom: 15px;">🛡️ Enterprise Grade</h4>
|
| 444 |
+
<ul style="color: #cbd5e0; list-style: none; padding: 0;">
|
| 445 |
+
<li style="margin-bottom: 8px;">✅ SOC 2 Type II</li>
|
| 446 |
+
<li style="margin-bottom: 8px;">✅ GDPR & CCPA</li>
|
| 447 |
+
<li style="margin-bottom: 8px;">✅ ISO 27001</li>
|
| 448 |
+
<li>✅ HIPAA Ready</li>
|
| 449 |
+
</ul>
|
| 450 |
</div>
|
| 451 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 452 |
|
| 453 |
+
<div style="border-top: 1px solid #4a5568; padding-top: 20px; text-align: center; color: #a0aec0; font-size: 0.9rem;">
|
| 454 |
+
<p style="margin: 0;">© 2024 Agentic Reliability Framework. Demo v3.8.0 Enterprise Edition.</p>
|
| 455 |
+
<p style="margin: 10px 0 0 0; font-size: 0.8rem;">This demonstration showcases capabilities. Actual results may vary.</p>
|
| 456 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
</div>
|
| 458 |
+
""")
|
|
|