Dialog for VPCS added

This commit is contained in:
Piotr Pekala
2019-09-09 06:57:42 -07:00
parent 5e76feca5c
commit ecce86aaf7
10 changed files with 189 additions and 2 deletions

View File

@ -0,0 +1,4 @@
<button mat-menu-item (click)="configureNode()">
<mat-icon>settings_applications</mat-icon>
<span>Configure</span>
</button>

View File

@ -0,0 +1,58 @@
import { Component, Input, OnInit, OnChanges } from '@angular/core';
import { Server } from '../../../../../models/server';
import { Node } from '../../../../../cartography/models/node';
import { MatDialog, MatDialogRef } from '@angular/material';
import { ConfiguratorDialogVpcsComponent } from '../../../node-editors/configurator/vpcs/configurator-vpcs.component';
@Component({
selector: 'app-config-node-action',
templateUrl: './config-action.component.html'
})
export class ConfigActionComponent {
@Input() server: Server;
@Input() node: Node;
private conf = {
width: '600px',
autoFocus: false
};
dialogRef;
constructor(private dialog: MatDialog) {}
configureNode() {
if (this.node.node_type === 'vpcs') {
this.dialogRef = this.dialog.open(ConfiguratorDialogVpcsComponent, this.conf);
} else if (this.node.node_type === 'ethernet_hub') {
} else if (this.node.node_type === 'ethernet_switch') {
} else if (this.node.node_type === 'cloud') {
} else if (this.node.node_type === 'dynamips') {
} else if (this.node.node_type === 'iou') {
} else if (this.node.node_type === 'qemu') {
} else if (this.node.node_type === 'virtualbox') {
} else if (this.node.node_type === 'vmware') {
} else if (this.node.node_type === 'docker') {
} else if (this.node.node_type === 'nat') {
} else if (this.node.node_type === 'frame_relay_switch') {
} else if (this.node.node_type === 'atm_switch') {
} else if (this.node.node_type === 'traceng') {
}
let instance = this.dialogRef.componentInstance;
instance.server = this.server;
instance.node = this.node;
}
}

View File

@ -5,6 +5,10 @@
[server]="server"
[node]="nodes[0]"
></app-show-node-action>
<app-config-node-action *ngIf="nodes.length===1"
[server]="server"
[node]="nodes[0]"
></app-config-node-action>
<app-start-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-start-node-action>
<app-suspend-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-suspend-node-action>
<app-stop-node-action *ngIf="nodes.length && labels.length===0" [server]="server" [nodes]="nodes"></app-stop-node-action>