From 9796a701a16fa3bd51d0d765b2a49094b49656aa Mon Sep 17 00:00:00 2001 From: Andrew Schlackman <72105194+sei-aschlackman@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:27:26 -0400 Subject: [PATCH] fixes for read only mode when following a user (#659) --- src/app/components/console/console.component.html | 2 +- src/app/components/console/console.component.ts | 15 ++++++++------- .../proxmox-console.component.html | 1 + 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/components/console/console.component.html b/src/app/components/console/console.component.html index e88f230..1c4bc13 100644 --- a/src/app/components/console/console.component.html +++ b/src/app/components/console/console.component.html @@ -29,7 +29,7 @@ [vmId]="vmId" (readOnlyChanged)="onReadOnlyChanged($event)" > - + } } } diff --git a/src/app/components/console/console.component.ts b/src/app/components/console/console.component.ts index aafd8eb..e21b2d1 100644 --- a/src/app/components/console/console.component.ts +++ b/src/app/components/console/console.component.ts @@ -26,9 +26,9 @@ import { OptionsBar2Component } from '../options-bar2/options-bar2.component'; ], }) export class ConsoleComponent { - @Input() readOnly = false; + @Input({ required: true }) readOnly; - @Input() set vmId(value: string) { + @Input({ required: true }) set vmId(value: string) { this._vmId = value; this.vsphereVm$ = this.vsphereQuery.selectEntity(value); this.virtualMachine$ = this.vmService.get(value); @@ -47,9 +47,11 @@ export class ConsoleComponent { vsphereVm$: Observable; virtualMachine$: Observable; - readOnlyInternal = false; - readOnlySubject = new BehaviorSubject(this.readOnly); - readOnly$ = this.readOnlySubject.asObservable(); + readOnlyManual = false; + + get readOnlyInternal() { + return this.readOnlyManual || this.readOnly; + } constructor( private vsphereQuery: VsphereQuery, @@ -57,7 +59,6 @@ export class ConsoleComponent { ) {} onReadOnlyChanged(event: boolean) { - this.readOnlyInternal = event; - this.readOnlySubject.next(this.readOnlyInternal || this.readOnly); + this.readOnlyManual = event; } } diff --git a/src/app/components/proxmox/proxmox-console/proxmox-console.component.html b/src/app/components/proxmox/proxmox-console/proxmox-console.component.html index 2d8c5f9..8417c64 100644 --- a/src/app/components/proxmox/proxmox-console/proxmox-console.component.html +++ b/src/app/components/proxmox/proxmox-console/proxmox-console.component.html @@ -7,6 +7,7 @@ }