From 5c03032921d222a9cbf3dd8a69220c822ae8bc1a Mon Sep 17 00:00:00 2001 From: chyoo Date: Thu, 13 Aug 2026 11:57:49 +0900 Subject: [PATCH] fix default local platform and remote workspace paths --- src/curriculum/curriculum.service.ts | 48 +++++++++++++++------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/curriculum/curriculum.service.ts b/src/curriculum/curriculum.service.ts index 0d2bdce..1849c0d 100644 --- a/src/curriculum/curriculum.service.ts +++ b/src/curriculum/curriculum.service.ts @@ -412,28 +412,32 @@ export class CurriculumService { }); environmentProfilesByPlatformKey.set(profile.platformKey, items); }); - const fixedPlatforms = course.platforms - .filter((coursePlatform) => { - return this.isFixedPlatform(coursePlatform.platform); - }) - .map((coursePlatform) => { - const isLocal = this.isFixedPlatform(coursePlatform.platform); - return { - id: coursePlatform.platform.id, - platformKey: coursePlatform.platform.platformKey, - title: coursePlatform.platform.displayName, - description: coursePlatform.platform.description, - organizationName: coursePlatform.platform.organizationName, - iconKey: coursePlatform.platform.iconKey, - sourceSettings: coursePlatform.platform.defaultStudioSettings, - vehicleRuntimeProfile: this.toVehicleRuntimeProfile(coursePlatform.platform), - environmentProfiles: environmentProfilesByPlatformKey.get(coursePlatform.platform.platformKey) ?? [], - status: isLocal ? '사용 가능' : coursePlatform.status, - action: isLocal ? '연결' : coursePlatform.action, - state: coursePlatform.state, - local: isLocal, - }; - }); + const configuredLocalPlatform = course.platforms.find((coursePlatform) => ( + this.isFixedPlatform(coursePlatform.platform) + )); + const localPlatform = configuredLocalPlatform?.platform ?? await this.prisma.platform.findFirst({ + where: { + platformKey: 'futuredrive-local-pc', + isActive: true, + }, + }); + const fixedPlatforms = localPlatform + ? [{ + id: localPlatform.id, + platformKey: localPlatform.platformKey, + title: localPlatform.displayName, + description: localPlatform.description, + organizationName: localPlatform.organizationName, + iconKey: localPlatform.iconKey, + sourceSettings: localPlatform.defaultStudioSettings, + vehicleRuntimeProfile: this.toVehicleRuntimeProfile(localPlatform), + environmentProfiles: environmentProfilesByPlatformKey.get(localPlatform.platformKey) ?? [], + status: '사용 가능', + action: '연결', + state: configuredLocalPlatform?.state ?? 'ready', + local: true, + }] + : []; const controlStates = await this.platformControlService.getControlStates( { organizationId, organizationName }, lmsUser?.id ?? null,