Update app.py
Browse files
app.py
CHANGED
|
@@ -2080,8 +2080,7 @@ def create_enhanced_ui():
|
|
| 2080 |
if not allowed:
|
| 2081 |
logger.warning(f"Rate limit exceeded")
|
| 2082 |
metrics = business_metrics.get_metrics()
|
| 2083 |
-
return (
|
| 2084 |
-
rate_msg, {}, {}, gr.Dataframe(value=[]),
|
| 2085 |
metrics["total_incidents"],
|
| 2086 |
metrics["incidents_auto_healed"],
|
| 2087 |
metrics["auto_heal_rate"],
|
|
@@ -2101,8 +2100,7 @@ def create_enhanced_ui():
|
|
| 2101 |
error_msg = f"❌ Invalid input types: {str(e)}"
|
| 2102 |
logger.warning(error_msg)
|
| 2103 |
metrics = business_metrics.get_metrics()
|
| 2104 |
-
return (
|
| 2105 |
-
error_msg, {}, {}, gr.Dataframe(value=[]),
|
| 2106 |
metrics["total_incidents"],
|
| 2107 |
metrics["incidents_auto_healed"],
|
| 2108 |
metrics["auto_heal_rate"],
|
|
@@ -2118,8 +2116,7 @@ def create_enhanced_ui():
|
|
| 2118 |
if not is_valid:
|
| 2119 |
logger.warning(f"Invalid input: {error_msg}")
|
| 2120 |
metrics = business_metrics.get_metrics()
|
| 2121 |
-
return (
|
| 2122 |
-
error_msg, {}, {}, gr.Dataframe(value=[]),
|
| 2123 |
metrics["total_incidents"],
|
| 2124 |
metrics["incidents_auto_healed"],
|
| 2125 |
metrics["auto_heal_rate"],
|
|
@@ -2136,8 +2133,7 @@ def create_enhanced_ui():
|
|
| 2136 |
# Handle errors
|
| 2137 |
if 'error' in result:
|
| 2138 |
metrics = business_metrics.get_metrics()
|
| 2139 |
-
return (
|
| 2140 |
-
f"❌ {result['error']}", {}, {}, gr.Dataframe(value=[]),
|
| 2141 |
metrics["total_incidents"],
|
| 2142 |
metrics["incidents_auto_healed"],
|
| 2143 |
metrics["auto_heal_rate"],
|
|
@@ -2199,11 +2195,7 @@ def create_enhanced_ui():
|
|
| 2199 |
output_msg,
|
| 2200 |
agent_insights_data,
|
| 2201 |
predictive_insights_data,
|
| 2202 |
-
gr.
|
| 2203 |
-
headers=["Timestamp", "Component", "Latency", "Error Rate", "Throughput", "Severity", "Analysis"],
|
| 2204 |
-
value=table_data,
|
| 2205 |
-
wrap=True
|
| 2206 |
-
),
|
| 2207 |
metrics["total_incidents"],
|
| 2208 |
metrics["incidents_auto_healed"],
|
| 2209 |
metrics["auto_heal_rate"],
|
|
@@ -2216,8 +2208,7 @@ def create_enhanced_ui():
|
|
| 2216 |
error_msg = f"❌ Error processing event: {str(e)}"
|
| 2217 |
logger.error(error_msg, exc_info=True)
|
| 2218 |
metrics = business_metrics.get_metrics()
|
| 2219 |
-
return (
|
| 2220 |
-
error_msg, {}, {}, gr.Dataframe(value=[]),
|
| 2221 |
metrics["total_incidents"],
|
| 2222 |
metrics["incidents_auto_healed"],
|
| 2223 |
metrics["auto_heal_rate"],
|
|
|
|
| 2080 |
if not allowed:
|
| 2081 |
logger.warning(f"Rate limit exceeded")
|
| 2082 |
metrics = business_metrics.get_metrics()
|
| 2083 |
+
return (rate_msg, {}, {}, gr.update(value=[]),
|
|
|
|
| 2084 |
metrics["total_incidents"],
|
| 2085 |
metrics["incidents_auto_healed"],
|
| 2086 |
metrics["auto_heal_rate"],
|
|
|
|
| 2100 |
error_msg = f"❌ Invalid input types: {str(e)}"
|
| 2101 |
logger.warning(error_msg)
|
| 2102 |
metrics = business_metrics.get_metrics()
|
| 2103 |
+
return (error_msg, {}, {}, gr.update(value=[]),
|
|
|
|
| 2104 |
metrics["total_incidents"],
|
| 2105 |
metrics["incidents_auto_healed"],
|
| 2106 |
metrics["auto_heal_rate"],
|
|
|
|
| 2116 |
if not is_valid:
|
| 2117 |
logger.warning(f"Invalid input: {error_msg}")
|
| 2118 |
metrics = business_metrics.get_metrics()
|
| 2119 |
+
return (error_msg, {}, {}, gr.update(value=[]),
|
|
|
|
| 2120 |
metrics["total_incidents"],
|
| 2121 |
metrics["incidents_auto_healed"],
|
| 2122 |
metrics["auto_heal_rate"],
|
|
|
|
| 2133 |
# Handle errors
|
| 2134 |
if 'error' in result:
|
| 2135 |
metrics = business_metrics.get_metrics()
|
| 2136 |
+
return (f"❌ {result['error']}", {}, {}, gr.update(value=[]),
|
|
|
|
| 2137 |
metrics["total_incidents"],
|
| 2138 |
metrics["incidents_auto_healed"],
|
| 2139 |
metrics["auto_heal_rate"],
|
|
|
|
| 2195 |
output_msg,
|
| 2196 |
agent_insights_data,
|
| 2197 |
predictive_insights_data,
|
| 2198 |
+
gr.update(value=table_data),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2199 |
metrics["total_incidents"],
|
| 2200 |
metrics["incidents_auto_healed"],
|
| 2201 |
metrics["auto_heal_rate"],
|
|
|
|
| 2208 |
error_msg = f"❌ Error processing event: {str(e)}"
|
| 2209 |
logger.error(error_msg, exc_info=True)
|
| 2210 |
metrics = business_metrics.get_metrics()
|
| 2211 |
+
return (error_msg, {}, {}, gr.update(value=[]),
|
|
|
|
| 2212 |
metrics["total_incidents"],
|
| 2213 |
metrics["incidents_auto_healed"],
|
| 2214 |
metrics["auto_heal_rate"],
|