Skip to content

Commit

Permalink
fix: displaying loading screen properly
Browse files Browse the repository at this point in the history
  • Loading branch information
axel7083 committed Jan 15, 2024
1 parent 0c7913a commit 4d1a5e7
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions packages/frontend/src/pages/Models.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function filterModels(): void {
if(currentValue.state === 'success')
return previousValue;
if(currentValue.labels) {
previousValue.push(currentValue.labels["model-pulling"])
if(currentValue.labels !== undefined) {
previousValue.push(currentValue.labels["model-pulling"]);
}
return previousValue;
}, [] as string[]);
Expand Down Expand Up @@ -80,25 +80,27 @@ onDestroy(() => {
<LinearProgress/>
{/if}
<div class="mt-4 px-5 space-y-5 h-full">
{#if tasks.length > 0}
<div class="mx-4">
<Card classes="bg-charcoal-800 mt-4">
<div slot="content" class="text-base font-normal p-2">
<div class="text-base mb-2">Downloading models</div>
<TasksProgress tasks="{tasks}"/>
</div>
</Card>
</div>
{/if}
{#if filteredModels.length > 0}
<Table
kind="model"
data="{filteredModels}"
columns="{columns}"
row={row}>
</Table>
{:else}
<div>There is no model yet</div>
{#if !loading}
{#if tasks.length > 0}
<div class="mx-4">
<Card classes="bg-charcoal-800 mt-4">
<div slot="content" class="text-base font-normal p-2">
<div class="text-base mb-2">Downloading models</div>
<TasksProgress tasks="{tasks}"/>
</div>
</Card>
</div>
{/if}
{#if filteredModels.length > 0}
<Table
kind="model"
data="{filteredModels}"
columns="{columns}"
row={row}>
</Table>
{:else}
<div>There is no model yet</div>
{/if}
{/if}
</div>
</div>
Expand Down

0 comments on commit 4d1a5e7

Please sign in to comment.