Update ui/components.py
Browse files- ui/components.py +117 -170
ui/components.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
UI components for the 5-tab demo
|
| 3 |
"""
|
| 4 |
|
| 5 |
import gradio as gr
|
|
@@ -8,7 +8,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"""
|
|
@@ -34,7 +34,6 @@ def create_header(oss_version: str, oss_available: bool) -> gr.Markdown:
|
|
| 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;">
|
|
@@ -45,7 +44,7 @@ def create_header(oss_version: str, oss_available: bool) -> gr.Markdown:
|
|
| 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;">
|
|
@@ -63,14 +62,14 @@ def create_status_bar() -> gr.HTML:
|
|
| 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;">
|
| 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):
|
|
@@ -96,7 +95,7 @@ def create_tab1_incident_demo(scenarios: Dict, default_scenario: str = "Cache Mi
|
|
| 96 |
|
| 97 |
gr.Markdown("### 💰 Business Impact")
|
| 98 |
impact_display = gr.JSON(
|
| 99 |
-
value=scenarios[default_scenario].get("
|
| 100 |
label="",
|
| 101 |
show_label=False
|
| 102 |
)
|
|
@@ -104,7 +103,7 @@ def create_tab1_incident_demo(scenarios: Dict, default_scenario: str = "Cache Mi
|
|
| 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():
|
|
@@ -112,13 +111,13 @@ def create_tab1_incident_demo(scenarios: Dict, default_scenario: str = "Cache Mi
|
|
| 112 |
"🆓 Run OSS Analysis",
|
| 113 |
variant="secondary",
|
| 114 |
size="lg",
|
| 115 |
-
|
| 116 |
)
|
| 117 |
enterprise_btn = gr.Button(
|
| 118 |
"🚀 Execute Enterprise Healing",
|
| 119 |
variant="primary",
|
| 120 |
size="lg",
|
| 121 |
-
|
| 122 |
)
|
| 123 |
|
| 124 |
with gr.Row():
|
|
@@ -139,204 +138,185 @@ def create_tab1_incident_demo(scenarios: Dict, default_scenario: str = "Cache Mi
|
|
| 139 |
"</div>"
|
| 140 |
)
|
| 141 |
|
| 142 |
-
gr.
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 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,
|
| 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 |
-
|
| 169 |
-
|
| 170 |
-
|
|
|
|
|
|
|
| 171 |
interactive=True
|
| 172 |
)
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
|
|
|
| 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
|
| 185 |
variant="primary",
|
| 186 |
size="lg"
|
| 187 |
)
|
| 188 |
|
| 189 |
with gr.Column(scale=2):
|
| 190 |
roi_output = gr.JSON(
|
| 191 |
-
|
| 192 |
-
|
| 193 |
)
|
| 194 |
-
|
| 195 |
-
|
| 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,
|
| 217 |
-
calculate_btn, roi_output)
|
| 218 |
|
| 219 |
|
| 220 |
-
def
|
| 221 |
-
"""Create Tab 3:
|
| 222 |
with gr.Row():
|
| 223 |
# Left Column
|
| 224 |
with gr.Column(scale=1):
|
| 225 |
-
gr.Markdown("###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
|
| 227 |
with gr.Row():
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
|
|
|
|
|
|
|
|
|
| 237 |
)
|
| 238 |
|
| 239 |
-
gr.
|
| 240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
|
| 242 |
# Right Column
|
| 243 |
with gr.Column(scale=1):
|
| 244 |
-
gr.Markdown("###
|
| 245 |
|
| 246 |
-
|
| 247 |
-
headers=["
|
| 248 |
-
value=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
label="",
|
| 250 |
interactive=False
|
| 251 |
)
|
| 252 |
|
| 253 |
-
gr.Markdown("###
|
| 254 |
-
memory_graph = gr.Plot(label="")
|
| 255 |
|
| 256 |
-
gr.
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
interactive=False
|
| 261 |
)
|
| 262 |
|
| 263 |
-
return (
|
| 264 |
-
|
| 265 |
|
| 266 |
|
| 267 |
-
def
|
| 268 |
-
"""Create Tab 4:
|
| 269 |
with gr.Row():
|
| 270 |
# Left Column
|
| 271 |
with gr.Column(scale=1):
|
| 272 |
-
gr.Markdown("###
|
| 273 |
-
|
| 274 |
-
license_display = gr.JSON(
|
| 275 |
-
value={},
|
| 276 |
-
label="Current License"
|
| 277 |
-
)
|
| 278 |
|
| 279 |
with gr.Row():
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
gr.Markdown("### ⚡ Feature Comparison")
|
| 285 |
|
| 286 |
-
|
| 287 |
-
headers=["
|
| 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("###
|
| 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 |
-
|
| 317 |
-
headers=["
|
| 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("###
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
interactive=True
|
| 336 |
)
|
| 337 |
|
| 338 |
-
return (
|
| 339 |
-
|
| 340 |
|
| 341 |
|
| 342 |
def create_tab5_learning_engine() -> Tuple:
|
|
@@ -346,7 +326,7 @@ def create_tab5_learning_engine() -> Tuple:
|
|
| 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(
|
|
@@ -414,42 +394,9 @@ def create_tab5_learning_engine() -> Tuple:
|
|
| 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>
|
|
|
|
| 1 |
"""
|
| 2 |
+
UI components for the 5-tab demo - FIXED VERSION
|
| 3 |
"""
|
| 4 |
|
| 5 |
import gradio as gr
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
def create_header(oss_version: str, oss_available: bool) -> gr.Markdown:
|
| 11 |
+
"""Create the demo header - FIXED VERSION"""
|
| 12 |
status_badge = "✅ Connected" if oss_available else "⚠️ Mock Mode"
|
| 13 |
|
| 14 |
return gr.Markdown(f"""
|
|
|
|
| 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 |
</div>
|
| 38 |
|
| 39 |
<div style="margin-top: 15px; font-size: 0.9rem; color: #4ECDC4; font-weight: 600;">
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
def create_status_bar() -> gr.HTML:
|
| 47 |
+
"""Create system status bar - FIXED VERSION"""
|
| 48 |
return gr.HTML("""
|
| 49 |
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px;">
|
| 50 |
<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;">
|
|
|
|
| 62 |
|
| 63 |
<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;">
|
| 64 |
<div style="font-size: 0.9rem; color: #718096; margin-bottom: 5px;">Learning Engine</div>
|
| 65 |
+
<div style="font-weight: 700; color: #2d3748; font-size: 1.1rem;">6 patterns detected</div>
|
| 66 |
</div>
|
| 67 |
</div>
|
| 68 |
""")
|
| 69 |
|
| 70 |
|
| 71 |
def create_tab1_incident_demo(scenarios: Dict, default_scenario: str = "Cache Miss Storm") -> Tuple:
|
| 72 |
+
"""Create Tab 1: Live Incident Demo - FIXED WORKING VERSION"""
|
| 73 |
with gr.Row():
|
| 74 |
# Left Panel
|
| 75 |
with gr.Column(scale=1):
|
|
|
|
| 95 |
|
| 96 |
gr.Markdown("### 💰 Business Impact")
|
| 97 |
impact_display = gr.JSON(
|
| 98 |
+
value=scenarios[default_scenario].get("business_impact", {}),
|
| 99 |
label="",
|
| 100 |
show_label=False
|
| 101 |
)
|
|
|
|
| 103 |
# Right Panel
|
| 104 |
with gr.Column(scale=2):
|
| 105 |
gr.Markdown("### 📈 Incident Timeline")
|
| 106 |
+
timeline_output = gr.Plot(label="", show_label=False)
|
| 107 |
|
| 108 |
gr.Markdown("### ⚡ Take Action")
|
| 109 |
with gr.Row():
|
|
|
|
| 111 |
"🆓 Run OSS Analysis",
|
| 112 |
variant="secondary",
|
| 113 |
size="lg",
|
| 114 |
+
elem_id="oss_btn"
|
| 115 |
)
|
| 116 |
enterprise_btn = gr.Button(
|
| 117 |
"🚀 Execute Enterprise Healing",
|
| 118 |
variant="primary",
|
| 119 |
size="lg",
|
| 120 |
+
elem_id="enterprise_btn"
|
| 121 |
)
|
| 122 |
|
| 123 |
with gr.Row():
|
|
|
|
| 138 |
"</div>"
|
| 139 |
)
|
| 140 |
|
| 141 |
+
with gr.Row():
|
| 142 |
+
with gr.Column():
|
| 143 |
+
gr.Markdown("### 📋 OSS Results")
|
| 144 |
+
oss_results_display = gr.JSON(label="", value={})
|
| 145 |
+
|
| 146 |
+
with gr.Column():
|
| 147 |
+
gr.Markdown("### 🎯 Enterprise Results")
|
| 148 |
+
enterprise_results_display = gr.JSON(label="", value={})
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
return (scenario_dropdown, scenario_description, metrics_display, impact_display,
|
| 151 |
timeline_output, oss_btn, enterprise_btn, approval_toggle, demo_btn,
|
| 152 |
+
approval_display, oss_results_display, enterprise_results_display)
|
| 153 |
|
| 154 |
|
| 155 |
def create_tab2_business_roi() -> Tuple:
|
| 156 |
+
"""Create Tab 2: Business Impact & ROI - FIXED VERSION"""
|
| 157 |
with gr.Column():
|
| 158 |
gr.Markdown("### 📊 Executive Dashboard")
|
| 159 |
+
dashboard_output = gr.Plot(label="", show_label=False)
|
| 160 |
|
| 161 |
gr.Markdown("### 🧮 ROI Calculator")
|
| 162 |
with gr.Row():
|
| 163 |
with gr.Column(scale=1):
|
| 164 |
+
# Scenario selector
|
| 165 |
+
roi_scenario_dropdown = gr.Dropdown(
|
| 166 |
+
choices=[],
|
| 167 |
+
value="",
|
| 168 |
+
label="Select scenario for ROI calculation:",
|
| 169 |
interactive=True
|
| 170 |
)
|
| 171 |
+
|
| 172 |
+
monthly_slider = gr.Slider(
|
| 173 |
+
1, 100, value=15, step=1,
|
| 174 |
+
label="Monthly similar incidents",
|
| 175 |
interactive=True
|
| 176 |
)
|
| 177 |
+
|
| 178 |
team_slider = gr.Slider(
|
| 179 |
1, 20, value=5, step=1,
|
| 180 |
label="Reliability team size",
|
| 181 |
interactive=True
|
| 182 |
)
|
| 183 |
+
|
| 184 |
calculate_btn = gr.Button(
|
| 185 |
+
"Calculate ROI",
|
| 186 |
variant="primary",
|
| 187 |
size="lg"
|
| 188 |
)
|
| 189 |
|
| 190 |
with gr.Column(scale=2):
|
| 191 |
roi_output = gr.JSON(
|
| 192 |
+
label="ROI Analysis Results",
|
| 193 |
+
value={}
|
| 194 |
)
|
| 195 |
+
|
| 196 |
+
roi_chart = gr.Plot(label="Cost Comparison", show_label=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
+
return (dashboard_output, roi_scenario_dropdown, monthly_slider, team_slider,
|
| 199 |
+
calculate_btn, roi_output, roi_chart)
|
| 200 |
|
| 201 |
|
| 202 |
+
def create_tab3_enterprise_features() -> Tuple:
|
| 203 |
+
"""Create Tab 3: Enterprise Features"""
|
| 204 |
with gr.Row():
|
| 205 |
# Left Column
|
| 206 |
with gr.Column(scale=1):
|
| 207 |
+
gr.Markdown("### 🔐 License Management")
|
| 208 |
+
|
| 209 |
+
license_display = gr.JSON(
|
| 210 |
+
value={
|
| 211 |
+
"status": "Active",
|
| 212 |
+
"tier": "Enterprise",
|
| 213 |
+
"expires": "2024-12-31",
|
| 214 |
+
"features": ["autonomous_healing", "compliance", "audit_trail"]
|
| 215 |
+
},
|
| 216 |
+
label="Current License"
|
| 217 |
+
)
|
| 218 |
|
| 219 |
with gr.Row():
|
| 220 |
+
validate_btn = gr.Button("🔍 Validate", variant="secondary")
|
| 221 |
+
trial_btn = gr.Button("🆓 Start Trial", variant="primary")
|
| 222 |
+
upgrade_btn = gr.Button("🚀 Upgrade", variant="secondary")
|
| 223 |
|
| 224 |
+
gr.Markdown("### ⚡ MCP Execution Modes")
|
| 225 |
+
|
| 226 |
+
mcp_mode = gr.Radio(
|
| 227 |
+
choices=["advisory", "approval", "autonomous"],
|
| 228 |
+
value="advisory",
|
| 229 |
+
label="Execution Mode",
|
| 230 |
+
interactive=True,
|
| 231 |
+
info="advisory = OSS only, approval = human review, autonomous = AI-driven"
|
| 232 |
)
|
| 233 |
|
| 234 |
+
mcp_mode_info = gr.JSON(
|
| 235 |
+
value={
|
| 236 |
+
"current_mode": "advisory",
|
| 237 |
+
"description": "OSS Edition - Analysis only, no execution",
|
| 238 |
+
"features": ["Incident analysis", "RAG similarity", "HealingIntent creation"]
|
| 239 |
+
},
|
| 240 |
+
label="Mode Details"
|
| 241 |
+
)
|
| 242 |
|
| 243 |
# Right Column
|
| 244 |
with gr.Column(scale=1):
|
| 245 |
+
gr.Markdown("### 📋 Feature Comparison")
|
| 246 |
|
| 247 |
+
features_table = gr.Dataframe(
|
| 248 |
+
headers=["Feature", "OSS", "Enterprise"],
|
| 249 |
+
value=[
|
| 250 |
+
["Autonomous Healing", "❌", "✅"],
|
| 251 |
+
["Compliance Automation", "❌", "✅"],
|
| 252 |
+
["Predictive Analytics", "❌", "✅"],
|
| 253 |
+
["Multi-Cloud Support", "❌", "✅"],
|
| 254 |
+
["Audit Trail", "Basic", "Comprehensive"],
|
| 255 |
+
["Role-Based Access", "❌", "✅"],
|
| 256 |
+
],
|
| 257 |
label="",
|
| 258 |
interactive=False
|
| 259 |
)
|
| 260 |
|
| 261 |
+
gr.Markdown("### 🔗 Integrations")
|
|
|
|
| 262 |
|
| 263 |
+
integrations_table = gr.Dataframe(
|
| 264 |
+
headers=["Platform", "Status"],
|
| 265 |
+
value=[
|
| 266 |
+
["AWS", "✅ Connected"],
|
| 267 |
+
["Azure", "✅ Connected"],
|
| 268 |
+
["GCP", "✅ Connected"],
|
| 269 |
+
["Datadog", "✅ Connected"],
|
| 270 |
+
["PagerDuty", "✅ Connected"],
|
| 271 |
+
["ServiceNow", "✅ Connected"],
|
| 272 |
+
],
|
| 273 |
+
label="",
|
| 274 |
interactive=False
|
| 275 |
)
|
| 276 |
|
| 277 |
+
return (license_display, validate_btn, trial_btn, upgrade_btn,
|
| 278 |
+
mcp_mode, mcp_mode_info, features_table, integrations_table)
|
| 279 |
|
| 280 |
|
| 281 |
+
def create_tab4_audit_trail() -> Tuple:
|
| 282 |
+
"""Create Tab 4: Audit Trail & History"""
|
| 283 |
with gr.Row():
|
| 284 |
# Left Column
|
| 285 |
with gr.Column(scale=1):
|
| 286 |
+
gr.Markdown("### 📋 Execution History")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
|
| 288 |
with gr.Row():
|
| 289 |
+
refresh_btn = gr.Button("🔄 Refresh", variant="secondary", size="sm")
|
| 290 |
+
clear_btn = gr.Button("🗑️ Clear", variant="stop", size="sm")
|
| 291 |
+
export_btn = gr.Button("📥 Export", variant="secondary", size="sm")
|
|
|
|
|
|
|
| 292 |
|
| 293 |
+
execution_table = gr.Dataframe(
|
| 294 |
+
headers=["Time", "Scenario", "Mode", "Status", "Savings", "Details"],
|
| 295 |
+
value=[],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 296 |
label="",
|
| 297 |
interactive=False
|
| 298 |
)
|
| 299 |
|
| 300 |
# Right Column
|
| 301 |
with gr.Column(scale=1):
|
| 302 |
+
gr.Markdown("### 📊 Incident History")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
|
| 304 |
+
incident_table = gr.Dataframe(
|
| 305 |
+
headers=["Time", "Component", "Scenario", "Severity", "Status"],
|
| 306 |
+
value=[],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
label="",
|
| 308 |
interactive=False
|
| 309 |
)
|
| 310 |
|
| 311 |
+
gr.Markdown("### 📤 Export")
|
| 312 |
+
export_text = gr.Textbox(
|
| 313 |
+
label="Audit Trail (JSON)",
|
| 314 |
+
lines=6,
|
| 315 |
+
interactive=False
|
|
|
|
| 316 |
)
|
| 317 |
|
| 318 |
+
return (refresh_btn, clear_btn, export_btn, execution_table,
|
| 319 |
+
incident_table, export_text)
|
| 320 |
|
| 321 |
|
| 322 |
def create_tab5_learning_engine() -> Tuple:
|
|
|
|
| 326 |
with gr.Column(scale=2):
|
| 327 |
gr.Markdown("### 🧠 Incident Memory Graph")
|
| 328 |
|
| 329 |
+
learning_graph = gr.Plot(label="", show_label=False)
|
| 330 |
|
| 331 |
with gr.Row():
|
| 332 |
graph_type = gr.Radio(
|
|
|
|
| 394 |
|
| 395 |
|
| 396 |
def create_footer() -> gr.Markdown:
|
| 397 |
+
"""Create the demo footer - SIMPLIFIED VERSION"""
|
| 398 |
return gr.Markdown("""
|
| 399 |
<div style="margin-top: 40px; padding: 30px; background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%); border-radius: 20px; color: white;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 400 |
<div style="border-top: 1px solid #4a5568; padding-top: 20px; text-align: center; color: #a0aec0; font-size: 0.9rem;">
|
| 401 |
<p style="margin: 0;">© 2024 Agentic Reliability Framework. Demo v3.8.0 Enterprise Edition.</p>
|
| 402 |
<p style="margin: 10px 0 0 0; font-size: 0.8rem;">This demonstration showcases capabilities. Actual results may vary.</p>
|