| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | <!-- |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | --> |
| 18 | <div class="modal-header"> |
| 19 | <h4 class="modal-title" id="modal-basic-title">{{title}}</h4> |
| 20 | <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()"> |
| 21 | <i class="fas fa-times-circle text-danger"></i> |
| 22 | </button> |
| 23 | </div> |
| 24 | <form [formGroup]="pduInstancesForm" (ngSubmit)="createPDUInstances()" autocomplete="off"> |
| 25 | <div class="modal-body"> |
| 26 | <div class="form-group row"> |
| 27 | <label class="col-sm-12 col-form-label mandatory-label" [ngClass]="{'text-danger': pduInstancesForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | translate}}</label> |
| 28 | <label class="col-sm-3 col-form-label" for="name">{{'NAME' | translate}}*</label> |
| 29 | <div class="col-sm-3"> |
| 30 | <input placeholder="{{'NAME' | translate}}" type="text" class="form-control" formControlName="name" id="name" [ngClass]="{ 'is-invalid': submitted && f.name.errors }" |
| 31 | required> |
| 32 | </div> |
| 33 | <label class="col-sm-3 col-form-label" for="type">{{'PAGE.PDUINSTANCE.PDUTYPE' | translate}}*</label> |
| 34 | <div class="col-sm-3"> |
| 35 | <input placeholder="{{'PAGE.PDUINSTANCE.PDUTYPE' | translate}}" type="text" class="form-control" formControlName="type" id="type" [ngClass]="{ 'is-invalid': submitted && f.type.errors }"> |
| 36 | </div> |
| 37 | </div> |
| 38 | <div class="form-group row"> |
| 39 | <label class="col-sm-3 col-form-label" for="vim_accounts">{{'VIMACCOUNTS' | translate}}*</label> |
| 40 | <div class="col-sm-9"> |
| 41 | <ng-select placeholder="{{'VIMACCOUNTS' | translate}}" [items]="vimAccountSelect" multiple="true" bindLabel="name" bindValue="_id" formControlName="vim_accounts" id="vim_accounts" |
| 42 | [ngClass]="{ 'is-invalid': submitted && f.vim_accounts.errors }" [(ngModel)]="selectedVIM"> |
| 43 | </ng-select> |
| 44 | </div> |
| 45 | </div> |
| 46 | <div class="form-group row p-2 bg-light text-dark"> |
| 47 | <div class="col-sm-7 align-self-center"><span>{{'PAGE.PDUINSTANCE.PARAMETERS' | translate}}</span></div> |
| 48 | <div class="col-sm-5"> |
| 49 | <button type="button" class="btn btn-primary" (click)="createInterfaces()"> |
| 50 | <i class="fas fa-plus-square"></i> {{'PAGE.PDUINSTANCE.ADDINSTANCEPARAMS' | translate}}</button> |
| 51 | </div> |
| 52 | </div> |
| 53 | <div formArrayName="interfaces" *ngFor="let params of getControls(); let i = index;"> |
| 54 | <div class="form-group" [formGroupName]="i"> |
| 55 | <div class="row"> |
| 56 | <div class="col-sm-11"> |
| 57 | <div class="row"> |
| 58 | <label class="col-sm-2 col-form-label" for="name_{{i}}">{{'NAME' | translate}}*</label> |
| 59 | <div class="col-sm-4"> |
| 60 | <input placeholder="{{'NAME' | translate}}" type="text" class="form-control" formControlName="name" id="name_{{i}}" [ngClass]="{ 'is-invalid': submitted && params.controls.name.errors }"> |
| 61 | </div> |
| 62 | <label class="col-sm-2 col-form-label padLeft0 padRight0" for="ipAddress{{i}}">{{'IPADDRESS' | translate}}*</label> |
| 63 | <div class="col-sm-4"> |
| 64 | <input placeholder="{{'IPADDRESS' | translate}}" type="text" class="form-control" formControlName="ip-address" id="ipAddress{{i}}" [ngClass]="{ 'is-invalid': submitted && params.controls['ip-address'].errors }"> |
| 65 | <div *ngIf="pduInstancesForm.invalid" class="invalid-feedback"> |
| 66 | <div *ngIf="params.controls['ip-address'].errors && params.controls['ip-address'].value">{{'DOMVALIDATIONS.INVALIDIPADDRESS' | translate}}</div> |
| 67 | </div> |
| 68 | </div> |
| 69 | </div> |
| 70 | <div class="row mr-top-5"> |
| 71 | <label class="col-sm-2 col-form-label" for="mgmt{{i}}">{{'MGMT' | translate}}*</label> |
| 72 | <div class="col-sm-4"> |
| SANDHYA.JS | 5030d1f | 2022-04-26 17:59:39 +0530 | [diff] [blame^] | 73 | <ng-select placeholder="{{'SELECT' | translate}} {{'MGMT' | translate}}" [items]="mgmtState" bindLabel="name" bindValue="value" formControlName="mgmt" id="mgmt{{i}}" [ngClass]="{ 'is-invalid': submitted && params.controls.mgmt.errors }"></ng-select> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 74 | </div> |
| 75 | <label class="col-sm-2 col-form-label padLeft0 padRight0" for="vimNetName{{i}}">{{'NETNAME' | translate}}*</label> |
| 76 | <div class="col-sm-4"> |
| 77 | <input placeholder="{{'NETNAME' | translate}}" type="text" class="form-control" formControlName="vim-network-name" id="vimNetName{{i}}" [ngClass]="{ 'is-invalid': submitted && params.controls['vim-network-name'].errors }"> |
| 78 | </div> |
| 79 | </div> |
| 80 | </div> |
| 81 | <div class="col-sm-1 remove-params" [hidden]="i==0"> |
| 82 | <button type="button" class="btn btn-sm btn-danger remove-mapping" (click)="removeInterfaces(i)"> |
| 83 | <i class="fas fa-times-circle"></i> |
| 84 | </button> |
| 85 | </div> |
| 86 | </div> |
| 87 | </div> |
| 88 | </div> |
| 89 | </div> |
| 90 | <div class="modal-footer"> |
| 91 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| 92 | <button type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button> |
| 93 | </div> |
| 94 | </form> |
| 95 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |