Skip to content

Commit

Permalink
chore: adopt tab component (#1173)
Browse files Browse the repository at this point in the history
Signed-off-by: axel7083 <[email protected]>
  • Loading branch information
axel7083 authored Jun 6, 2024
1 parent 02a5039 commit 2fb66df
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 31 deletions.
22 changes: 0 additions & 22 deletions packages/frontend/src/lib/Tab.svelte

This file was deleted.

1 change: 0 additions & 1 deletion packages/frontend/src/pages/Model.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import NavPage from '/@/lib/NavPage.svelte';
import Tab from '/@/lib/Tab.svelte';
import MarkdownRenderer from '/@/lib/markdown/MarkdownRenderer.svelte';
import { catalog } from '/@/stores/catalog';
Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/src/pages/Models.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { onMount } from 'svelte';
import ModelColumnSize from '../lib/table/model/ModelColumnSize.svelte';
import ModelColumnAge from '../lib/table/model/ModelColumnAge.svelte';
import ModelColumnActions from '../lib/table/model/ModelColumnActions.svelte';
import Tab from '/@/lib/Tab.svelte';
import { Tab } from '@podman-desktop/ui-svelte';
import Route from '/@/Route.svelte';
import { tasks } from '/@/stores/tasks';
import ModelColumnIcon from '../lib/table/model/ModelColumnIcon.svelte';
Expand Down Expand Up @@ -106,10 +106,10 @@ async function importModel() {

<NavPage title="Models" searchEnabled="{false}" loading="{loading}">
<svelte:fragment slot="tabs">
<Tab title="All" url="models" />
<Tab title="Downloaded" url="models/downloaded" />
<Tab title="Imported" url="models/imported" />
<Tab title="Available" url="models/available" />
<Tab title="All" url="/models" selected="{$router.path === '/models'}" />
<Tab title="Downloaded" url="/models/downloaded" selected="{$router.path === '/models/downloaded'}" />
<Tab title="Imported" url="/models/imported" selected="{$router.path === '/models/imported'}" />
<Tab title="Available" url="/models/available" selected="{$router.path === '/models/available'}" />
</svelte:fragment>
<svelte:fragment slot="additional-actions">
<Button on:click="{importModel}" aria-label="Import Models">Import</Button>
Expand Down
7 changes: 4 additions & 3 deletions packages/frontend/src/pages/Recipe.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import NavPage from '/@/lib/NavPage.svelte';
import { studioClient } from '/@/utils/client';
import Tab from '/@/lib/Tab.svelte';
import { Tab } from '@podman-desktop/ui-svelte';
import Route from '/@/Route.svelte';
import Card from '/@/lib/Card.svelte';
import MarkdownRenderer from '/@/lib/markdown/MarkdownRenderer.svelte';
Expand All @@ -14,6 +14,7 @@ import type { ContainerConnectionInfo } from '@shared/src/models/IContainerConne
import ContainerConnectionStatusInfo from '../lib/notification/ContainerConnectionStatusInfo.svelte';
import { modelsInfo } from '../stores/modelsInfo';
import { checkContainerConnectionStatus } from '../utils/connectionUtils';
import { router } from 'tinro';
export let recipeId: string;
Expand Down Expand Up @@ -49,8 +50,8 @@ function setSelectedModel(modelId: string) {
searchEnabled="{false}"
contentBackground="bg-charcoal-500">
<svelte:fragment slot="tabs">
<Tab title="Summary" url="{recipeId}" />
<Tab title="Models" url="{recipeId}/models" />
<Tab title="Summary" url="/recipe/{recipeId}" selected="{$router.path === `/recipe/${recipeId}`}" />
<Tab title="Models" url="/recipe/{recipeId}/models" selected="{$router.path === `/recipe/${recipeId}/models`}" />
</svelte:fragment>
<svelte:fragment slot="content">
<ContentDetailsLayout detailsTitle="AI App Details" detailsLabel="application details">
Expand Down

0 comments on commit 2fb66df

Please sign in to comment.