| 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 | <form [formGroup]="instantiateForm" (ngSubmit)="instantiateNsSubmit();"> |
| 19 | <div class="modal-header"> |
| 20 | <h4 class="modal-title" id="modal-basic-title">{{'PAGE.INSTANCEINSTANTIATE.NEWINSTANCE' | translate}}</h4> |
| 21 | <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()"> |
| 22 | <i class="fas fa-times-circle text-danger"></i> |
| 23 | </button> |
| 24 | </div> |
| 25 | <div class="modal-body modal-body-custom-height instantiate-ns"> |
| 26 | <div class="form-group row"> |
| 27 | <label class="col-sm-12 col-form-label mandatory-label" |
| 28 | [ngClass]="{'text-danger': instantiateForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | translate}}</label> |
| 29 | <label class="col-sm-4 col-form-label" |
| 30 | for="nsName">{{'PAGE.INSTANCEINSTANTIATE.NSNAME' | translate}}*</label> |
| 31 | <div class="col-sm-8"> |
| 32 | <input autocomplete="off" class="form-control" |
| 33 | placeholder="{{'PAGE.INSTANCEINSTANTIATE.NSNAME' | translate}}" type="text" formControlName="nsName" |
| 34 | id="nsName" (keydown.space)="$event.preventDefault();" |
| 35 | [ngClass]="{ 'is-invalid': submitted && f.nsName.errors }" required> |
| 36 | </div> |
| 37 | </div> |
| 38 | <div class="form-group row"> |
| 39 | <label class="col-sm-4 col-form-label" |
| 40 | for="nsDescription">{{'PAGE.INSTANCEINSTANTIATE.DESCRIPTION' | translate}}*</label> |
| 41 | <div class="col-sm-8"> |
| 42 | <textarea class="form-control" placeholder="{{'PAGE.INSTANCEINSTANTIATE.DESCRIPTION' | translate}}" |
| 43 | type="text" formControlName="nsDescription" id="nsDescription" |
| 44 | [ngClass]="{ 'is-invalid': submitted && f.nsDescription.errors }" required></textarea> |
| 45 | </div> |
| 46 | </div> |
| 47 | <div class="form-group row"> |
| 48 | <label class="col-sm-4 col-form-label" for="nsdId">{{'PAGE.INSTANCEINSTANTIATE.NSID' | translate}}*</label> |
| 49 | <div class="col-sm-8"> |
| 50 | <ng-select [items]="nsdSelect" bindLabel="name" bindValue="_id" |
| 51 | placeholder="{{'SELECT' | translate}} {{'PAGE.INSTANCEINSTANTIATE.NSID' | translate}}" |
| 52 | formControlName="nsdId" [(ngModel)]="nsdId" id="nsdId" |
| 53 | [ngClass]="{ 'is-invalid': submitted && f.nsdId.errors }" required> |
| 54 | </ng-select> |
| 55 | </div> |
| 56 | </div> |
| 57 | <div class="form-group row"> |
| 58 | <label class="col-sm-4 col-form-label" |
| 59 | for="vimAccountId">{{'PAGE.INSTANCEINSTANTIATE.VIMACCOUNT' | translate}}*</label> |
| 60 | <div class="col-sm-8"> |
| 61 | <ng-select [items]="vimAccountSelect" bindLabel="name" bindValue="_id" |
| 62 | placeholder="{{'SELECT' | translate}} {{'PAGE.INSTANCEINSTANTIATE.VIMACCOUNT' | translate}}" |
| 63 | formControlName="vimAccountId" [(ngModel)]="vimAccountId" id="vimAccountId" |
| 64 | [ngClass]="{ 'is-invalid': submitted && f.vimAccountId.errors }" required> |
| 65 | </ng-select> |
| 66 | </div> |
| 67 | </div> |
| 68 | <div class="form-group row"> |
| 69 | <label class="col-sm-4 col-form-label" |
| 70 | for="ssh_keys">{{'PAGE.INSTANCEINSTANTIATE.SSHKEY' | translate}}</label> |
| 71 | <div class="col-sm-8"> |
| 72 | <textarea class="form-control" placeholder="{{'PAGE.INSTANCEINSTANTIATE.SSHKEYMSG' | translate}}" |
| 73 | formControlName="ssh_keys" id="ssh_keys"></textarea> |
| 74 | <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div> |
| 75 | <div class="custom-file"> |
| 76 | <input type="file" #fileInputSSH class="custom-file-input" (change)="sshFile($event.target.files)" |
| 77 | id="customSSHFile"> |
| 78 | <label class="custom-file-label" #fileInputSSHLabel |
| 79 | for="customSSHFile">{{'CHOOSEFILE' | translate}}</label> |
| 80 | </div> |
| 81 | </div> |
| 82 | </div> |
| 83 | <div class="form-group row"> |
| 84 | <label class="col-sm-4 col-form-label" for="config">{{'CONFIG' | translate}}</label> |
| 85 | <div class="col-sm-8"> |
| 86 | <textarea class="form-control" placeholder="{{'YAMLCONFIG' | translate}}" formControlName="config" |
| 87 | id="config"></textarea> |
| 88 | <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div> |
| 89 | <div class="custom-file"> |
| 90 | <input type="file" #fileInputConfig class="custom-file-input" |
| 91 | (change)="configFile($event.target.files)" id="customConfigFile"> |
| 92 | <label class="custom-file-label" #fileInputConfigLabel |
| 93 | for="customConfigFile">{{'CHOOSEFILE' | translate}}</label> |
| 94 | </div> |
| 95 | </div> |
| 96 | </div> |
| 97 | </div> |
| 98 | <div class="modal-footer"> |
| 99 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| 100 | <button type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button> |
| 101 | </div> |
| 102 | </form> |
| 103 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |