Skip to content

Commit

Permalink
feat: adding some methods for lucas
Browse files Browse the repository at this point in the history
  • Loading branch information
axel7083 committed Jan 10, 2024
1 parent bccf853 commit e8b7016
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 10 additions & 0 deletions packages/backend/src/studio-api-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Task[]> = new Map<string, Task[]>();

async getPullingStatus(recipeId: string): Promise<Task[]> {
return [];
}
Expand Down Expand Up @@ -38,4 +41,11 @@ export class StudioApiImpl implements StudioAPI {
async searchRecipes(query: string): Promise<Recipe[]> {
return []; // todo: not implemented
}

async pullApplication(recipeId: string): Promise<void> {
const recipe: Recipe = await this.getRecipeById(recipeId);

//todo: stuff here
return Promise.resolve(undefined);
}
}
7 changes: 1 addition & 6 deletions packages/frontend/src/pages/Recipe.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
</script>

Expand Down
1 change: 1 addition & 0 deletions packages/shared/StudioAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export abstract class StudioAPI {
abstract getRecipeById(recipeId: string): Promise<Recipe>;
abstract searchRecipes(query: string): Promise<Recipe[]>;
abstract getPullingStatus(recipeId: string): Promise<Task[]>
abstract pullApplication(recipeId: string): Promise<void>;
}

0 comments on commit e8b7016

Please sign in to comment.