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.
This commit is contained in:
kalm
2025-02-17 21:35:50 -08:00
parent 3f8ec7e67a
commit 5fe2593287

View File

@@ -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()