Skip to content

Commit

Permalink
Merge pull request #63 from projectatomic/feature/open-external-links-60
Browse files Browse the repository at this point in the history
feat: adding support for opening external urls
  • Loading branch information
axel7083 authored Jan 17, 2024
2 parents f0d65fe + c08eb95 commit 2f41181
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/backend/src/studio-api-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -23,9 +24,10 @@ export class StudioApiImpl implements StudioAPI {
private playgroundManager: PlayGroundManager,
) {}

async openURL(url: string): Promise<void> {
// TODO: open a browser page
return;
async openURL(url: string): Promise<boolean> {
return await podmanDesktopApi.env.openExternal(
podmanDesktopApi.Uri.parse(url)
);
}

async getPullingStatus(recipeId: string): Promise<RecipeStatus> {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/StudioAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export abstract class StudioAPI {
abstract searchRecipes(query: string): Promise<Recipe[]>;
abstract getPullingStatus(recipeId: string): Promise<RecipeStatus>
abstract pullApplication(recipeId: string): Promise<void>;
abstract openURL(url: string): Promise<void>;
abstract openURL(url: string): Promise<boolean>;
/**
* Get the information of models saved locally into the extension's storage directory
*/
Expand Down

0 comments on commit 2f41181

Please sign in to comment.