From b691b7fd8b74025afa11bffb3bd6787a7d63b28d Mon Sep 17 00:00:00 2001 From: lstocchi Date: Thu, 11 Apr 2024 16:43:48 +0200 Subject: [PATCH] feat: add warning to recipe page Signed-off-by: lstocchi --- .../src/lib/ContentDetailsLayout.svelte | 55 ++++++++++--------- packages/frontend/src/pages/Recipe.svelte | 17 ++++++ 2 files changed, 47 insertions(+), 25 deletions(-) diff --git a/packages/frontend/src/lib/ContentDetailsLayout.svelte b/packages/frontend/src/lib/ContentDetailsLayout.svelte index 034f1967a..51bf2aa4c 100644 --- a/packages/frontend/src/lib/ContentDetailsLayout.svelte +++ b/packages/frontend/src/lib/ContentDetailsLayout.svelte @@ -8,34 +8,39 @@ const toggle = () => { }; -
-
- +
+
+
-
-
-
-
-
- {detailsTitle} - +
+
+ +
+
+
+
+
+
+ {detailsTitle} + +
+
-
-
-
- +
+ +
-
+
\ No newline at end of file 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} +