Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
"""
|
| 2 |
π ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION
|
| 3 |
MODULAR VERSION - Properly integrated with all components
|
| 4 |
-
|
| 5 |
"""
|
| 6 |
|
| 7 |
import logging
|
|
@@ -182,10 +182,10 @@ def create_demo_interface():
|
|
| 182 |
INCIDENT_SCENARIOS, "Cache Miss Storm"
|
| 183 |
)
|
| 184 |
|
| 185 |
-
# TAB 2: Business Impact & ROI
|
| 186 |
with gr.TabItem("π° Business Impact & ROI", id="tab2"):
|
| 187 |
(dashboard_output, roi_scenario_dropdown, monthly_slider, team_slider,
|
| 188 |
-
calculate_btn, roi_output, roi_chart) = create_tab2_business_roi()
|
| 189 |
|
| 190 |
# TAB 3: Enterprise Features
|
| 191 |
with gr.TabItem("π’ Enterprise Features", id="tab3"):
|
|
@@ -370,6 +370,101 @@ def create_demo_interface():
|
|
| 370 |
outputs=[execution_table, incident_table]
|
| 371 |
)
|
| 372 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 373 |
# Initialize ROI scenario dropdown
|
| 374 |
demo.load(
|
| 375 |
fn=update_roi_scenario_dropdown,
|
|
@@ -396,6 +491,7 @@ def main():
|
|
| 396 |
print(" β’ Modular Architecture")
|
| 397 |
print(" β’ Working Button Handlers")
|
| 398 |
print(" β’ 5 Functional Tabs")
|
|
|
|
| 399 |
print("=" * 70)
|
| 400 |
|
| 401 |
demo = create_demo_interface()
|
|
|
|
| 1 |
"""
|
| 2 |
π ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION
|
| 3 |
MODULAR VERSION - Properly integrated with all components
|
| 4 |
+
COMPLETE FIXED VERSION: All issues resolved
|
| 5 |
"""
|
| 6 |
|
| 7 |
import logging
|
|
|
|
| 182 |
INCIDENT_SCENARIOS, "Cache Miss Storm"
|
| 183 |
)
|
| 184 |
|
| 185 |
+
# TAB 2: Business Impact & ROI - FIXED: Pass scenarios parameter
|
| 186 |
with gr.TabItem("π° Business Impact & ROI", id="tab2"):
|
| 187 |
(dashboard_output, roi_scenario_dropdown, monthly_slider, team_slider,
|
| 188 |
+
calculate_btn, roi_output, roi_chart) = create_tab2_business_roi(INCIDENT_SCENARIOS)
|
| 189 |
|
| 190 |
# TAB 3: Enterprise Features
|
| 191 |
with gr.TabItem("π’ Enterprise Features", id="tab3"):
|
|
|
|
| 370 |
outputs=[execution_table, incident_table]
|
| 371 |
)
|
| 372 |
|
| 373 |
+
# Tab 3 Button Handlers
|
| 374 |
+
def validate_license():
|
| 375 |
+
return {
|
| 376 |
+
"status": "β
Valid",
|
| 377 |
+
"tier": "Enterprise",
|
| 378 |
+
"expires": "2026-12-31",
|
| 379 |
+
"message": "License validated successfully",
|
| 380 |
+
"next_renewal": "2026-06-30",
|
| 381 |
+
"features": ["autonomous_healing", "compliance", "audit_trail",
|
| 382 |
+
"predictive_analytics", "multi_cloud", "role_based_access"]
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
def start_trial():
|
| 386 |
+
return {
|
| 387 |
+
"status": "π Trial Activated",
|
| 388 |
+
"tier": "Enterprise Trial",
|
| 389 |
+
"expires": "2026-01-30",
|
| 390 |
+
"features": ["autonomous_healing", "compliance", "audit_trail",
|
| 391 |
+
"predictive_analytics", "multi_cloud"],
|
| 392 |
+
"message": "30-day trial started. Full features enabled."
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
def upgrade_license():
|
| 396 |
+
return {
|
| 397 |
+
"status": "π Upgrade Available",
|
| 398 |
+
"current_tier": "Enterprise",
|
| 399 |
+
"next_tier": "Enterprise Plus",
|
| 400 |
+
"features_added": ["predictive_scaling", "custom_workflows", "advanced_analytics"],
|
| 401 |
+
"cost": "$25,000/year",
|
| 402 |
+
"message": "Contact sales@arf.dev for upgrade"
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
# Connect Tab 3 buttons
|
| 406 |
+
validate_btn.click(
|
| 407 |
+
fn=validate_license,
|
| 408 |
+
outputs=[license_display]
|
| 409 |
+
)
|
| 410 |
+
|
| 411 |
+
trial_btn.click(
|
| 412 |
+
fn=start_trial,
|
| 413 |
+
outputs=[license_display]
|
| 414 |
+
)
|
| 415 |
+
|
| 416 |
+
upgrade_btn.click(
|
| 417 |
+
fn=upgrade_license,
|
| 418 |
+
outputs=[license_display]
|
| 419 |
+
)
|
| 420 |
+
|
| 421 |
+
# MCP Mode change handler
|
| 422 |
+
def update_mcp_mode(mode):
|
| 423 |
+
mode_info = {
|
| 424 |
+
"advisory": {
|
| 425 |
+
"current_mode": "advisory",
|
| 426 |
+
"description": "OSS Edition - Analysis only, no execution",
|
| 427 |
+
"features": ["Incident analysis", "RAG similarity", "HealingIntent creation"]
|
| 428 |
+
},
|
| 429 |
+
"approval": {
|
| 430 |
+
"current_mode": "approval",
|
| 431 |
+
"description": "Enterprise Edition - Human approval required",
|
| 432 |
+
"features": ["All OSS features", "Approval workflows", "Audit trail", "Compliance"]
|
| 433 |
+
},
|
| 434 |
+
"autonomous": {
|
| 435 |
+
"current_mode": "autonomous",
|
| 436 |
+
"description": "Enterprise Plus - Fully autonomous healing",
|
| 437 |
+
"features": ["All approval features", "Auto-execution", "Predictive healing", "ML optimization"]
|
| 438 |
+
}
|
| 439 |
+
}
|
| 440 |
+
return mode_info.get(mode, mode_info["advisory"])
|
| 441 |
+
|
| 442 |
+
mcp_mode.change(
|
| 443 |
+
fn=update_mcp_mode,
|
| 444 |
+
inputs=[mcp_mode],
|
| 445 |
+
outputs=[mcp_mode_info]
|
| 446 |
+
)
|
| 447 |
+
|
| 448 |
+
# Export Audit Trail
|
| 449 |
+
def export_audit_trail():
|
| 450 |
+
audit_data = {
|
| 451 |
+
"exported_at": datetime.datetime.now().isoformat(),
|
| 452 |
+
"executions": audit_manager.executions[:10],
|
| 453 |
+
"incidents": audit_manager.incidents[:15],
|
| 454 |
+
"summary": {
|
| 455 |
+
"total_executions": len(audit_manager.executions),
|
| 456 |
+
"total_incidents": len(audit_manager.incidents),
|
| 457 |
+
"total_savings": f"${sum(int(e['savings'].replace('$', '').replace(',', '')) for e in audit_manager.executions if e['savings'] != '$0'):,}",
|
| 458 |
+
"success_rate": f"{len([e for e in audit_manager.executions if 'β
' in e['status']]) / max(len(audit_manager.executions), 1) * 100:.1f}%"
|
| 459 |
+
}
|
| 460 |
+
}
|
| 461 |
+
return json.dumps(audit_data, indent=2)
|
| 462 |
+
|
| 463 |
+
export_btn.click(
|
| 464 |
+
fn=export_audit_trail,
|
| 465 |
+
outputs=[export_text]
|
| 466 |
+
)
|
| 467 |
+
|
| 468 |
# Initialize ROI scenario dropdown
|
| 469 |
demo.load(
|
| 470 |
fn=update_roi_scenario_dropdown,
|
|
|
|
| 491 |
print(" β’ Modular Architecture")
|
| 492 |
print(" β’ Working Button Handlers")
|
| 493 |
print(" β’ 5 Functional Tabs")
|
| 494 |
+
print(" β’ Full Demo Data")
|
| 495 |
print("=" * 70)
|
| 496 |
|
| 497 |
demo = create_demo_interface()
|