mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-08 02:54:16 +00:00
Code cleaned up
This commit is contained in:
parent
e904454623
commit
35c96d1c90
@ -7,6 +7,7 @@
|
||||
<div class="default-content">
|
||||
<div class="container mat-elevation-z8">
|
||||
<app-custom-adapters-table
|
||||
#customAdapters
|
||||
[networkTypes]="networkTypes"
|
||||
[displayedColumns]="displayedColumns"
|
||||
[adapters]="adapters"
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
||||
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
|
||||
import { CustomAdaptersTableComponent } from '../custom-adapters-table/custom-adapters-table.component';
|
||||
|
||||
|
||||
@Component({
|
||||
@ -13,6 +14,8 @@ export class CustomAdaptersComponent {
|
||||
@Output() closeConfiguratorEmitter = new EventEmitter<boolean>();
|
||||
@Output() saveConfigurationEmitter = new EventEmitter<CustomAdapter[]>();
|
||||
|
||||
@ViewChild("customAdapters", {static: false}) customAdapters: CustomAdaptersTableComponent;
|
||||
|
||||
public adapters: CustomAdapter[];
|
||||
public numberOfAdapters: number;
|
||||
|
||||
@ -21,6 +24,14 @@ export class CustomAdaptersComponent {
|
||||
}
|
||||
|
||||
configureCustomAdapters(){
|
||||
this.adapters = [];
|
||||
this.customAdapters.adapters.forEach(n => {
|
||||
this.adapters.push({
|
||||
adapter_number: n.adapter_number,
|
||||
adapter_type: n.adapter_type
|
||||
})
|
||||
});
|
||||
|
||||
this.saveConfigurationEmitter.emit(this.adapters);
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ export class ConfiguratorDialogVirtualBoxComponent implements OnInit {
|
||||
node: Node;
|
||||
name: string;
|
||||
generalSettingsForm: FormGroup;
|
||||
networkForm: FormGroup;
|
||||
consoleTypes: string[] = [];
|
||||
onCloseOptions = [];
|
||||
|
||||
@ -39,10 +38,6 @@ export class ConfiguratorDialogVirtualBoxComponent implements OnInit {
|
||||
name: new FormControl('', Validators.required),
|
||||
ram: new FormControl('', Validators.required)
|
||||
});
|
||||
|
||||
this.networkForm = this.formBuilder.group({
|
||||
adapters: new FormControl('', Validators.required)
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user