Update app.py
Browse files
app.py
CHANGED
|
@@ -1229,7 +1229,7 @@ class ARFUltimateInvestorDemo:
|
|
| 1229 |
}
|
| 1230 |
"""
|
| 1231 |
|
| 1232 |
-
with gr.Blocks(
|
| 1233 |
|
| 1234 |
# ============ HEADER ============
|
| 1235 |
with gr.Column(elem_classes="dashboard-header"):
|
|
@@ -1340,13 +1340,14 @@ class ARFUltimateInvestorDemo:
|
|
| 1340 |
refresh_history_btn = gr.Button("π Refresh History", variant="secondary", size="sm")
|
| 1341 |
clear_history_btn = gr.Button("ποΈ Clear History", variant="stop", size="sm")
|
| 1342 |
|
|
|
|
| 1343 |
incident_history_table = gr.Dataframe(
|
| 1344 |
label="Incident Log",
|
| 1345 |
headers=["Time", "Service", "Type", "Severity", "Description"],
|
| 1346 |
datatype=["str", "str", "str", "str", "str"],
|
| 1347 |
col_count=(5, "fixed"),
|
| 1348 |
-
|
| 1349 |
-
|
| 1350 |
)
|
| 1351 |
|
| 1352 |
gr.Markdown("### π Incident Timeline")
|
|
@@ -1360,13 +1361,14 @@ class ARFUltimateInvestorDemo:
|
|
| 1360 |
refresh_executions_btn = gr.Button("π Refresh Executions", variant="secondary", size="sm")
|
| 1361 |
export_audit_btn = gr.Button("π₯ Export Audit Trail", variant="secondary", size="sm")
|
| 1362 |
|
|
|
|
| 1363 |
execution_history_table = gr.Dataframe(
|
| 1364 |
label="Execution Audit Trail",
|
| 1365 |
headers=["Time", "Scenario", "Actions", "Status", "Time Saved", "Cost Saved"],
|
| 1366 |
datatype=["str", "str", "str", "str", "str", "str"],
|
| 1367 |
col_count=(6, "fixed"),
|
| 1368 |
-
|
| 1369 |
-
|
| 1370 |
)
|
| 1371 |
|
| 1372 |
gr.Markdown("### π Execution History Chart")
|
|
@@ -1844,11 +1846,49 @@ def main():
|
|
| 1844 |
app = ARFUltimateInvestorDemo()
|
| 1845 |
demo = app.create_demo_interface()
|
| 1846 |
|
|
|
|
| 1847 |
demo.launch(
|
| 1848 |
server_name="0.0.0.0",
|
| 1849 |
server_port=7860,
|
| 1850 |
share=False,
|
| 1851 |
-
debug=True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1852 |
)
|
| 1853 |
|
| 1854 |
if __name__ == "__main__":
|
|
|
|
| 1229 |
}
|
| 1230 |
"""
|
| 1231 |
|
| 1232 |
+
with gr.Blocks() as demo:
|
| 1233 |
|
| 1234 |
# ============ HEADER ============
|
| 1235 |
with gr.Column(elem_classes="dashboard-header"):
|
|
|
|
| 1340 |
refresh_history_btn = gr.Button("π Refresh History", variant="secondary", size="sm")
|
| 1341 |
clear_history_btn = gr.Button("ποΈ Clear History", variant="stop", size="sm")
|
| 1342 |
|
| 1343 |
+
# Fixed: Remove height parameter from Dataframe
|
| 1344 |
incident_history_table = gr.Dataframe(
|
| 1345 |
label="Incident Log",
|
| 1346 |
headers=["Time", "Service", "Type", "Severity", "Description"],
|
| 1347 |
datatype=["str", "str", "str", "str", "str"],
|
| 1348 |
col_count=(5, "fixed"),
|
| 1349 |
+
interactive=False,
|
| 1350 |
+
wrap=True
|
| 1351 |
)
|
| 1352 |
|
| 1353 |
gr.Markdown("### π Incident Timeline")
|
|
|
|
| 1361 |
refresh_executions_btn = gr.Button("π Refresh Executions", variant="secondary", size="sm")
|
| 1362 |
export_audit_btn = gr.Button("π₯ Export Audit Trail", variant="secondary", size="sm")
|
| 1363 |
|
| 1364 |
+
# Fixed: Remove height parameter from Dataframe
|
| 1365 |
execution_history_table = gr.Dataframe(
|
| 1366 |
label="Execution Audit Trail",
|
| 1367 |
headers=["Time", "Scenario", "Actions", "Status", "Time Saved", "Cost Saved"],
|
| 1368 |
datatype=["str", "str", "str", "str", "str", "str"],
|
| 1369 |
col_count=(6, "fixed"),
|
| 1370 |
+
interactive=False,
|
| 1371 |
+
wrap=True
|
| 1372 |
)
|
| 1373 |
|
| 1374 |
gr.Markdown("### π Execution History Chart")
|
|
|
|
| 1846 |
app = ARFUltimateInvestorDemo()
|
| 1847 |
demo = app.create_demo_interface()
|
| 1848 |
|
| 1849 |
+
# Apply CSS and theme through launch() instead
|
| 1850 |
demo.launch(
|
| 1851 |
server_name="0.0.0.0",
|
| 1852 |
server_port=7860,
|
| 1853 |
share=False,
|
| 1854 |
+
debug=True,
|
| 1855 |
+
css="""
|
| 1856 |
+
.gradio-container {
|
| 1857 |
+
max-width: 1400px !important;
|
| 1858 |
+
margin: 0 auto !important;
|
| 1859 |
+
}
|
| 1860 |
+
.dashboard-header {
|
| 1861 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 1862 |
+
padding: 2rem;
|
| 1863 |
+
border-radius: 10px;
|
| 1864 |
+
margin-bottom: 2rem;
|
| 1865 |
+
color: white;
|
| 1866 |
+
}
|
| 1867 |
+
.metric-card {
|
| 1868 |
+
background: white;
|
| 1869 |
+
padding: 1.5rem;
|
| 1870 |
+
border-radius: 10px;
|
| 1871 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
| 1872 |
+
margin-bottom: 1rem;
|
| 1873 |
+
border-left: 4px solid #667eea;
|
| 1874 |
+
}
|
| 1875 |
+
.enterprise-card {
|
| 1876 |
+
border-left: 4px solid #10b981;
|
| 1877 |
+
}
|
| 1878 |
+
.oss-card {
|
| 1879 |
+
border-left: 4px solid #f59e0b;
|
| 1880 |
+
}
|
| 1881 |
+
.history-card {
|
| 1882 |
+
border-left: 4px solid #3b82f6;
|
| 1883 |
+
}
|
| 1884 |
+
.success { color: #10b981; }
|
| 1885 |
+
.warning { color: #f59e0b; }
|
| 1886 |
+
.error { color: #ef4444; }
|
| 1887 |
+
.info { color: #3b82f6; }
|
| 1888 |
+
.demo-button {
|
| 1889 |
+
margin: 5px;
|
| 1890 |
+
}
|
| 1891 |
+
"""
|
| 1892 |
)
|
| 1893 |
|
| 1894 |
if __name__ == "__main__":
|