diff --git a/packages/backend/src/studio-api-impl.ts b/packages/backend/src/studio-api-impl.ts index 1ae2fec62..5831c7ac7 100644 --- a/packages/backend/src/studio-api-impl.ts +++ b/packages/backend/src/studio-api-impl.ts @@ -12,6 +12,7 @@ import { Studio } from './studio'; import * as path from 'node:path'; import { ModelResponse } from '@shared/models/IModelResponse'; import { PlayGroundManager } from './playground'; +import * as podmanDesktopApi from '@podman-desktop/api'; export const RECENT_CATEGORY_ID = 'recent-category'; @@ -23,9 +24,10 @@ export class StudioApiImpl implements StudioAPI { private playgroundManager: PlayGroundManager, ) {} - async openURL(url: string): Promise { - // TODO: open a browser page - return; + async openURL(url: string): Promise { + return await podmanDesktopApi.env.openExternal( + podmanDesktopApi.Uri.parse(url) + ); } async getPullingStatus(recipeId: string): Promise { diff --git a/packages/shared/StudioAPI.ts b/packages/shared/StudioAPI.ts index b76fa4f1c..31b3c59f3 100644 --- a/packages/shared/StudioAPI.ts +++ b/packages/shared/StudioAPI.ts @@ -15,7 +15,7 @@ export abstract class StudioAPI { abstract searchRecipes(query: string): Promise; abstract getPullingStatus(recipeId: string): Promise abstract pullApplication(recipeId: string): Promise; - abstract openURL(url: string): Promise; + abstract openURL(url: string): Promise; /** * Get the information of models saved locally into the extension's storage directory */