From 15feb79c179a80f4e9fac63dde892dd20e661248 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Mon, 10 Jun 2024 17:19:04 +0200 Subject: [PATCH] refactor: adopt ErrorMessage from ui-svelte library Signed-off-by: Philippe Martin --- packages/frontend/src/lib/ErrorMessage.svelte | 30 ------------------- .../frontend/src/pages/CreateService.svelte | 3 +- .../frontend/src/pages/ImportModels.svelte | 3 +- .../src/pages/PlaygroundCreate.svelte | 3 +- 4 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 packages/frontend/src/lib/ErrorMessage.svelte diff --git a/packages/frontend/src/lib/ErrorMessage.svelte b/packages/frontend/src/lib/ErrorMessage.svelte deleted file mode 100644 index e18de681e..000000000 --- a/packages/frontend/src/lib/ErrorMessage.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - -{#if icon} - {#if error !== undefined && error !== ''} - - - - - - {#if error} -
{error}
- {/if} -
-
- {/if} -{:else} -
- - -
-{/if} diff --git a/packages/frontend/src/pages/CreateService.svelte b/packages/frontend/src/pages/CreateService.svelte index 8a051ad48..e3bfc36fa 100644 --- a/packages/frontend/src/pages/CreateService.svelte +++ b/packages/frontend/src/pages/CreateService.svelte @@ -11,12 +11,11 @@ import { tasks } from '/@/stores/tasks'; import type { Task } from '@shared/src/models/ITask'; import { filterByLabel } from '/@/utils/taskUtils'; import TasksProgress from '/@/lib/progress/TasksProgress.svelte'; -import ErrorMessage from '../lib/ErrorMessage.svelte'; import { inferenceServers } from '/@/stores/inferenceServers'; import ContainerConnectionStatusInfo from '../lib/notification/ContainerConnectionStatusInfo.svelte'; import type { ContainerConnectionInfo } from '@shared/src/models/IContainerConnectionInfo'; import { checkContainerConnectionStatus } from '../utils/connectionUtils'; -import { Button } from '@podman-desktop/ui-svelte'; +import { Button, ErrorMessage } from '@podman-desktop/ui-svelte'; // List of the models available locally let localModels: ModelInfo[]; diff --git a/packages/frontend/src/pages/ImportModels.svelte b/packages/frontend/src/pages/ImportModels.svelte index eb787173d..26a7e8fb8 100644 --- a/packages/frontend/src/pages/ImportModels.svelte +++ b/packages/frontend/src/pages/ImportModels.svelte @@ -3,10 +3,9 @@ import { faMinusCircle, faPlusCircle, faUpload } from '@fortawesome/free-solid-s import { router } from 'tinro'; import { studioClient } from '../utils/client'; import { Uri } from '@shared/src/uri/Uri'; -import ErrorMessage from '../lib/ErrorMessage.svelte'; import NavPage from '../lib/NavPage.svelte'; import type { LocalModelImportInfo } from '@shared/src/models/ILocalModelInfo'; -import { Button } from '@podman-desktop/ui-svelte'; +import { Button, ErrorMessage } from '@podman-desktop/ui-svelte'; let modelsToImport: LocalModelImportInfo[] = []; let importError: string = ''; diff --git a/packages/frontend/src/pages/PlaygroundCreate.svelte b/packages/frontend/src/pages/PlaygroundCreate.svelte index 388936c6e..d4f2bdcb5 100644 --- a/packages/frontend/src/pages/PlaygroundCreate.svelte +++ b/packages/frontend/src/pages/PlaygroundCreate.svelte @@ -12,8 +12,7 @@ import TasksProgress from '../lib/progress/TasksProgress.svelte'; import { tasks } from '../stores/tasks'; import { filterByLabel } from '../utils/taskUtils'; import type { Unsubscriber } from 'svelte/store'; -import ErrorMessage from '../lib/ErrorMessage.svelte'; -import { Button } from '@podman-desktop/ui-svelte'; +import { Button, ErrorMessage } from '@podman-desktop/ui-svelte'; let localModels: ModelInfo[]; $: localModels = $modelsInfo.filter(model => model.file);