diff --git a/projects/gameboard-ui/src/app/game/components/play/play.component.ts b/projects/gameboard-ui/src/app/game/components/play/play.component.ts index 053c4b60..7d7c01af 100644 --- a/projects/gameboard-ui/src/app/game/components/play/play.component.ts +++ b/projects/gameboard-ui/src/app/game/components/play/play.component.ts @@ -6,7 +6,7 @@ import { catchError, firstValueFrom, of, tap } from 'rxjs'; import { LocalActiveChallenge } from '@/api/challenges.models'; import { BoardPlayer, BoardSpec } from '@/api/board-models'; import { BoardService } from '@/api/board.service'; -import { TimeWindow } from '@/api/player-models'; +import { PlayerMode, TimeWindow } from '@/api/player-models'; import { ActiveChallengesRepo } from '@/stores/active-challenges.store'; import { UnsubscriberService } from '@/services/unsubscriber.service'; import { SpecSummary } from '@/api/spec-models'; @@ -106,7 +106,7 @@ export class PlayComponent { return vmUrls; for (let vm of challenge.challengeDeployment.vms) { - vmUrls[vm.id] = this.routerService.buildVmConsoleUrl(vm); + vmUrls[vm.id] = this.routerService.buildVmConsoleUrl(vm, challenge.playerMode == PlayerMode.practice); } return vmUrls; diff --git a/projects/gameboard-ui/src/app/services/router.service.ts b/projects/gameboard-ui/src/app/services/router.service.ts index 2eba8ab2..9f23221a 100644 --- a/projects/gameboard-ui/src/app/services/router.service.ts +++ b/projects/gameboard-ui/src/app/services/router.service.ts @@ -95,12 +95,12 @@ export class RouterService implements OnDestroy { return this.router.navigateByUrl(this.router.parseUrl(`/support/tickets/${highlightTicketKey}`)); } - public buildVmConsoleUrl(vm: VmState) { + public buildVmConsoleUrl(vm: VmState, isPractice = false) { if (!vm || !vm.isolationId || !vm.name) { throw new Error(`Can't launch a VM console without an isolationId and a name.`); } - return `${this.config.mkshost}?f=1&s=${vm.isolationId}&v=${vm.name}`; + return `${this.config.mkshost}?f=1&s=${vm.isolationId}&v=${vm.name}${isPractice ? "&l=true" : ""}`; } public toVmConsole(vm: VmState) {