diff --git a/packages/frontend/src/lib/ContentDetailsLayout.svelte b/packages/frontend/src/lib/ContentDetailsLayout.svelte index 034f1967a..4043717f3 100644 --- a/packages/frontend/src/lib/ContentDetailsLayout.svelte +++ b/packages/frontend/src/lib/ContentDetailsLayout.svelte @@ -8,33 +8,38 @@ const toggle = () => { }; -
-
- +
+
+
-
-
-
-
-
- {detailsTitle} - +
+
+ +
+
+
+
+
+
+ {detailsTitle} + +
+
-
-
-
- +
+ +
diff --git a/packages/frontend/src/pages/Recipe.spec.ts b/packages/frontend/src/pages/Recipe.spec.ts index cb160c491..7d73b5fcf 100644 --- a/packages/frontend/src/pages/Recipe.spec.ts +++ b/packages/frontend/src/pages/Recipe.spec.ts @@ -33,6 +33,7 @@ const mocks = vi.hoisted(() => { getApplicationsStateMock: vi.fn(), getLocalRepositoriesMock: vi.fn(), getTasksMock: vi.fn(), + getModelsInfo: vi.fn(), }; }); @@ -62,6 +63,7 @@ vi.mock('../utils/client', async () => { pullApplication: mocks.pullApplicationMock, telemetryLogUsage: mocks.telemetryLogUsageMock, getApplicationsState: mocks.getApplicationsStateMock, + getModelsInfo: mocks.getModelsInfo, }, rpcBrowser: { subscribe: () => { @@ -179,6 +181,7 @@ test('should display recipe information', async () => { vi.mocked(catalogStore).catalog = readable(initialCatalog); mocks.getApplicationsStateMock.mockResolvedValue([]); mocks.getPullingStatusesMock.mockResolvedValue([]); + mocks.getModelsInfo.mockResolvedValue([]); render(Recipe, { recipeId: 'recipe 1', }); @@ -192,6 +195,7 @@ test('should display updated recipe information', async () => { const customCatalog = writable(initialCatalog); vi.mocked(catalogStore).catalog = customCatalog; mocks.getPullingStatusesMock.mockResolvedValue([]); + mocks.getModelsInfo.mockResolvedValue([]); render(Recipe, { recipeId: 'recipe 1', }); @@ -209,7 +213,7 @@ test('should send telemetry data', async () => { vi.mocked(catalogStore).catalog = readable(initialCatalog); mocks.getPullingStatusesMock.mockResolvedValue([]); mocks.pullApplicationMock.mockResolvedValue(undefined); - + mocks.getModelsInfo.mockResolvedValue([]); render(Recipe, { recipeId: 'recipe 1', }); diff --git a/packages/frontend/src/pages/Recipe.svelte b/packages/frontend/src/pages/Recipe.svelte index 30b423cd6..ef7072f0f 100644 --- a/packages/frontend/src/pages/Recipe.svelte +++ b/packages/frontend/src/pages/Recipe.svelte @@ -10,6 +10,10 @@ import RecipeModels from './RecipeModels.svelte'; import { catalog } from '/@/stores/catalog'; import RecipeDetails from '/@/lib/RecipeDetails.svelte'; import ContentDetailsLayout from '../lib/ContentDetailsLayout.svelte'; +import type { ContainerConnectionInfo } from '@shared/src/models/IContainerConnectionInfo'; +import ContainerConnectionStatusInfo from '../lib/notification/ContainerConnectionStatusInfo.svelte'; +import { modelsInfo } from '../stores/modelsInfo'; +import { checkContainerConnectionStatus } from '../utils/connectionUtils'; export let recipeId: string; @@ -18,6 +22,12 @@ $: recipe = $catalog.recipes.find(r => r.id === recipeId); $: categories = $catalog.categories; let selectedModelId: string; $: selectedModelId = recipe?.models?.[0] ?? ''; +let connectionInfo: ContainerConnectionInfo | undefined; +$: if ($modelsInfo && selectedModelId) { + checkContainerConnectionStatus($modelsInfo, selectedModelId, 'recipe') + .then(value => (connectionInfo = value)) + .catch((e: unknown) => console.log(String(e))); +} // Send recipe info to telemetry let recipeTelemetry: string | undefined = undefined; @@ -44,6 +54,13 @@ function setSelectedModel(modelId: string) { + + {#if connectionInfo} +
+ +
+ {/if} +