| 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> |
| Barath Kumar R | 5d75d51 | 2020-09-02 17:00:07 +0530 | [diff] [blame] | 24 | <form [formGroup]="primitiveForm" (ngSubmit)="execPrimitive()"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 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"> |
| Barath Kumar R | 5d75d51 | 2020-09-02 17:00:07 +0530 | [diff] [blame] | 29 | <ng-select (change)="primitiveTypeChange($event)" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="primitiveTypeList" bindLabel="title" bindValue="value" [(ngModel)]="primitiveType" id="primitiveType" [ngModelOptions]="{standalone: true}" |
| Barath Kumar R | d3ce0c5 | 2020-08-13 11:44:01 +0530 | [diff] [blame] | 30 | [ngClass]="{ 'is-invalid': submitted && !primitiveType }"></ng-select> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 31 | </div> |
| 32 | </div> |
| Barath Kumar R | 5d75d51 | 2020-09-02 17:00:07 +0530 | [diff] [blame] | 33 | <div class="form-group row" *ngIf="primitiveType === 'VNF_Primitive' || primitiveType === 'VDU_Primitive' || primitiveType === 'KDU_Primitive'"> |
| Barath Kumar R | 063a3f1 | 2020-12-29 16:35:09 +0530 | [diff] [blame^] | 34 | <label class="col-sm-4 col-form-label">VNF Profile ID *</label> |
| Barath Kumar R | 6e96d1b | 2020-07-10 12:10:15 +0530 | [diff] [blame] | 35 | <div class="col-sm-3"> |
| Barath Kumar R | 063a3f1 | 2020-12-29 16:35:09 +0530 | [diff] [blame^] | 36 | <ng-select (change)="indexChange($event, primitiveType)" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="params.memberIndex[0]['vnf-profile']" bindLabel="id" bindValue="id" formControlName="member_vnf_index" id="member_vnf_index" |
| 37 | [ngClass]="{ 'is-invalid': submitted && f.member_vnf_index.errors }"></ng-select> |
| Barath Kumar R | 6e96d1b | 2020-07-10 12:10:15 +0530 | [diff] [blame] | 38 | </div> |
| 39 | </div> |
| 40 | <div class="form-group row" *ngIf="primitiveType === 'VDU_Primitive'"> |
| 41 | <label class="col-sm-4 col-form-label">{{'SELECT' | translate}} VDU *</label> |
| 42 | <div class="col-sm-8"> |
| Barath Kumar R | 5d75d51 | 2020-09-02 17:00:07 +0530 | [diff] [blame] | 43 | <ng-select (change)="getPrimitiveList($event, 'vdu')" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="vduList" bindLabel="name" bindValue="id" formControlName="vdu_id" id="vdu_id" [ngClass]="{ 'is-invalid': submitted && f.vdu_id.errors }"></ng-select> |
| 44 | </div> |
| 45 | </div> |
| 46 | <div class="form-group row" *ngIf="primitiveType === 'KDU_Primitive'"> |
| 47 | <label class="col-sm-4 col-form-label">{{'SELECT' | translate}} KDU *</label> |
| 48 | <div class="col-sm-8"> |
| 49 | <ng-select (change)="getPrimitiveList($event, 'kdu')" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="kduList" bindLabel="name" bindValue="name" formControlName="kdu_name" id="kdu_name" [ngClass]="{ 'is-invalid': submitted && f.kdu_name.errors }"></ng-select> |
| Barath Kumar R | 6e96d1b | 2020-07-10 12:10:15 +0530 | [diff] [blame] | 50 | </div> |
| 51 | </div> |
| Barath Kumar R | 54d693c | 2020-07-13 20:54:13 +0530 | [diff] [blame] | 52 | <div class="form-group row" *ngIf="primitiveType"> |
| Barath Kumar R | 6e96d1b | 2020-07-10 12:10:15 +0530 | [diff] [blame] | 53 | <label class="col-sm-4 col-form-label"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 54 | {{'PAGE.NSPRIMITIVE.PRIMITIVE' | translate}}*</label> |
| Barath Kumar R | 6e96d1b | 2020-07-10 12:10:15 +0530 | [diff] [blame] | 55 | <div class="col-sm-8"> |
| Barath Kumar R | 5d75d51 | 2020-09-02 17:00:07 +0530 | [diff] [blame] | 56 | <ng-select (change)="primitiveChange($event)" [clearable]="false" placeholder="{{'SELECT' | translate}}" [items]="primitiveList" bindLabel="name" bindValue="name" formControlName="primitive" id="primitive" [ngClass]="{ 'is-invalid': submitted && f.primitive.errors }"></ng-select> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 57 | </div> |
| 58 | </div> |
| 59 | <ng-container *ngIf="primitiveParameter.length > 0"> |
| 60 | <div class="form-group row p-2 bg-light text-white justify-content-end"> |
| 61 | <div class="col-5"> |
| 62 | <button type="button" class="btn btn-primary" (click)="createPrimitiveParams()"> |
| 63 | <i class="fas fa-plus-circle"></i> |
| 64 | {{'PAGE.NSPRIMITIVE.ADDPRIMITIVEPARAMS' | translate}}</button> |
| 65 | </div> |
| 66 | </div> |
| 67 | <div formArrayName="primitive_params" *ngFor="let params of getControls(); let i = index;"> |
| 68 | <div class="form-group row" [formGroupName]="i"> |
| 69 | <label class="col-sm-2 col-form-label">{{'NAME' | translate}}:</label> |
| 70 | <div class="col-sm-3"> |
| Barath Kumar R | 5d75d51 | 2020-09-02 17:00:07 +0530 | [diff] [blame] | 71 | <ng-select placeholder="{{'SELECT' | translate}}" [clearable]="false" [items]="primitiveParameter" bindLabel="name" bindValue="name" formControlName="primitive_params_name" id="parameter{{i}}" [ngClass]="{ 'is-invalid': submitted && params.controls.primitive_params_name.errors }"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 72 | </ng-select> |
| 73 | </div> |
| 74 | <div class="col-sm-1"></div> |
| 75 | <label class="col-sm-2 col-form-label">{{'VALUE' | translate}}:</label> |
| 76 | <div class="col-sm-3"> |
| Barath Kumar R | 5d75d51 | 2020-09-02 17:00:07 +0530 | [diff] [blame] | 77 | <input type="text" class="form-control" formControlName="primitive_params_value" [ngClass]="{ 'is-invalid': submitted && params.controls.primitive_params_value.errors }"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 78 | </div> |
| 79 | <div class="col-sm-1" [hidden]="i==0"> |
| Barath Kumar R | 5d75d51 | 2020-09-02 17:00:07 +0530 | [diff] [blame] | 80 | <button type="button" class="btn btn-sm btn-danger remove-mapping" (click)="removePrimitiveParams(i)"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 81 | <i class="fas fa-times-circle"></i> |
| 82 | </button> |
| 83 | </div> |
| 84 | </div> |
| 85 | </div> |
| 86 | </ng-container> |
| 87 | </div> |
| 88 | <div class="modal-footer"> |
| 89 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| 90 | <button type="submit" class="btn btn-primary">{{'EXECUTE' | translate}}</button> |
| 91 | </div> |
| 92 | </form> |
| 93 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |