diff --git a/src/app/components/preferences/common/custom-adapters-table/custom-adapters-table.component.html b/src/app/components/preferences/common/custom-adapters-table/custom-adapters-table.component.html index d1d000a61..322350d00 100644 --- a/src/app/components/preferences/common/custom-adapters-table/custom-adapters-table.component.html +++ b/src/app/components/preferences/common/custom-adapters-table/custom-adapters-table.component.html @@ -1,4 +1,4 @@ - +
@@ -6,25 +6,29 @@ - + - + + + + diff --git a/src/app/components/preferences/common/custom-adapters-table/custom-adapters-table.component.ts b/src/app/components/preferences/common/custom-adapters-table/custom-adapters-table.component.ts index ea34cf465..efee7b05c 100644 --- a/src/app/components/preferences/common/custom-adapters-table/custom-adapters-table.component.ts +++ b/src/app/components/preferences/common/custom-adapters-table/custom-adapters-table.component.ts @@ -17,6 +17,8 @@ export class CustomAdaptersTableComponent { let adapter: CustomAdapter = { adapter_number: this.adapters.length, adapter_type: this.networkTypes[0], + mac_address:null, + port_name:null }; this.adapters = this.adapters.concat([adapter]); } diff --git a/src/app/components/preferences/common/custom-adapters/custom-adapters.component.ts b/src/app/components/preferences/common/custom-adapters/custom-adapters.component.ts index 34f2080e1..62c15cd83 100644 --- a/src/app/components/preferences/common/custom-adapters/custom-adapters.component.ts +++ b/src/app/components/preferences/common/custom-adapters/custom-adapters.component.ts @@ -30,6 +30,8 @@ export class CustomAdaptersComponent { this.adapters.push({ adapter_number: n.adapter_number, adapter_type: n.adapter_type, + mac_address:n.mac_address, + port_name:n.port_name }); }); diff --git a/src/app/components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component.ts b/src/app/components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component.ts index cfdc1718a..330d223fd 100644 --- a/src/app/components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component.ts +++ b/src/app/components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component.ts @@ -17,6 +17,7 @@ import { QemuService } from '../../../../services/qemu.service'; import { ControllerService } from '../../../../services/controller.service'; import { TemplateMocksService } from '../../../../services/template-mocks.service'; import { ToasterService } from '../../../../services/toaster.service'; +import { CustomAdapter } from '@models/qemu/qemu-custom-adapter'; @Component({ selector: 'app-add-qemu-virtual-machine-template', @@ -175,7 +176,13 @@ export class AddQemuVmTemplateComponent implements OnInit { this.qemuTemplate.template_id = uuid(); this.qemuTemplate.name = this.nameForm.get('templateName').value; this.qemuTemplate.compute_id = 'local'; - + // let adapter: CustomAdapter = { + // adapter_number: this.qemuTemplate.adapters, + // adapter_type:this.qemuTemplate.adapter_type , + // mac_address:null, + // port_name:this.qemuTemplate.port_name_format + // }; + // this.qemuTemplate.custom_adapters = this.qemuTemplate.custom_adapters.concat([adapter]); this.qemuService.addTemplate(this.controller, this.qemuTemplate).subscribe((template: QemuTemplate) => { this.goBack(); }); diff --git a/src/app/components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component.ts b/src/app/components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component.ts index ff0c939cc..5e0df3aa7 100644 --- a/src/app/components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component.ts +++ b/src/app/components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component.ts @@ -103,10 +103,12 @@ export class QemuVmTemplateDetailsComponent implements OnInit { this.fillCustomAdapters(); this.customAdaptersConfigurator.numberOfAdapters = this.qemuTemplate.adapters; this.customAdaptersConfigurator.adapters = []; - this.qemuTemplate.custom_adapters.forEach((adapter: CustomAdapter) => { + this.qemuTemplate.custom_adapters.forEach((adapter: CustomAdapter,i) => { this.customAdaptersConfigurator.adapters.push({ adapter_number: adapter.adapter_number, adapter_type: adapter.adapter_type, + mac_address:null, + port_name:this.qemuTemplate.port_name_format +'/'+ `${i}` }); }); } @@ -118,16 +120,18 @@ export class QemuVmTemplateDetailsComponent implements OnInit { } fillCustomAdapters() { + let copyOfAdapters = this.qemuTemplate.custom_adapters ? this.qemuTemplate.custom_adapters : []; this.qemuTemplate.custom_adapters = []; - for (let i = 0; i < this.qemuTemplate.adapters; i++) { if (copyOfAdapters[i]) { this.qemuTemplate.custom_adapters.push(copyOfAdapters[i]); } else { this.qemuTemplate.custom_adapters.push({ adapter_number: i, - adapter_type: 'e1000', + adapter_type: this.qemuTemplate.adapter_type, + mac_address:null, + port_name:this.qemuTemplate.port_name_format.replace(/[0-9]/g,`${i}`) }); } } diff --git a/src/app/components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component.ts b/src/app/components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component.ts index a91f60bcf..76ae8bb92 100644 --- a/src/app/components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component.ts +++ b/src/app/components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component.ts @@ -88,6 +88,9 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit { this.customAdaptersConfigurator.adapters.push({ adapter_number: adapter.adapter_number, adapter_type: adapter.adapter_type, + mac_address:adapter.mac_address, + port_name:adapter.port_name + }); }); } @@ -109,6 +112,8 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit { this.virtualBoxTemplate.custom_adapters.push({ adapter_number: i, adapter_type: 'e1000', + mac_address:'', + port_name:'' }); } } diff --git a/src/app/components/preferences/vmware/vmware-template-details/vmware-template-details.component.ts b/src/app/components/preferences/vmware/vmware-template-details/vmware-template-details.component.ts index a2ea0f5d2..5c8244a31 100644 --- a/src/app/components/preferences/vmware/vmware-template-details/vmware-template-details.component.ts +++ b/src/app/components/preferences/vmware/vmware-template-details/vmware-template-details.component.ts @@ -94,6 +94,8 @@ export class VmwareTemplateDetailsComponent implements OnInit { this.customAdaptersConfigurator.adapters.push({ adapter_number: adapter.adapter_number, adapter_type: adapter.adapter_type, + mac_address:adapter.mac_address, + port_name:adapter.port_name }); }); } @@ -115,6 +117,8 @@ export class VmwareTemplateDetailsComponent implements OnInit { this.vmwareTemplate.custom_adapters.push({ adapter_number: i, adapter_type: 'e1000', + mac_address:'', + port_name:'' }); } } diff --git a/src/app/components/project-map/node-editors/configurator/docker/configure-custom-adapters/configure-custom-adapters.component.html b/src/app/components/project-map/node-editors/configurator/docker/configure-custom-adapters/configure-custom-adapters.component.html index e7f879ed6..9650f1b01 100644 --- a/src/app/components/project-map/node-editors/configurator/docker/configure-custom-adapters/configure-custom-adapters.component.html +++ b/src/app/components/project-map/node-editors/configurator/docker/configure-custom-adapters/configure-custom-adapters.component.html @@ -1,3 +1,4 @@ +

Configure custom adapters for node {{ node.name }}

Adapter number Adapter {{ element.adapter_number }}Port nameEthernet {{ element.adapter_number }}{{ element.short_name || element.port_name }} Adapter type + - {{ type.name }} + {{type.name}} ({{type.value}}) MAC address{{ element.mac_address }} Actions