refine app management and source repository displays
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-07-09 13:50:45 +09:00
parent fbefc08b85
commit c46c176ca8
2 changed files with 19 additions and 3 deletions
+12 -3
View File
@@ -40,8 +40,9 @@ export class AppsService {
private readonly launcherService: LauncherService,
) {}
listApps() {
return this.prisma.app.findMany({
async listApps() {
const [apps, launcherAppKeys] = await Promise.all([
this.prisma.app.findMany({
orderBy: { name: 'asc' },
include: {
components: {
@@ -58,7 +59,15 @@ export class AppsService {
},
},
},
});
}),
this.launcherService.listEnabledAppKeys().catch(() => []),
]);
const launcherLinkedKeys = new Set(launcherAppKeys);
return apps.map((app) => ({
...app,
launcherLinked: launcherLinkedKeys.has(app.key),
}));
}
async createApp(body: CreateAppDto) {
+7
View File
@@ -454,6 +454,13 @@ export class LauncherService {
};
}
async listEnabledAppKeys() {
const rows = await this.launcherPrisma.$queryRawUnsafe<Array<{ app_key: string }>>(
`SELECT app_key FROM launcher_apps WHERE is_enabled = true`,
);
return rows.map((row) => row.app_key);
}
async listUserAppPermissions(userId: string) {
const rows = await this.launcherPrisma.$queryRawUnsafe<LauncherUserAppPermissionRow[]>(
`SELECT app.id AS app_id, app.app_key, app.display_name, app.description, app.sort_order, app.is_enabled,