feat: enhance error handling in statistics retrieval by providing detailed messages for missing current and historical data, improving user feedback and experience
This commit is contained in:
@@ -1738,7 +1738,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($historicalComparison)
|
||||
@if($historicalComparison && !isset($historicalComparison['error']))
|
||||
<template id="historical-comparison-export" type="application/json" data-historical-comparison-export>
|
||||
@json($this->historicalComparisonExportData ?? [])
|
||||
</template>
|
||||
@@ -1900,6 +1900,29 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@elseif($historicalComparison && isset($historicalComparison['error']))
|
||||
<div class="p-6">
|
||||
<div class="p-4 bg-warning/10 border border-warning/30 rounded-lg">
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="p-2 bg-warning/20 rounded-full flex-shrink-0">
|
||||
<x-ri-error-warning-line class="size-5 text-warning" />
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-semibold text-warning mb-1">{{ $historicalComparison['message'] }}</p>
|
||||
@if(isset($historicalComparison['total_stats']))
|
||||
<p class="text-xs text-warning/70">
|
||||
Total statistics in database: {{ $historicalComparison['total_stats'] }}
|
||||
@if($historicalComparison['total_stats'] == 0)
|
||||
- Statistics are collected automatically every hour. You can also create manual statistics using the "Create Statistics" button above.
|
||||
@elseif($historicalComparison['total_stats'] < 2)
|
||||
- At least 2 statistics are needed for comparison. Wait for more data to be collected or create a manual statistic.
|
||||
@endif
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center py-8">
|
||||
<div class="flex flex-col items-center gap-2">
|
||||
|
||||
Reference in New Issue
Block a user