| 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]="vimNewAccountForm" (ngSubmit)="newVimAccountSubmit()" autocomplete="off"> |
| 19 | <div class="row d-flex flex-row justify-content-between"> |
| 20 | <div class="d-flex align-items-center header-style">{{'PAGE.VIMDETAILS.NEWVIMACCOUNT' | translate}} </div> |
| 21 | </div> |
| 22 | <div class="context-style bg-white p-3"> |
| 23 | <div class="row form-group content-style"> |
| 24 | <label class="col-sm-12 col-form-label mandatory-label" |
| Barath Kumar R | 1245fc8 | 2021-04-16 13:34:06 +0530 | [diff] [blame] | 25 | [ngClass]="{'text-danger': vimNewAccountForm.invalid === true && submitted === true}"> |
| 26 | {{'MANDATORYCHECK' | translate}} |
| 27 | </label> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 28 | <div class="col-sm-3"> |
| 29 | <label for="name">{{'PAGE.VIMDETAILS.NAME' | translate}}*</label> |
| 30 | </div> |
| 31 | <div class="col-sm-3"> |
| 32 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.VIMDETAILS.NAME' | translate}}" |
| 33 | type="text" formControlName="name" id="name" |
| 34 | [ngClass]="{ 'is-invalid': submitted && f.name.errors }"> |
| 35 | </div> |
| 36 | <div class="col-sm-3"> |
| 37 | <label for="vim_tenant_name">{{'PAGE.VIMDETAILS.TENANTNAME' | translate}}*</label> |
| 38 | </div> |
| 39 | <div class="col-sm-3"> |
| 40 | <input autocomplete="off" class="form-control" |
| 41 | placeholder="{{'PAGE.VIMDETAILS.TENANTNAME' | translate}}" type="text" |
| 42 | formControlName="vim_tenant_name" id="vim_tenant_name" |
| 43 | [ngClass]="{ 'is-invalid': submitted && f.vim_tenant_name.errors }"> |
| 44 | </div> |
| 45 | </div> |
| 46 | <div class="row form-group content-style"> |
| 47 | <div class="col-sm-3"> |
| 48 | <label for="vim_type">{{'PAGE.VIMDETAILS.VIMTYPE' | translate}}*</label> |
| 49 | </div> |
| 50 | <div class="col-sm-3"> |
| 51 | <ng-select bindLabel="title" bindValue="value" [items]="vimType" placeholder="{{'SELECT' | translate}}" |
| Barath Kumar R | 1245fc8 | 2021-04-16 13:34:06 +0530 | [diff] [blame] | 52 | formControlName="vim_type" id="vim_type" [(ngModel)]="selectedVimType" |
| 53 | [addTag]="sharedService.addCustomTag" [ngClass]="{ 'is-invalid': submitted && f.vim_type.errors }" |
| 54 | (change)="clearConfig()"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 55 | </ng-select> |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 56 | <small class="text-info">{{'TYPEINFO' | translate}}</small> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 57 | </div> |
| 58 | <div class="col-sm-3"> |
| 59 | <label for="description">{{'PAGE.VIMDETAILS.DESCRIPTION' | translate}}</label> |
| 60 | </div> |
| 61 | <div class="col-sm-3"> |
| 62 | <textarea class="form-control" placeholder="{{'PAGE.VIMDETAILS.DESCRIPTION' | translate}}" type="text" |
| 63 | formControlName="description" id="description"></textarea> |
| 64 | </div> |
| 65 | </div> |
| 66 | <div class="row form-group content-style"> |
| 67 | <div class="col-sm-3"> |
| 68 | <label for="vim_url">{{'PAGE.VIMDETAILS.VIMURL' | translate}}*</label> |
| 69 | </div> |
| 70 | <div class="col-sm-3"> |
| 71 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.VIMDETAILS.VIMURL' | translate}}" |
| 72 | type="url" formControlName="vim_url" id="vim_url" |
| 73 | [ngClass]="{ 'is-invalid': submitted && f.vim_url.errors }"> |
| 74 | <div *ngIf="vimNewAccountForm.invalid" class="invalid-feedback"> |
| 75 | <div *ngIf="f.vim_url.errors && f.vim_url.value">{{'DOMVALIDATIONS.INVALIDURL' | translate}}</div> |
| 76 | </div> |
| 77 | </div> |
| 78 | <div class="col-sm-3"> |
| 79 | <label for="schema_type">{{'PAGE.VIMDETAILS.SCHEMATYPE' | translate}}</label> |
| 80 | </div> |
| 81 | <div class="col-sm-3"> |
| 82 | <input autocomplete="off" class="form-control" |
| 83 | placeholder="{{'PAGE.VIMDETAILS.SCHEMATYPE' | translate}}" type="text" formControlName="schema_type" |
| 84 | id="schema_type"> |
| 85 | </div> |
| 86 | </div> |
| 87 | <div class="row form-group content-style"> |
| 88 | <div class="col-sm-3"> |
| 89 | <label for="vim_user">{{'PAGE.VIMDETAILS.VIMUSERNAME' | translate}}*</label> |
| 90 | </div> |
| 91 | <div class="col-sm-3"> |
| 92 | <input autocomplete="off" class="form-control" |
| 93 | placeholder="{{'PAGE.VIMDETAILS.VIMUSERNAME' | translate}}" type="text" formControlName="vim_user" |
| 94 | id="vim_user" [ngClass]="{ 'is-invalid': submitted && f.vim_user.errors }"> |
| 95 | </div> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 96 | <div class="col-sm-3"> |
| 97 | <label for="vim_password">{{'PAGE.VIMDETAILS.VIMPASSWORD' | translate}}*</label> |
| 98 | </div> |
| 99 | <div class="col-sm-3"> |
| 100 | <input autocomplete="off" class="form-control" placeholder="VIM Password" type="password" |
| 101 | formControlName="vim_password" id="vim_password" |
| 102 | [ngClass]="{ 'is-invalid': submitted && f.vim_password.errors }"> |
| 103 | </div> |
| 104 | </div> |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 105 | <div class="row form-group content-style"> |
| 106 | <div class="col-sm-3"> |
| 107 | <label for="location">{{'PAGE.VIMDETAILS.VIMLOCATION' | translate}}</label> |
| 108 | </div> |
| Barath Kumar R | 1245fc8 | 2021-04-16 13:34:06 +0530 | [diff] [blame] | 109 | <div class="col-sm-9 form-inline"> |
| 110 | <div class="input-group"> |
| 111 | <input autocomplete="off" formControlName="locationName" type="text" class="form-control" |
| 112 | placeholder="{{'PAGE.VIMDETAILS.NAME' | translate}}" |
| 113 | [ngClass]="{ 'is-invalid': submitted && f.locationName.errors }"> |
| 114 | <input autocomplete="off" formControlName="latitude" type="text" class="form-control" |
| 115 | placeholder="Latitude" [ngClass]="{ 'is-invalid': submitted && f.latitude.errors }"> |
| 116 | <input autocomplete="off" formControlName="longitude" type="text" class="form-control" |
| 117 | placeholder="Longitude" [ngClass]="{ 'is-invalid': submitted && f.longitude.errors }"> |
| 118 | </div> |
| 119 | <small class="text-info mt-1 ml-1">{{'PAGE.VIM.LOCATIONINFO' | translate}}</small> |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 120 | </div> |
| Barath Kumar R | 1245fc8 | 2021-04-16 13:34:06 +0530 | [diff] [blame] | 121 | </div> |
| 122 | <div class="row form-group content-style"> |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 123 | <div class="col-sm-3"> |
| 124 | <label>{{'UPLOADCONFIG' | translate}}</label> |
| 125 | </div> |
| 126 | <div class="col-sm-3 form-group"> |
| 127 | <div class="custom-file"> |
| 128 | <input [disabled]="!selectedVimType" type="file" #fileInput class="custom-file-input" |
| 129 | (change)="filesDropped($event.target.files)" id="customFile"> |
| Barath Kumar R | 1245fc8 | 2021-04-16 13:34:06 +0530 | [diff] [blame] | 130 | <label class="custom-file-label" #fileInputLabel for="customFile"> |
| 131 | {{'CHOOSEFILE' | translate}} |
| 132 | </label> |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 133 | </div> |
| 134 | <small class="text-info">{{'UPLOADCONFIGLABEL' | translate}}</small> |
| 135 | </div> |
| 136 | </div> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 137 | <div class="row" [hidden]="!selectedVimType"> |
| 138 | <div class="col-12"> |
| 139 | <button type="button" class="btn btn-block border-0 bg-light text-dark" |
| 140 | (click)="isCollapsed = !isCollapsed" |
| 141 | [attr.aria-expanded]="!isCollapsed">{{'PAGE.VIMDETAILS.CONFIGPARAMETERS' | translate}}</button> |
| 142 | </div> |
| 143 | </div> |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 144 | <div id="configurationparameters" class="row collapse mt-3" [ngbCollapse]="isCollapsed"> |
| 145 | <div class="col-sm-12"> |
| 146 | <div class="ngx-codemirror new-vim" [hidden]="!selectedVimType"> |
| 147 | <div class="form-group"> |
| 148 | <button type="button" class="btn btn-warning btn-sm mr-3" (click)="loadSampleConfig()"> |
| 149 | <i class="fa fa-clone" aria-hidden="true"></i> |
| 150 | {{'PAGE.VIMDETAILS.LOADSAMPLECONFIG' | translate}}</button> |
| 151 | <button type="button" class="btn btn-danger btn-sm" (click)="clearConfig()"> |
| 152 | <i class="fa fa-times-circle" aria-hidden="true"></i> |
| 153 | {{'PAGE.VIMDETAILS.CLEARCONFIG' | translate}}</button> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 154 | </div> |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 155 | <ngx-codemirror [options]="options" [ngModel]="defaults[mode]" [autoFocus]="true" |
| 156 | (ngModelChange)="handleChange($event)" [ngModelOptions]="{standalone: true}"> |
| 157 | </ngx-codemirror> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 158 | </div> |
| 159 | </div> |
| 160 | </div> |
| Barath Kumar R | d477b85 | 2020-07-07 15:24:05 +0530 | [diff] [blame] | 161 | <div class="modal-footer border-0"> |
| 162 | <button type="button" (click)="onVimAccountBack()" |
| 163 | class="btn btn-danger">{{'PAGE.VIMDETAILS.BACKTOVIMACCOUNTS' | translate}}</button> |
| 164 | <button type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button> |
| 165 | </div> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 166 | </div> |
| 167 | </form> |
| 168 | <app-loader [waitingMessage]="message" *ngIf="isLocationLoadingResults"></app-loader> |