| 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">{{'PERFORMACTION' | translate}}</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]="primitiveForm" (ngSubmit)="execNSPrimitive()"> |
| 25 | <div class="modal-body"> |
| 26 | <div class="form-group row"> |
| 27 | <label class="col-sm-4 col-form-label">{{'PRIMITIVETYPE' | translate}}*</label> |
| 28 | <div class="col-sm-8"> |
| 29 | <ng-select (change)="primitiveTypeChange($event)" [clearable]="false" |
| 30 | placeholder="{{'SELECT' | translate}}" [items]="primitiveTypeList" bindLabel="title" |
| 31 | bindValue="value" [(ngModel)]="primitiveType" id="primitiveType" |
| 32 | [ngModelOptions]="{standalone: true}"></ng-select> |
| 33 | </div> |
| 34 | </div> |
| 35 | <div class="form-group row"> |
| 36 | <ng-container *ngIf="primitiveType == 'VNF_Primitive'"> |
| 37 | <label class="col-sm-4 col-form-label">VNF {{'MEMBERINDEX' | translate}}*</label> |
| 38 | <div class="col-sm-3"> |
| 39 | <ng-select (change)="indexChange($event)" [clearable]="false" placeholder="{{'SELECT' | translate}}" |
| 40 | [items]="params.memberIndex" bindLabel="member-vnf-index" bindValue="member-vnf-index" |
| 41 | formControlName="vnf_member_index" id="vnf_member_index" |
| 42 | [ngClass]="{ 'is-invalid': submitted && f.vnf_member_index.errors }"></ng-select> |
| 43 | </div> |
| 44 | </ng-container> |
| 45 | <label [ngClass]="{ 'col-sm-4': primitiveType != 'VNF_Primitive', 'col-sm-2': primitiveType == 'VNF_Primitive' }" class="col-form-label"> |
| 46 | {{'PAGE.NSPRIMITIVE.PRIMITIVE' | translate}}*</label> |
| 47 | <div [ngClass]="{ 'col-sm-8': primitiveType != 'VNF_Primitive', 'col-sm-3': primitiveType == 'VNF_Primitive' }" class="col-sm-3"> |
| 48 | <ng-select (change)="primitiveChange($event)" [clearable]="false" placeholder="{{'SELECT' | translate}}" |
| 49 | [items]="primitiveList" bindLabel="name" bindValue="name" formControlName="primitive" id="primitive" |
| 50 | [ngClass]="{ 'is-invalid': submitted && f.primitive.errors }"></ng-select> |
| 51 | </div> |
| 52 | </div> |
| 53 | <ng-container *ngIf="primitiveParameter.length > 0"> |
| 54 | <div class="form-group row p-2 bg-light text-white justify-content-end"> |
| 55 | <div class="col-5"> |
| 56 | <button type="button" class="btn btn-primary" (click)="createPrimitiveParams()"> |
| 57 | <i class="fas fa-plus-circle"></i> |
| 58 | {{'PAGE.NSPRIMITIVE.ADDPRIMITIVEPARAMS' | translate}}</button> |
| 59 | </div> |
| 60 | </div> |
| 61 | <div formArrayName="primitive_params" *ngFor="let params of getControls(); let i = index;"> |
| 62 | <div class="form-group row" [formGroupName]="i"> |
| 63 | <label class="col-sm-2 col-form-label">{{'NAME' | translate}}:</label> |
| 64 | <div class="col-sm-3"> |
| 65 | <ng-select placeholder="{{'SELECT' | translate}}" [clearable]="false" |
| 66 | [items]="primitiveParameter" bindLabel="name" bindValue="name" |
| 67 | formControlName="primitive_params_name" id="parameter{{i}}" |
| 68 | [ngClass]="{ 'is-invalid': submitted && params.controls.primitive_params_name.errors }"> |
| 69 | </ng-select> |
| 70 | </div> |
| 71 | <div class="col-sm-1"></div> |
| 72 | <label class="col-sm-2 col-form-label">{{'VALUE' | translate}}:</label> |
| 73 | <div class="col-sm-3"> |
| 74 | <input type="text" class="form-control" formControlName="primitive_params_value" |
| 75 | [ngClass]="{ 'is-invalid': submitted && params.controls.primitive_params_value.errors }"> |
| 76 | </div> |
| 77 | <div class="col-sm-1" [hidden]="i==0"> |
| 78 | <button type="button" class="btn btn-sm btn-danger remove-mapping" |
| 79 | (click)="removePrimitiveParams(i)"> |
| 80 | <i class="fas fa-times-circle"></i> |
| 81 | </button> |
| 82 | </div> |
| 83 | </div> |
| 84 | </div> |
| 85 | </ng-container> |
| 86 | </div> |
| 87 | <div class="modal-footer"> |
| 88 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| 89 | <button type="submit" class="btn btn-primary">{{'EXECUTE' | translate}}</button> |
| 90 | </div> |
| 91 | </form> |
| 92 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |