Removing console errors from built-in, dynampis, docker

This commit is contained in:
Piotr Pekala 2019-07-02 01:53:09 -07:00
parent f1f2b5b40d
commit 7fab6fade6
10 changed files with 18 additions and 18 deletions

View File

@ -8,7 +8,7 @@
<mat-card class="matCard">
<form [formGroup]="formGroup">
<mat-form-field class="form-field">
<input formControlName="templateName" matInput type="text" [(ngModel)]="templateName" placeholder="Template name">
<input formControlName="templateName" matInput type="text" placeholder="Template name">
</mat-form-field>
</form>
</mat-card>

View File

@ -54,7 +54,7 @@ export class CloudNodesAddTemplateComponent implements OnInit {
});
cloudTemplate.template_id = uuid();
cloudTemplate.name = this.templateName;
cloudTemplate.name = this.formGroup.get('templateName').value;
this.builtInTemplatesService.addTemplate(this.server, cloudTemplate).subscribe((cloudNodeTemplate) => {
this.goBack();

View File

@ -8,10 +8,10 @@
<mat-card class="matCard">
<form [formGroup]="formGroup">
<mat-form-field class="form-field">
<input formControlName="templateName" matInput type="text" [(ngModel)]="templateName" placeholder="Template name">
<input formControlName="templateName" matInput type="text" placeholder="Template name">
</mat-form-field>
<mat-form-field class="form-field">
<input formControlName="numberOfPorts" matInput type="text" [(ngModel)]="numberOfPorts" placeholder="Number of ports">
<input formControlName="numberOfPorts" matInput type="text" placeholder="Number of ports">
</mat-form-field>
</form>
</mat-card>

View File

@ -56,9 +56,9 @@ export class EthernetHubsAddTemplateComponent implements OnInit {
});
ethernetHubTemplate.template_id = uuid();
ethernetHubTemplate.name = this.templateName;
ethernetHubTemplate.name = this.formGroup.get('templateName').value;
for(let i=0; i<this.numberOfPorts; i++){
for(let i=0; i<this.formGroup.get('numberOfPorts').value; i++){
ethernetHubTemplate.ports_mapping.push({
name: `Ethernet${i}`,
port_number: i

View File

@ -8,7 +8,7 @@
<mat-card class="matCard">
<form [formGroup]="formGroup">
<mat-form-field class="form-field">
<input formControlName="templateName" matInput type="text" [(ngModel)]="templateName" placeholder="Template name">
<input formControlName="templateName" matInput type="text" placeholder="Template name">
</mat-form-field>
</form>
</mat-card>

View File

@ -56,7 +56,7 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
});
ethernetSwitchTemplate.template_id = uuid();
ethernetSwitchTemplate.name = this.templateName;
ethernetSwitchTemplate.name = this.formGroup.get('templateName').value;
for(let i=0; i<this.numberOfPorts; i++){
ethernetSwitchTemplate.ports_mapping.push({

View File

@ -34,7 +34,6 @@
matInput
class="filename"
type="text"
[(ngModel)]="dockerTemplate.image"
formControlName="filename"
placeholder="Image name"/>
</mat-form-field>
@ -48,7 +47,6 @@
matInput
class="templatename"
type="text"
[(ngModel)]="dockerTemplate.name"
formControlName="templateName"
placeholder="Container name"/>
</mat-form-field>
@ -61,7 +59,6 @@
matInput
class="networkadapter"
type="number"
[(ngModel)]="dockerTemplate.adapters"
formControlName="adapters"
placeholder="Adapters"/>
</mat-form-field>

View File

@ -87,6 +87,9 @@ export class AddDockerTemplateComponent implements OnInit {
addTemplate() {
if ((!this.virtualMachineForm.invalid || !this.newImageSelected) && !this.containerNameForm.invalid && !this.networkAdaptersForm.invalid) {
this.dockerTemplate.template_id = uuid();
this.dockerTemplate.image = this.virtualMachineForm.get('filename').value;
this.dockerTemplate.name = this.containerNameForm.get('templateName').value;
this.dockerTemplate.adapters = this.networkAdaptersForm.get('adapters').value;
this.dockerService.addTemplate(this.server, this.dockerTemplate).subscribe((template: DockerTemplate) => {
this.goBack();

View File

@ -12,7 +12,6 @@
<mat-form-field class="form-field">
<input
matInput type="text"
[(ngModel)]="iosTemplate.image"
formControlName="imageName"
placeholder="IOS image"/>
</mat-form-field>
@ -23,7 +22,6 @@
<mat-form-field class="form-field">
<input
matInput type="text"
[(ngModel)]="iosTemplate.name"
formControlName="templateName"
placeholder="Name"/>
</mat-form-field>
@ -31,8 +29,7 @@
<mat-select
placeholder="Platform"
(selectionChange)="onPlatformChosen($event)"
formControlName="platform"
[(ngModel)]="iosTemplate.platform">
formControlName="platform">
<mat-option *ngFor="let platform of platforms" [value]="platform">
{{platform}}
</mat-option>
@ -42,8 +39,7 @@
<mat-select
placeholder="Chassis"
(selectionChange)="onChassisChosen($event)"
formControlName="chassis"
[(ngModel)]="iosTemplate.chassis">
formControlName="chassis">
<mat-option *ngFor="let chassis of chassis[iosTemplate.platform]" [value]="chassis">
{{chassis}}
</mat-option>
@ -61,7 +57,6 @@
<mat-form-field class="form-field">
<input
matInput type="number"
[(ngModel)]="iosTemplate.ram"
formControlName="memory"
value="defaultRam[iosTemplate.platform]"
placeholder="Default RAM"/>

View File

@ -90,6 +90,11 @@ export class AddIosTemplateComponent implements OnInit {
addTemplate() {
if (!this.iosImageForm.invalid && !this.iosNameForm.invalid && !this.iosMemoryForm.invalid) {
this.iosTemplate.template_id = uuid();
this.iosTemplate.image = this.iosImageForm.get("imageName").value;
this.iosTemplate.name = this.iosNameForm.get('templateName').value;
this.iosTemplate.platform = this.iosNameForm.get('platform').value;
this.iosTemplate.chassis = this.iosNameForm.get('chassis').value;
this.iosTemplate.ram = this.iosMemoryForm.get('memory').value;
if (this.isEtherSwitchRouter) {
this.iosTemplate.symbol = ":/symbols/multilayer_switch.svg";