ソースを参照

explorer/site: display empty metrics instead of "metrics not available" message

This commit updates the explorer UI to show empty metrics when no metrics are available, replacing the previous behavior of displaying a "Gas consumption details are not available" message.
kalm 1 年間 前
コミット
5fe2593287

+ 2 - 2
script/research/blockchain-explorer/site/blueprints/explore.py

@@ -50,8 +50,8 @@ async def index():
     # Determine if metrics exist
     has_metrics = metric_stats and isinstance(metric_stats, list)
 
-    # Get the latest metric statistics or set to None if none are found
-    latest_metric_stats = metric_stats[-1] if has_metrics else None
+    # Get the latest metric statistics or return empty metrics
+    latest_metric_stats = metric_stats[-1] if has_metrics else [0] * 15
 
     # Retrieve the native contracts
     native_contracts = await rpc.get_native_contracts()