blob: 7720afa6842e67f6a67efda6b0e477844f67b791 [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301<!--
2Copyright 2020 TATA ELXSI
3
4Licensed under the Apache License, Version 2.0 (the 'License');
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15
16Author: 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">
SANDHYA.JS2cac4722023-10-11 16:29:27 +053020 <div *ngIf="vimID;else empty" class="d-flex align-items-center header-style">{{'PAGE.VIMDETAILS.EDITVIMACCOUNT'
21 | translate}} </div>
22 <ng-template #empty>
23 <div class="d-flex align-items-center header-style">{{'PAGE.VIMDETAILS.NEWVIMACCOUNT' | translate}} </div>
24 </ng-template>
kumaran.m3b4814a2020-05-01 19:48:54 +053025 </div>
26 <div class="context-style bg-white p-3">
27 <div class="row form-group content-style">
28 <label class="col-sm-12 col-form-label mandatory-label"
Barath Kumar R1245fc82021-04-16 13:34:06 +053029 [ngClass]="{'text-danger': vimNewAccountForm.invalid === true && submitted === true}">
30 {{'MANDATORYCHECK' | translate}}
31 </label>
kumaran.m3b4814a2020-05-01 19:48:54 +053032 <div class="col-sm-3">
33 <label for="name">{{'PAGE.VIMDETAILS.NAME' | translate}}*</label>
34 </div>
35 <div class="col-sm-3">
36 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.VIMDETAILS.NAME' | translate}}"
37 type="text" formControlName="name" id="name"
38 [ngClass]="{ 'is-invalid': submitted && f.name.errors }">
39 </div>
40 <div class="col-sm-3">
41 <label for="vim_tenant_name">{{'PAGE.VIMDETAILS.TENANTNAME' | translate}}*</label>
42 </div>
43 <div class="col-sm-3">
44 <input autocomplete="off" class="form-control"
45 placeholder="{{'PAGE.VIMDETAILS.TENANTNAME' | translate}}" type="text"
46 formControlName="vim_tenant_name" id="vim_tenant_name"
47 [ngClass]="{ 'is-invalid': submitted && f.vim_tenant_name.errors }">
48 </div>
49 </div>
50 <div class="row form-group content-style">
51 <div class="col-sm-3">
52 <label for="vim_type">{{'PAGE.VIMDETAILS.VIMTYPE' | translate}}*</label>
53 </div>
54 <div class="col-sm-3">
55 <ng-select bindLabel="title" bindValue="value" [items]="vimType" placeholder="{{'SELECT' | translate}}"
Barath Kumar R1245fc82021-04-16 13:34:06 +053056 formControlName="vim_type" id="vim_type" [(ngModel)]="selectedVimType"
57 [addTag]="sharedService.addCustomTag" [ngClass]="{ 'is-invalid': submitted && f.vim_type.errors }"
58 (change)="clearConfig()">
kumaran.m3b4814a2020-05-01 19:48:54 +053059 </ng-select>
Barath Kumar Rd477b852020-07-07 15:24:05 +053060 <small class="text-info">{{'TYPEINFO' | translate}}</small>
kumaran.m3b4814a2020-05-01 19:48:54 +053061 </div>
62 <div class="col-sm-3">
63 <label for="description">{{'PAGE.VIMDETAILS.DESCRIPTION' | translate}}</label>
64 </div>
65 <div class="col-sm-3">
66 <textarea class="form-control" placeholder="{{'PAGE.VIMDETAILS.DESCRIPTION' | translate}}" type="text"
67 formControlName="description" id="description"></textarea>
68 </div>
69 </div>
70 <div class="row form-group content-style">
71 <div class="col-sm-3">
72 <label for="vim_url">{{'PAGE.VIMDETAILS.VIMURL' | translate}}*</label>
73 </div>
74 <div class="col-sm-3">
75 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.VIMDETAILS.VIMURL' | translate}}"
76 type="url" formControlName="vim_url" id="vim_url"
77 [ngClass]="{ 'is-invalid': submitted && f.vim_url.errors }">
78 <div *ngIf="vimNewAccountForm.invalid" class="invalid-feedback">
79 <div *ngIf="f.vim_url.errors && f.vim_url.value">{{'DOMVALIDATIONS.INVALIDURL' | translate}}</div>
80 </div>
81 </div>
82 <div class="col-sm-3">
83 <label for="schema_type">{{'PAGE.VIMDETAILS.SCHEMATYPE' | translate}}</label>
84 </div>
85 <div class="col-sm-3">
86 <input autocomplete="off" class="form-control"
87 placeholder="{{'PAGE.VIMDETAILS.SCHEMATYPE' | translate}}" type="text" formControlName="schema_type"
88 id="schema_type">
89 </div>
90 </div>
91 <div class="row form-group content-style">
92 <div class="col-sm-3">
93 <label for="vim_user">{{'PAGE.VIMDETAILS.VIMUSERNAME' | translate}}*</label>
94 </div>
95 <div class="col-sm-3">
96 <input autocomplete="off" class="form-control"
97 placeholder="{{'PAGE.VIMDETAILS.VIMUSERNAME' | translate}}" type="text" formControlName="vim_user"
98 id="vim_user" [ngClass]="{ 'is-invalid': submitted && f.vim_user.errors }">
99 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +0530100 <div class="col-sm-3">
101 <label for="vim_password">{{'PAGE.VIMDETAILS.VIMPASSWORD' | translate}}*</label>
102 </div>
103 <div class="col-sm-3">
104 <input autocomplete="off" class="form-control" placeholder="VIM Password" type="password"
105 formControlName="vim_password" id="vim_password"
106 [ngClass]="{ 'is-invalid': submitted && f.vim_password.errors }">
107 </div>
108 </div>
Barath Kumar Rd477b852020-07-07 15:24:05 +0530109 <div class="row form-group content-style">
110 <div class="col-sm-3">
111 <label for="location">{{'PAGE.VIMDETAILS.VIMLOCATION' | translate}}</label>
112 </div>
Barath Kumar R1245fc82021-04-16 13:34:06 +0530113 <div class="col-sm-9 form-inline">
114 <div class="input-group">
115 <input autocomplete="off" formControlName="locationName" type="text" class="form-control"
116 placeholder="{{'PAGE.VIMDETAILS.NAME' | translate}}"
117 [ngClass]="{ 'is-invalid': submitted && f.locationName.errors }">
118 <input autocomplete="off" formControlName="latitude" type="text" class="form-control"
119 placeholder="Latitude" [ngClass]="{ 'is-invalid': submitted && f.latitude.errors }">
120 <input autocomplete="off" formControlName="longitude" type="text" class="form-control"
121 placeholder="Longitude" [ngClass]="{ 'is-invalid': submitted && f.longitude.errors }">
122 </div>
123 <small class="text-info mt-1 ml-1">{{'PAGE.VIM.LOCATIONINFO' | translate}}</small>
Barath Kumar Rd477b852020-07-07 15:24:05 +0530124 </div>
Barath Kumar R1245fc82021-04-16 13:34:06 +0530125 </div>
126 <div class="row form-group content-style">
Barath Kumar Rd477b852020-07-07 15:24:05 +0530127 <div class="col-sm-3">
128 <label>{{'UPLOADCONFIG' | translate}}</label>
129 </div>
130 <div class="col-sm-3 form-group">
131 <div class="custom-file">
132 <input [disabled]="!selectedVimType" type="file" #fileInput class="custom-file-input"
133 (change)="filesDropped($event.target.files)" id="customFile">
Barath Kumar R1245fc82021-04-16 13:34:06 +0530134 <label class="custom-file-label" #fileInputLabel for="customFile">
135 {{'CHOOSEFILE' | translate}}
136 </label>
Barath Kumar Rd477b852020-07-07 15:24:05 +0530137 </div>
138 <small class="text-info">{{'UPLOADCONFIGLABEL' | translate}}</small>
139 </div>
140 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +0530141 <div class="row" [hidden]="!selectedVimType">
142 <div class="col-12">
143 <button type="button" class="btn btn-block border-0 bg-light text-dark"
144 (click)="isCollapsed = !isCollapsed"
145 [attr.aria-expanded]="!isCollapsed">{{'PAGE.VIMDETAILS.CONFIGPARAMETERS' | translate}}</button>
146 </div>
147 </div>
Barath Kumar Rd477b852020-07-07 15:24:05 +0530148 <div id="configurationparameters" class="row collapse mt-3" [ngbCollapse]="isCollapsed">
149 <div class="col-sm-12">
150 <div class="ngx-codemirror new-vim" [hidden]="!selectedVimType">
151 <div class="form-group">
SANDHYA.JS2cac4722023-10-11 16:29:27 +0530152 <button type="button" class="btn btn-warning btn-sm mr-3" (click)="checkData()">
Barath Kumar Rd477b852020-07-07 15:24:05 +0530153 <i class="fa fa-clone" aria-hidden="true"></i>
154 {{'PAGE.VIMDETAILS.LOADSAMPLECONFIG' | translate}}</button>
155 <button type="button" class="btn btn-danger btn-sm" (click)="clearConfig()">
156 <i class="fa fa-times-circle" aria-hidden="true"></i>
157 {{'PAGE.VIMDETAILS.CLEARCONFIG' | translate}}</button>
kumaran.m3b4814a2020-05-01 19:48:54 +0530158 </div>
SANDHYA.JS2cac4722023-10-11 16:29:27 +0530159 <ngx-codemirror *ngIf="check" [options]="options" [ngModel]="defaults[mode]" [autoFocus]="false"
Barath Kumar Rd477b852020-07-07 15:24:05 +0530160 (ngModelChange)="handleChange($event)" [ngModelOptions]="{standalone: true}">
161 </ngx-codemirror>
kumaran.m3b4814a2020-05-01 19:48:54 +0530162 </div>
163 </div>
164 </div>
Barath Kumar Rd477b852020-07-07 15:24:05 +0530165 <div class="modal-footer border-0">
166 <button type="button" (click)="onVimAccountBack()"
167 class="btn btn-danger">{{'PAGE.VIMDETAILS.BACKTOVIMACCOUNTS' | translate}}</button>
SANDHYA.JS2cac4722023-10-11 16:29:27 +0530168 <button *ngIf="!vimID" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
169 <button *ngIf="vimID" type="submit" class="btn btn-primary">{{'UPDATE' | translate}}</button>
Barath Kumar Rd477b852020-07-07 15:24:05 +0530170 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +0530171 </div>
172</form>
173<app-loader [waitingMessage]="message" *ngIf="isLocationLoadingResults"></app-loader>