From e8b7016f37275a0e03540f31b650416fd184d0dd Mon Sep 17 00:00:00 2001 From: axel7083 <42176370+axel7083@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:46:42 -0500 Subject: [PATCH] feat: adding some methods for lucas --- packages/backend/src/studio-api-impl.ts | 10 ++++++++++ packages/frontend/src/pages/Recipe.svelte | 7 +------ packages/shared/StudioAPI.ts | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/studio-api-impl.ts b/packages/backend/src/studio-api-impl.ts index 4b1ac3f5d..813e55fc9 100644 --- a/packages/backend/src/studio-api-impl.ts +++ b/packages/backend/src/studio-api-impl.ts @@ -7,6 +7,9 @@ import { Task } from '@shared/models/ITask'; export const RECENT_CATEGORY_ID = 'recent-category'; export class StudioApiImpl implements StudioAPI { + + private status: Map = new Map(); + async getPullingStatus(recipeId: string): Promise { return []; } @@ -38,4 +41,11 @@ export class StudioApiImpl implements StudioAPI { async searchRecipes(query: string): Promise { return []; // todo: not implemented } + + async pullApplication(recipeId: string): Promise { + const recipe: Recipe = await this.getRecipeById(recipeId); + + //todo: stuff here + return Promise.resolve(undefined); + } } diff --git a/packages/frontend/src/pages/Recipe.svelte b/packages/frontend/src/pages/Recipe.svelte index 69fe230c4..29e8b78f9 100644 --- a/packages/frontend/src/pages/Recipe.svelte +++ b/packages/frontend/src/pages/Recipe.svelte @@ -28,12 +28,7 @@ onMount(async () => { }) const onPullingRequest = () => { - pulling = [ - {state: 'success', name: 'Pulling image:latest'}, - {state: 'error', name: 'Pulling database:latest'}, - {state: 'loading', name: 'Pulling redis:latest'}, - {state: 'loading', name: 'Downloading model:latest'}, - ] + studioClient.pullApplication(recipeId); } diff --git a/packages/shared/StudioAPI.ts b/packages/shared/StudioAPI.ts index c964030db..42e96916e 100644 --- a/packages/shared/StudioAPI.ts +++ b/packages/shared/StudioAPI.ts @@ -10,5 +10,6 @@ export abstract class StudioAPI { abstract getRecipeById(recipeId: string): Promise; abstract searchRecipes(query: string): Promise; abstract getPullingStatus(recipeId: string): Promise + abstract pullApplication(recipeId: string): Promise; }