mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-10 11:59:53 +00:00
Removing fields related to gns3 vm from templates
This commit is contained in:
parent
8e93fa9d36
commit
21dfa56b17
@ -10,13 +10,6 @@
|
||||
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked
|
||||
>Run the cloud node locally</mat-radio-button
|
||||
>
|
||||
<mat-radio-button
|
||||
[disabled]="!isGns3VmAvailable"
|
||||
class="radio-button"
|
||||
value="2"
|
||||
(click)="setServerType('gns3 vm')"
|
||||
>Run the cloud node on the GNS3 VM</mat-radio-button
|
||||
>
|
||||
</mat-radio-group>
|
||||
|
||||
<form [formGroup]="formGroup">
|
||||
|
@ -20,9 +20,6 @@ export class CloudNodesAddTemplateComponent implements OnInit {
|
||||
server: Server;
|
||||
templateName: string = '';
|
||||
formGroup: FormGroup;
|
||||
|
||||
isGns3VmAvailable: boolean = false;
|
||||
isGns3VmChosen: boolean = false;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -44,19 +41,11 @@ export class CloudNodesAddTemplateComponent implements OnInit {
|
||||
const server_id = this.route.snapshot.paramMap.get('server_id');
|
||||
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
|
||||
this.server = server;
|
||||
|
||||
this.computeService.getComputes(server).subscribe((computes: Compute[]) => {
|
||||
if (computes.filter((compute) => compute.compute_id === 'vm').length > 0) this.isGns3VmAvailable = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setServerType(serverType: string) {
|
||||
if (serverType === 'gns3 vm' && this.isGns3VmAvailable) {
|
||||
this.isGns3VmChosen = true;
|
||||
this.isLocalComputerChosen = false;
|
||||
} else {
|
||||
this.isGns3VmChosen = false;
|
||||
if (serverType === 'local') {
|
||||
this.isLocalComputerChosen = true;
|
||||
}
|
||||
}
|
||||
@ -75,7 +64,7 @@ export class CloudNodesAddTemplateComponent implements OnInit {
|
||||
|
||||
cloudTemplate.template_id = uuid();
|
||||
cloudTemplate.name = this.formGroup.get('templateName').value;
|
||||
cloudTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local';
|
||||
cloudTemplate.compute_id = 'local';
|
||||
|
||||
this.builtInTemplatesService.addTemplate(this.server, cloudTemplate).subscribe((cloudNodeTemplate) => {
|
||||
this.goBack();
|
||||
|
@ -10,13 +10,6 @@
|
||||
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked
|
||||
>Run the Ethernet Hub locally</mat-radio-button
|
||||
>
|
||||
<mat-radio-button
|
||||
[disabled]="!isGns3VmAvailable"
|
||||
class="radio-button"
|
||||
value="2"
|
||||
(click)="setServerType('gns3 vm')"
|
||||
>Run the Ethernet Hub on the GNS3 VM</mat-radio-button
|
||||
>
|
||||
</mat-radio-group>
|
||||
|
||||
<form [formGroup]="formGroup">
|
||||
|
@ -20,9 +20,6 @@ export class EthernetHubsAddTemplateComponent implements OnInit {
|
||||
server: Server;
|
||||
templateName: string = '';
|
||||
formGroup: FormGroup;
|
||||
|
||||
isGns3VmAvailable: boolean = false;
|
||||
isGns3VmChosen: boolean = false;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -45,19 +42,11 @@ export class EthernetHubsAddTemplateComponent implements OnInit {
|
||||
const server_id = this.route.snapshot.paramMap.get('server_id');
|
||||
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
|
||||
this.server = server;
|
||||
|
||||
this.computeService.getComputes(server).subscribe((computes: Compute[]) => {
|
||||
if (computes.filter((compute) => compute.compute_id === 'vm').length > 0) this.isGns3VmAvailable = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setServerType(serverType: string) {
|
||||
if (serverType === 'gns3 vm' && this.isGns3VmAvailable) {
|
||||
this.isGns3VmChosen = true;
|
||||
this.isLocalComputerChosen = false;
|
||||
} else {
|
||||
this.isGns3VmChosen = false;
|
||||
if (serverType === 'local') {
|
||||
this.isLocalComputerChosen = true;
|
||||
}
|
||||
}
|
||||
@ -76,7 +65,7 @@ export class EthernetHubsAddTemplateComponent implements OnInit {
|
||||
|
||||
ethernetHubTemplate.template_id = uuid();
|
||||
ethernetHubTemplate.name = this.formGroup.get('templateName').value;
|
||||
ethernetHubTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local';
|
||||
ethernetHubTemplate.compute_id = 'local';
|
||||
|
||||
for (let i = 0; i < this.formGroup.get('numberOfPorts').value; i++) {
|
||||
ethernetHubTemplate.ports_mapping.push({
|
||||
|
@ -10,13 +10,6 @@
|
||||
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked
|
||||
>Run the Ethernet switch locally</mat-radio-button
|
||||
>
|
||||
<mat-radio-button
|
||||
[disabled]="!isGns3VmAvailable"
|
||||
class="radio-button"
|
||||
value="2"
|
||||
(click)="setServerType('gns3 vm')"
|
||||
>Run the Ethernet switch on the GNS3 VM</mat-radio-button
|
||||
>
|
||||
</mat-radio-group>
|
||||
|
||||
<form [formGroup]="formGroup">
|
||||
|
@ -20,9 +20,6 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
|
||||
server: Server;
|
||||
templateName: string = '';
|
||||
formGroup: FormGroup;
|
||||
|
||||
isGns3VmAvailable: boolean = false;
|
||||
isGns3VmChosen: boolean = false;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -45,10 +42,6 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
|
||||
const server_id = this.route.snapshot.paramMap.get('server_id');
|
||||
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
|
||||
this.server = server;
|
||||
|
||||
this.computeService.getComputes(server).subscribe((computes: Compute[]) => {
|
||||
if (computes.filter((compute) => compute.compute_id === 'vm').length > 0) this.isGns3VmAvailable = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -57,11 +50,7 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
|
||||
}
|
||||
|
||||
setServerType(serverType: string) {
|
||||
if (serverType === 'gns3 vm' && this.isGns3VmAvailable) {
|
||||
this.isGns3VmChosen = true;
|
||||
this.isLocalComputerChosen = false;
|
||||
} else {
|
||||
this.isGns3VmChosen = false;
|
||||
if (serverType === 'local') {
|
||||
this.isLocalComputerChosen = true;
|
||||
}
|
||||
}
|
||||
@ -76,7 +65,7 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
|
||||
|
||||
ethernetSwitchTemplate.template_id = uuid();
|
||||
ethernetSwitchTemplate.name = this.formGroup.get('templateName').value;
|
||||
ethernetSwitchTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local';
|
||||
ethernetSwitchTemplate.compute_id = 'local';
|
||||
|
||||
for (let i = 0; i < this.formGroup.get('numberOfPorts').value; i++) {
|
||||
ethernetSwitchTemplate.ports_mapping.push({
|
||||
|
@ -7,19 +7,12 @@
|
||||
<div class="default-content">
|
||||
<div class="container mat-elevation-z8">
|
||||
<mat-vertical-stepper [linear]="true">
|
||||
<mat-step label="Server type" [completed]="isGns3VmChosen || isLocalComputerChosen">
|
||||
<mat-step label="Server type" [completed]="isLocalComputerChosen">
|
||||
<mat-radio-group class="radio-group">
|
||||
<!-- <mat-radio-button class="radio-button" value="1" (click)="setServerType('remote computer')">Run this Docker container on a remote computer</mat-radio-button> -->
|
||||
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked
|
||||
>Run this Docker container locally</mat-radio-button
|
||||
>
|
||||
<mat-radio-button
|
||||
[disabled]="!isGns3VmAvailable"
|
||||
class="radio-button"
|
||||
value="2"
|
||||
(click)="setServerType('gns3 vm')"
|
||||
>Run this Docker container on the GNS3 VM</mat-radio-button
|
||||
>
|
||||
</mat-radio-group>
|
||||
</mat-step>
|
||||
|
||||
|
@ -30,9 +30,6 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
virtualMachineForm: FormGroup;
|
||||
containerNameForm: FormGroup;
|
||||
networkAdaptersForm: FormGroup;
|
||||
|
||||
isGns3VmAvailable: boolean = false;
|
||||
isGns3VmChosen: boolean = false;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -72,10 +69,6 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
this.dockerTemplate = dockerTemplate;
|
||||
});
|
||||
|
||||
this.computeService.getComputes(server).subscribe((computes: Compute[]) => {
|
||||
if (computes.filter((compute) => compute.compute_id === 'vm').length > 0) this.isGns3VmAvailable = true;
|
||||
});
|
||||
|
||||
this.dockerService.getImages(server).subscribe((images) => {
|
||||
this.dockerImages = images;
|
||||
});
|
||||
@ -83,11 +76,7 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
}
|
||||
|
||||
setServerType(serverType: string) {
|
||||
if (serverType === 'gns3 vm' && this.isGns3VmAvailable) {
|
||||
this.isGns3VmChosen = true;
|
||||
this.isLocalComputerChosen = false;
|
||||
} else {
|
||||
this.isGns3VmChosen = false;
|
||||
if (serverType === 'local') {
|
||||
this.isLocalComputerChosen = true;
|
||||
}
|
||||
}
|
||||
@ -116,7 +105,7 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
|
||||
this.dockerTemplate.name = this.containerNameForm.get('templateName').value;
|
||||
this.dockerTemplate.adapters = +this.networkAdaptersForm.get('adapters').value;
|
||||
this.dockerTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local';
|
||||
this.dockerTemplate.compute_id = 'local';
|
||||
|
||||
this.dockerService.addTemplate(this.server, this.dockerTemplate).subscribe((template: DockerTemplate) => {
|
||||
this.goBack();
|
||||
|
@ -7,18 +7,11 @@
|
||||
<div class="default-content" *ngIf="iosTemplate">
|
||||
<div class="container mat-elevation-z8">
|
||||
<mat-vertical-stepper [linear]="true">
|
||||
<mat-step label="Server type" [completed]="isGns3VmChosen || isLocalComputerChosen">
|
||||
<mat-step label="Server type" [completed]="isLocalComputerChosen">
|
||||
<mat-radio-group class="radio-group">
|
||||
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked
|
||||
>Run this IOS router locally</mat-radio-button
|
||||
>
|
||||
<mat-radio-button
|
||||
[disabled]="!isGns3VmAvailable"
|
||||
class="radio-button"
|
||||
value="2"
|
||||
(click)="setServerType('gns3 vm')"
|
||||
>Run this IOS router on the GNS3 VM</mat-radio-button
|
||||
>
|
||||
</mat-radio-group>
|
||||
</mat-step>
|
||||
|
||||
|
@ -45,9 +45,6 @@ export class AddIosTemplateComponent implements OnInit {
|
||||
|
||||
ciscoUrl: string = 'https://cfn.cloudapps.cisco.com/ITDIT/CFN/jsp/SearchBySoftware.jsp';
|
||||
uploader: FileUploader;
|
||||
|
||||
isGns3VmAvailable: boolean = false;
|
||||
isGns3VmChosen: boolean = false;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -114,19 +111,11 @@ export class AddIosTemplateComponent implements OnInit {
|
||||
this.chassis = this.iosConfigurationService.getChassis();
|
||||
this.defaultRam = this.iosConfigurationService.getDefaultRamSettings();
|
||||
});
|
||||
|
||||
this.computeService.getComputes(server).subscribe((computes: Compute[]) => {
|
||||
if (computes.filter((compute) => compute.compute_id === 'vm').length > 0) this.isGns3VmAvailable = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setServerType(serverType: string) {
|
||||
if (serverType === 'gns3 vm' && this.isGns3VmAvailable) {
|
||||
this.isGns3VmChosen = true;
|
||||
this.isLocalComputerChosen = false;
|
||||
} else {
|
||||
this.isGns3VmChosen = false;
|
||||
if (serverType === 'local') {
|
||||
this.isLocalComputerChosen = true;
|
||||
}
|
||||
}
|
||||
@ -174,8 +163,7 @@ export class AddIosTemplateComponent implements OnInit {
|
||||
|
||||
if (this.networkAdaptersForTemplate.length > 0) this.completeAdaptersData();
|
||||
if (this.networkModulesForTemplate.length > 0) this.completeModulesData();
|
||||
|
||||
this.iosTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local';
|
||||
this.iosTemplate.compute_id = 'local';
|
||||
|
||||
this.iosService.addTemplate(this.server, this.iosTemplate).subscribe((template: IosTemplate) => {
|
||||
this.goBack();
|
||||
|
@ -7,18 +7,11 @@
|
||||
<div class="default-content">
|
||||
<div class="container mat-elevation-z8">
|
||||
<mat-vertical-stepper [linear]="true">
|
||||
<mat-step label="Server type" [completed]="isGns3VmChosen || isLocalComputerChosen">
|
||||
<mat-step label="Server type" [completed]="isLocalComputerChosen">
|
||||
<mat-radio-group class="radio-group">
|
||||
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked
|
||||
>Run this IOU device locally</mat-radio-button
|
||||
>
|
||||
<mat-radio-button
|
||||
[disabled]="!isGns3VmAvailable"
|
||||
class="radio-button"
|
||||
value="2"
|
||||
(click)="setServerType('gns3 vm')"
|
||||
>Run this IOU device on the GNS3 VM</mat-radio-button
|
||||
>
|
||||
</mat-radio-group>
|
||||
</mat-step>
|
||||
|
||||
|
@ -30,9 +30,6 @@ export class AddIouTemplateComponent implements OnInit {
|
||||
|
||||
templateNameForm: FormGroup;
|
||||
imageForm: FormGroup;
|
||||
|
||||
isGns3VmAvailable: boolean = false;
|
||||
isGns3VmChosen: boolean = false;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -82,10 +79,6 @@ export class AddIouTemplateComponent implements OnInit {
|
||||
this.templateMocksService.getIouTemplate().subscribe((iouTemplate: IouTemplate) => {
|
||||
this.iouTemplate = iouTemplate;
|
||||
});
|
||||
|
||||
this.computeService.getComputes(server).subscribe((computes: Compute[]) => {
|
||||
if (computes.filter((compute) => compute.compute_id === 'vm').length > 0) this.isGns3VmAvailable = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -96,11 +89,7 @@ export class AddIouTemplateComponent implements OnInit {
|
||||
}
|
||||
|
||||
setServerType(serverType: string) {
|
||||
if (serverType === 'gns3 vm' && this.isGns3VmAvailable) {
|
||||
this.isGns3VmChosen = true;
|
||||
this.isLocalComputerChosen = false;
|
||||
} else {
|
||||
this.isGns3VmChosen = false;
|
||||
if (serverType === 'local') {
|
||||
this.isLocalComputerChosen = true;
|
||||
}
|
||||
}
|
||||
@ -134,7 +123,7 @@ export class AddIouTemplateComponent implements OnInit {
|
||||
this.iouTemplate.template_id = uuid();
|
||||
this.iouTemplate.name = this.templateNameForm.get('templateName').value;
|
||||
if (this.newImageSelected) this.iouTemplate.path = this.imageForm.get('imageName').value;
|
||||
this.iouTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local';
|
||||
this.iouTemplate.compute_id = 'local';
|
||||
|
||||
if (this.selectedType === 'L2 image') {
|
||||
this.iouTemplate.ethernet_adapters = 4;
|
||||
|
@ -7,18 +7,11 @@
|
||||
<div class="default-content">
|
||||
<div class="container mat-elevation-z8">
|
||||
<mat-vertical-stepper [linear]="true">
|
||||
<mat-step label="Server type" [completed]="isGns3VmChosen || isLocalComputerChosen">
|
||||
<mat-step label="Server type" [completed]="isLocalComputerChosen">
|
||||
<mat-radio-group class="radio-group">
|
||||
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked
|
||||
>Run this QEMU VM locally</mat-radio-button
|
||||
>
|
||||
<mat-radio-button
|
||||
[disabled]="!isGns3VmAvailable"
|
||||
class="radio-button"
|
||||
value="2"
|
||||
(click)="setServerType('gns3 vm')"
|
||||
>Run this QEMU VM on the GNS3 VM</mat-radio-button
|
||||
>
|
||||
</mat-radio-group>
|
||||
</mat-step>
|
||||
|
||||
|
@ -36,9 +36,6 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
nameForm: FormGroup;
|
||||
memoryForm: FormGroup;
|
||||
diskForm: FormGroup;
|
||||
|
||||
isGns3VmAvailable: boolean = false;
|
||||
isGns3VmChosen: boolean = false;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -105,19 +102,11 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
});
|
||||
|
||||
this.consoleTypes = this.configurationService.getConsoleTypes();
|
||||
|
||||
this.computeService.getComputes(server).subscribe((computes: Compute[]) => {
|
||||
if (computes.filter((compute) => compute.compute_id === 'vm').length > 0) this.isGns3VmAvailable = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setServerType(serverType: string) {
|
||||
if (serverType === 'gns3 vm' && this.isGns3VmAvailable) {
|
||||
this.isGns3VmChosen = true;
|
||||
this.isLocalComputerChosen = false;
|
||||
} else {
|
||||
this.isGns3VmChosen = false;
|
||||
if (serverType === 'local') {
|
||||
this.isLocalComputerChosen = true;
|
||||
}
|
||||
}
|
||||
@ -154,7 +143,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
}
|
||||
this.qemuTemplate.template_id = uuid();
|
||||
this.qemuTemplate.name = this.nameForm.get('templateName').value;
|
||||
this.qemuTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local';
|
||||
this.qemuTemplate.compute_id = 'local';
|
||||
|
||||
this.qemuService.addTemplate(this.server, this.qemuTemplate).subscribe((template: QemuTemplate) => {
|
||||
this.goBack();
|
||||
|
@ -10,13 +10,6 @@
|
||||
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked
|
||||
>Run the VPCS node locally</mat-radio-button
|
||||
>
|
||||
<mat-radio-button
|
||||
[disabled]="!isGns3VmAvailable"
|
||||
class="radio-button"
|
||||
value="2"
|
||||
(click)="setServerType('gns3 vm')"
|
||||
>Run the VPCS node on the GNS3 VM</mat-radio-button
|
||||
>
|
||||
</mat-radio-group>
|
||||
|
||||
<form [formGroup]="templateNameForm">
|
||||
|
@ -20,9 +20,6 @@ export class AddVpcsTemplateComponent implements OnInit {
|
||||
server: Server;
|
||||
templateName: string = '';
|
||||
templateNameForm: FormGroup;
|
||||
|
||||
isGns3VmAvailable: boolean = false;
|
||||
isGns3VmChosen: boolean = false;
|
||||
isLocalComputerChosen: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -44,19 +41,11 @@ export class AddVpcsTemplateComponent implements OnInit {
|
||||
const server_id = this.route.snapshot.paramMap.get('server_id');
|
||||
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
|
||||
this.server = server;
|
||||
|
||||
this.computeService.getComputes(server).subscribe((computes: Compute[]) => {
|
||||
if (computes.filter((compute) => compute.compute_id === 'vm').length > 0) this.isGns3VmAvailable = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setServerType(serverType: string) {
|
||||
if (serverType === 'gns3 vm' && this.isGns3VmAvailable) {
|
||||
this.isGns3VmChosen = true;
|
||||
this.isLocalComputerChosen = false;
|
||||
} else {
|
||||
this.isGns3VmChosen = false;
|
||||
if (serverType === 'local') {
|
||||
this.isLocalComputerChosen = true;
|
||||
}
|
||||
}
|
||||
@ -76,8 +65,8 @@ export class AddVpcsTemplateComponent implements OnInit {
|
||||
});
|
||||
|
||||
(vpcsTemplate.template_id = uuid()),
|
||||
(vpcsTemplate.name = this.templateName),
|
||||
(vpcsTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local');
|
||||
(vpcsTemplate.name = this.templateName),
|
||||
(vpcsTemplate.compute_id = 'local');
|
||||
|
||||
this.vpcsService.addTemplate(this.server, vpcsTemplate).subscribe(() => {
|
||||
this.goBack();
|
||||
|
Loading…
x
Reference in New Issue
Block a user