mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-13 04:28:08 +00:00
Dialog for cloud added
This commit is contained in:
@ -82,7 +82,7 @@
|
|||||||
placeholder="Ethernet interface"
|
placeholder="Ethernet interface"
|
||||||
[ngModelOptions]="{standalone: true}"
|
[ngModelOptions]="{standalone: true}"
|
||||||
[(ngModel)]="ethernetInterface">
|
[(ngModel)]="ethernetInterface">
|
||||||
<mat-option *ngFor="let type of " [value]="type">
|
<mat-option *ngFor="let type of ethernetInterfaces" [value]="type">
|
||||||
{{type}}
|
{{type}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
@ -6,11 +6,33 @@
|
|||||||
<mat-card class="matCard">
|
<mat-card class="matCard">
|
||||||
<mat-tab-group *ngIf="name">
|
<mat-tab-group *ngIf="name">
|
||||||
<mat-tab label="Ethernet interfaces">
|
<mat-tab label="Ethernet interfaces">
|
||||||
|
<div class="form-field" *ngFor="let port of portsMappingEthernet">
|
||||||
|
<div class="form-field">{{port.name}}</div><br/><br/>
|
||||||
|
</div>
|
||||||
|
<mat-form-field class="select">
|
||||||
|
<mat-select
|
||||||
|
placeholder="Ethernet interface"
|
||||||
|
[ngModelOptions]="{standalone: true}"
|
||||||
|
[(ngModel)]="ethernetInterface">
|
||||||
|
<mat-option *ngFor="let type of ethernetInterfaces" [value]="type">
|
||||||
|
{{type}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-button class="form-field" (click)="onAddEthernetInterface()">Add</button>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
|
|
||||||
<mat-tab label="TAP interfaces">
|
<mat-tab label="TAP interfaces">
|
||||||
|
<div class="form-field" *ngFor="let port of portsMappingTap">
|
||||||
|
<div class="form-field">{{port.name}}</div><br/><br/>
|
||||||
|
</div>
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input
|
||||||
|
matInput type="text"
|
||||||
|
[(ngModel)]="tapInterface"
|
||||||
|
placeholder="TAP interface">
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-button class="form-field" (click)="onAddTapInterface()">Add</button>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
|
|
||||||
<mat-tab label="UDP tunnels">
|
<mat-tab label="UDP tunnels">
|
||||||
|
@ -34,6 +34,9 @@ export class ConfiguratorDialogCloudComponent implements OnInit {
|
|||||||
|
|
||||||
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];
|
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];
|
||||||
networkTypes = [];
|
networkTypes = [];
|
||||||
|
tapInterface: string = '';
|
||||||
|
ethernetInterface: string = '';
|
||||||
|
ethernetInterfaces: string[] = ['Ethernet 2', 'Ethernet 3'];
|
||||||
|
|
||||||
@ViewChild("udpTunnels", {static: false}) udpTunnels: UdpTunnelsComponent;
|
@ViewChild("udpTunnels", {static: false}) udpTunnels: UdpTunnelsComponent;
|
||||||
|
|
||||||
@ -70,22 +73,23 @@ export class ConfiguratorDialogCloudComponent implements OnInit {
|
|||||||
this.consoleTypes = this.builtInTemplatesConfigurationService.getConsoleTypesForCloudNodes();
|
this.consoleTypes = this.builtInTemplatesConfigurationService.getConsoleTypesForCloudNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onAddTapInterface() {
|
||||||
|
if (this.tapInterface) {
|
||||||
|
this.portsMappingTap.push({
|
||||||
|
interface: this.tapInterface,
|
||||||
|
name: this.tapInterface,
|
||||||
|
port_number: 0,
|
||||||
|
type: "tap"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onSaveClick() {
|
onSaveClick() {
|
||||||
if (this.generalSettingsForm.valid) {
|
if (this.generalSettingsForm.valid) {
|
||||||
this.portsMappingUdp = this.udpTunnels.dataSourceUdp;
|
this.portsMappingUdp = this.udpTunnels.dataSourceUdp;
|
||||||
|
|
||||||
this.node.properties.ports_mapping = this.portsMappingUdp.concat(this.portsMappingEthernet).concat(this.portsMappingTap);
|
this.node.properties.ports_mapping = this.portsMappingUdp.concat(this.portsMappingEthernet).concat(this.portsMappingTap);
|
||||||
|
|
||||||
// this.node.custom_adapters = [];
|
|
||||||
// this.customAdapters.adapters.forEach(n => {
|
|
||||||
// this.node.custom_adapters.push({
|
|
||||||
// adapter_number: n.adapter_number,
|
|
||||||
// adapter_type: n.adapter_type
|
|
||||||
// })
|
|
||||||
// });
|
|
||||||
|
|
||||||
// this.node.properties.adapters = this.node.custom_adapters.length;
|
|
||||||
|
|
||||||
this.nodeService. updateNode(this.server, this.node).subscribe(() => {
|
this.nodeService. updateNode(this.server, this.node).subscribe(() => {
|
||||||
this.toasterService.success(`Node ${this.node.name} updated.`);
|
this.toasterService.success(`Node ${this.node.name} updated.`);
|
||||||
this.onCancelClick();
|
this.onCancelClick();
|
||||||
|
Reference in New Issue
Block a user