Skip to content

Commit

Permalink
Enable console activity listener in play component.
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Oct 17, 2023
1 parent f92659c commit eaea337
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions projects/gameboard-ui/src/app/services/router.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit eaea337

Please sign in to comment.