mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-13 09:11:19 +00:00
fix: stop the analytics dashboard spinning when a custom range has no dates
This commit is contained in:
parent
8dbbc206c5
commit
254e464b97
2 changed files with 11 additions and 3 deletions
|
|
@ -160,9 +160,12 @@
|
|||
loading = false;
|
||||
};
|
||||
|
||||
$: awaitingCustomRange = selectedPeriod === 'custom' && !(customStart && customEnd);
|
||||
|
||||
// Reload when the period, group, or custom range changes.
|
||||
// In custom mode, wait until both dates are set to avoid a half-specified query.
|
||||
$: if (selectedPeriod === 'custom' ? customStart && customEnd : selectedPeriod) {
|
||||
$: if (awaitingCustomRange) {
|
||||
loading = false;
|
||||
} else if (selectedPeriod) {
|
||||
// reference customStart/customEnd so this block reruns when they change
|
||||
customStart;
|
||||
customEnd;
|
||||
|
|
@ -281,7 +284,7 @@
|
|||
/>
|
||||
|
||||
<!-- Summary stats -->
|
||||
{#if !loading}
|
||||
{#if !loading && !awaitingCustomRange}
|
||||
<div class="flex gap-3 text-xs text-gray-500 dark:text-gray-400 px-0.5 pb-2">
|
||||
<span
|
||||
><span class="font-normal text-gray-900 dark:text-gray-300"
|
||||
|
|
@ -343,6 +346,10 @@
|
|||
<div class="my-10 flex justify-center">
|
||||
<Spinner className="size-5" />
|
||||
</div>
|
||||
{:else if awaitingCustomRange}
|
||||
<div class="my-10 text-center text-xs text-gray-500 dark:text-gray-400">
|
||||
{$i18n.t('Select a start and end date to view analytics.')}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="grid md:grid-cols-2 gap-4">
|
||||
<!-- Model Usage Table -->
|
||||
|
|
|
|||
|
|
@ -2343,6 +2343,7 @@
|
|||
"Select a pipeline url": "",
|
||||
"Select a reranking model engine": "",
|
||||
"Select a role": "",
|
||||
"Select a start and end date to view analytics.": "",
|
||||
"Select a theme": "",
|
||||
"Select a tool": "",
|
||||
"Select a voice": "",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue