From 81b388a7fe18c5a922a5f06c187481cf1d8358e0 Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Thu, 7 May 2020 17:18:53 +0200 Subject: [PATCH] New port setting for GNS3 VM preferences --- src/app/components/preferences/gns3vm/gns3vm.component.html | 3 +++ src/app/components/preferences/gns3vm/gns3vm.component.ts | 3 +++ src/app/models/gns3vm/gns3vm.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/src/app/components/preferences/gns3vm/gns3vm.component.html b/src/app/components/preferences/gns3vm/gns3vm.component.html index fe20bc4f..28f8d4d1 100644 --- a/src/app/components/preferences/gns3vm/gns3vm.component.html +++ b/src/app/components/preferences/gns3vm/gns3vm.component.html @@ -27,6 +27,9 @@ Run the VM in headless mode
+ + + MB diff --git a/src/app/components/preferences/gns3vm/gns3vm.component.ts b/src/app/components/preferences/gns3vm/gns3vm.component.ts index f7317831..b49ba281 100644 --- a/src/app/components/preferences/gns3vm/gns3vm.component.ts +++ b/src/app/components/preferences/gns3vm/gns3vm.component.ts @@ -21,6 +21,7 @@ export class Gns3vmComponent implements OnInit { public vmEngines: Gns3vmEngine[]; public vms: VM[] = []; public vmForm: FormGroup; + public port: number; constructor( private route: ActivatedRoute, @@ -44,6 +45,7 @@ export class Gns3vmComponent implements OnInit { this.gns3vm = vm; this.vmForm.controls['ram'].setValue(this.gns3vm.ram); this.vmForm.controls['vcpus'].setValue(this.gns3vm.vcpus); + if (this.gns3vm.port) this.port = this.gns3vm.port; this.gns3vmService.getGns3vmEngines(this.server).subscribe((vmEngines: Gns3vmEngine[]) => { this.vmEngines = vmEngines; }); @@ -75,6 +77,7 @@ export class Gns3vmComponent implements OnInit { if ((this.vmForm.valid && this.gns3vm.vmname) || (this.gns3vm.engine==='remote' && this.gns3vm.vmname)) { this.gns3vm.ram = this.vmForm.get('ram').value; this.gns3vm.vcpus= this.vmForm.get('vcpus').value; + if (this.port) this.gns3vm.port = this.port; this.gns3vmService.updateGns3vm(this.server, this.gns3vm).subscribe(() => { this.toasterService.success('GNS3 VM updated.'); diff --git a/src/app/models/gns3vm/gns3vm.ts b/src/app/models/gns3vm/gns3vm.ts index f853443d..e1443c7f 100644 --- a/src/app/models/gns3vm/gns3vm.ts +++ b/src/app/models/gns3vm/gns3vm.ts @@ -2,6 +2,7 @@ export interface Gns3vm { enable: boolean; engine: string; headless: boolean; + port: number; ram: number; vcpus: number; vmname: string;