Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions webapp/src/lib/api/generated-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,20 @@ export class GeneratedGarmApiClient {
const response = await this.hooksApi.getOrgWebhookInfo(orgId);
return response.data;
}

async installForgeInstanceWebhook(forgeInstanceId: string, params: any = {}): Promise<void> {
await this.forgeInstancesApi.installForgeInstanceWebhook(forgeInstanceId, params);
}

async uninstallForgeInstanceWebhook(forgeInstanceId: string): Promise<void> {
await this.forgeInstancesApi.uninstallForgeInstanceWebhook(forgeInstanceId);
}

async getForgeInstanceWebhookInfo(forgeInstanceId: string): Promise<HookInfo> {
const response = await this.forgeInstancesApi.getForgeInstanceWebhookInfo(forgeInstanceId);
return response.data;
}

async listOrganizations(): Promise<Organization[]> {
const response = await this.organizationsApi.listOrgs();
return response.data || [];
Expand Down Expand Up @@ -503,8 +517,8 @@ export class GeneratedGarmApiClient {
}

// Forge Instances
async listForgeInstances(): Promise<ForgeInstance[]> {
const response = await this.forgeInstancesApi.listForgeInstances();
async listForgeInstances(endpoint?: string): Promise<ForgeInstance[]> {
const response = await this.forgeInstancesApi.listForgeInstances(endpoint);
return response.data || [];
}

Expand Down
19 changes: 11 additions & 8 deletions webapp/src/lib/components/CreateForgeInstanceModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,21 @@
}
}

// Only show Gitea credentials
$: filteredCredentials = credentials.filter(cred => cred.forge_type === 'gitea');

// Only show Gitea endpoints
$: giteaEndpoints = endpoints.filter(ep => ep.endpoint_type === 'gitea');

// Auto-select endpoint from selected credentials
// Filter credentials by selected endpoint
$: filteredCredentials = credentials.filter(cred =>
cred.forge_type === 'gitea' &&
(!endpointName || cred.endpoint?.name === endpointName)
);

// Clear credentials when endpoint changes (if current selection doesn't match)
$: {
if (credentialsName) {
const cred = filteredCredentials.find(c => c.name === credentialsName);
if (cred?.endpoint?.name) {
endpointName = cred.endpoint.name;
if (endpointName && credentialsName) {
const stillValid = filteredCredentials.find(c => c.name === credentialsName);
if (!stillValid) {
credentialsName = '';
}
}
}
Expand Down
Loading