blob: 73f1038510ed3408e9d58e7fd0aec3ad41fb7d66 [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-->
SANDHYA.JS92379ec2025-06-13 17:29:35 +053018<form [formGroup]="k8sclusterForm" (ngSubmit)="k8sAddClusterSubmit();" (keydown.enter)="$event.preventDefault()">
kumaran.m3b4814a2020-05-01 19:48:54 +053019 <div class="modal-header">
SANDHYA.JSb772de02024-12-10 15:21:03 +053020 <h4 *ngIf="profileType === 'Register'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.REGISTERCLUSTER' |
21 translate}}
SANDHYA.JS26570112024-07-05 21:35:46 +053022 </h4>
SANDHYA.JSb772de02024-12-10 15:21:03 +053023 <h4 *ngIf="profileType === 'Manage'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.CREATECLUSTER' |
24 translate}}
SANDHYA.JS26570112024-07-05 21:35:46 +053025 </h4>
SANDHYA.JS92379ec2025-06-13 17:29:35 +053026 <h4 *ngIf="profileType === 'upgrade'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.VERSIONUPGRADE' |
SANDHYA.JSb772de02024-12-10 15:21:03 +053027 translate}}
SANDHYA.JS26570112024-07-05 21:35:46 +053028 </h4>
SANDHYA.JSa3ff32a2025-02-13 16:24:46 +053029 <h4 *ngIf="profileType === 'update'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.UPDATECLUSTER' |
30 translate}}
31 </h4>
kumaran.m3b4814a2020-05-01 19:48:54 +053032 <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()">
33 <i class="fas fa-times-circle text-danger"></i>
34 </button>
35 </div>
SANDHYA.JS92379ec2025-06-13 17:29:35 +053036 <div class="modal-body modal-body-custom-height"
37 *ngIf="profileType === 'Manage' || profileType === 'Register' || isChecked || profileType === 'upgrade'">
SANDHYA.JS26570112024-07-05 21:35:46 +053038 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register'">
SANDHYA.JSb772de02024-12-10 15:21:03 +053039 <div class="col-sm-12">
40 <label class="form-check-label">
41 <input class="quotacheck form-check-input" (click)=getValue($event) type="checkbox"
42 formControlName="bootstrap" id="quotacheck">
43 <label class="form-check-label" for="quotaCheck">&nbsp;<b>{{ 'PAGE.K8S.BOOTSTRAP' | translate }}</b> </label>
44 <i class="fas fa-info-circle tooltip-icon">
45 &nbsp;<span class="tooltip-text">{{ 'PAGE.K8S.BOOTSTRAPINFO' | translate }}</span>
46 </i>
47 </label>
48 </div>
49 </div>
50 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register' || !isChecked">
kumaran.m3b4814a2020-05-01 19:48:54 +053051 <label class="col-sm-12 col-form-label mandatory-label"
SANDHYA.JS26570112024-07-05 21:35:46 +053052 [ngClass]="{'text-danger': k8sclusterForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' |
53 translate}}</label>
kumaran.m3b4814a2020-05-01 19:48:54 +053054 <label class="col-sm-4 col-form-label" for="name">{{'PAGE.K8S.NAME' | translate}}*</label>
55 <div class="col-sm-8">
56 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NAME' | translate}}" type="text"
57 formControlName="name" id="name" [ngClass]="{ 'is-invalid': submitted && f.name.errors }" required>
58 </div>
59 </div>
SANDHYA.JSa3ff32a2025-02-13 16:24:46 +053060 <div class="form-group row mb-3" *ngIf="profileType === 'update'">
61 <label class="col-sm-4 col-form-label" for="name">{{'PAGE.K8S.NAME' | translate}}</label>
62 <div class="col-sm-8">
63 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NAME' | translate}}" type="text"
64 formControlName="update" id="name" [ngClass]="{ 'is-invalid': submitted && f.update.errors }">
65 </div>
66 </div>
SANDHYA.JSb772de02024-12-10 15:21:03 +053067 <div class="form-group row mb-3" *ngIf="profileType === 'Manage'|| !isChecked">
kumaran.m3b4814a2020-05-01 19:48:54 +053068 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.K8SVERSION' | translate}}*</label>
69 <div class="col-sm-8">
70 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.K8SVERSION' | translate}}" type="text"
71 formControlName="k8s_version" id="k8s_version" [ngClass]="{ 'is-invalid': submitted && f.k8s_version.errors }"
72 required>
73 </div>
74 </div>
SANDHYA.JS92379ec2025-06-13 17:29:35 +053075 <div class="form-group row mb-3"
76 *ngIf="profileType === 'Manage' || profileType === 'Register' || !isChecked || profileType === 'update'">
77 <label class="col-sm-4 col-form-label" for="description">{{'PAGE.K8S.DESCRIPTION' | translate}}</label>
78 <div class="col-sm-8">
79 <textarea class="form-control" placeholder="{{'PAGE.K8S.DESCRIPTION' | translate}}" type="text"
80 formControlName="description" id="description"
81 [ngClass]="{ 'is-invalid': submitted && f.description.errors }"></textarea>
82 </div>
83 </div>
SANDHYA.JSb772de02024-12-10 15:21:03 +053084 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register' || !isChecked">
kumaran.m3b4814a2020-05-01 19:48:54 +053085 <label class="col-sm-4 col-form-label" for="vim_account">{{'PAGE.K8S.VIMACCOUNT' | translate}}*</label>
86 <div class="col-sm-8">
SANDHYA.JS26570112024-07-05 21:35:46 +053087 <ng-select (change)="getDetailsvim($event)"
88 placeholder="{{'SELECT' | translate}} {{'PAGE.K8S.VIMACCOUNT' | translate}}" [items]="vimAccountSelect"
89 bindLabel="name" bindValue="name" formControlName="vim_account" id="vimAccountId"
kumaran.m3b4814a2020-05-01 19:48:54 +053090 [ngClass]="{ 'is-invalid': submitted && f.vim_account.errors }" required>
91 </ng-select>
92 </div>
93 </div>
SANDHYA.JS92379ec2025-06-13 17:29:35 +053094 <div class="form-group row mb-3" *ngIf=" vimType === 'aws' && profileType === 'Manage'">
95 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.ROLENAME' | translate}}</label>
96 <div class="col-sm-8">
97 <input autocomplete="off" class="form-control" placeholder="{{'arn:aws:iam::[account-id]:role/[role-name]' | translate}}" type="text"
98 formControlName="iam_role" id="iam_role" [ngClass]="{ 'is-invalid': submitted && f.iam_role.errors }">
99 </div>
100 </div>
101 <div class="form-group row mb-3" *ngIf=" vimType === 'aws' && profileType === 'Manage'">
102 <label class="col-sm-4 col-form-label" for="private_subnet">{{ 'PAGE.K8S.PRIVATESUBNET' | translate }}</label>
103 <div class="col-sm-8">
104 <div class="chip-input-container">
105 <div formArrayName="private_subnet" class="chips-wrapper">
106 <span class="chip" *ngFor="let chip of chipsprivateArray.controls; let i = index">
107 {{ chip.value }}
108 <button type="button" (click)="removeprivateChip(i)">x</button>
109 </span>
110 <input #inputField autocomplete="off" class="form-control chip-input" id="private_subnet"
111 (keyup.enter)="addprivateChips()" (keydown.backspace)="removeprivateLastChip($event)"
112 placeholder="Type and press Enter">
113 </div>
114 </div>
115 </div>
116 </div>
117 <div class="form-group row mb-3" *ngIf=" vimType === 'aws' && profileType === 'Manage'">
118 <label class="col-sm-4 col-form-label" for="public_subnet">{{ 'PAGE.K8S.PUBLICSUBNET' | translate }}</label>
119 <div class="col-sm-8">
120 <div class="chip-input-container">
121 <div formArrayName="public_subnet" class="chips-wrapper">
122 <span class="chip" *ngFor="let chip of chipspublicArray.controls; let i = index">
123 {{ chip.value }}
124 <button type="button" (click)="removepublicChip(i)">x</button>
125 </span>
126 <input #inputField autocomplete="off" class="form-control chip-input" id="public_subnet"
127 (keyup.enter)="addpublicChips()" (keydown.backspace)="removepublicLastChip($event)"
128 placeholder="Type and press Enter">
129 </div>
130 </div>
131 </div>
132 </div>
SANDHYA.JSb772de02024-12-10 15:21:03 +0530133 <div class="form-group row mb-3" *ngIf="!isChecked && profileType === 'Register'">
SANDHYA.JS26570112024-07-05 21:35:46 +0530134 <label class="col-sm-4 col-form-label" for="deployment_methods">{{'PAGE.K8S.DEPLOYMENTMETHODS' |
135 translate}}*</label>
bacigalupof633dbf2022-03-25 17:24:56 +0000136 <div class="col-sm-8">
SANDHYA.JS26570112024-07-05 21:35:46 +0530137 <ng-select placeholder="{{'SELECT' | translate}} {{'PAGE.K8S.DEPLOYMENTMETHODS' | translate}}" multiple="true"
138 [items]="deploymentMethodsSelect" bindLabel="title" bindValue="value" formControlName="deployment_methods"
139 id="deploymentMethodsId" [ngClass]="{ 'is-invalid': submitted && f.deployment_methods.errors }"
140 [(ngModel)]="selectedDeploymentMethods" required>
bacigalupof633dbf2022-03-25 17:24:56 +0000141 </ng-select>
142 </div>
143 </div>
SANDHYA.JSb772de02024-12-10 15:21:03 +0530144 <div class="form-group row mb-3" *ngIf="!isChecked && profileType === 'Register'">
kumaran.m3b4814a2020-05-01 19:48:54 +0530145 <label class="col-sm-4 col-form-label" for="nets">{{'PAGE.K8S.NETS' | translate}}*</label>
146 <div class="col-sm-8">
147 <textarea rows="5" cols="50" class="form-control" placeholder="{{'PAGE.K8S.NETSPLACEHOLDER' | translate}}"
148 formControlName="nets" id="nets" [ngClass]="{ 'is-invalid': submitted && f.nets.errors }" required></textarea>
149 <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div>
150 <div class="custom-file">
SANDHYA.JSb772de02024-12-10 15:21:03 +0530151 <input type="file" #fileInputNets class="fileupload custom-file-input"
152 (change)="netsFile($event.target.files)" id="customFileNets">
kumaran.m3b4814a2020-05-01 19:48:54 +0530153 </div>
154 </div>
155 </div>
SANDHYA.JSb772de02024-12-10 15:21:03 +0530156 <div class="form-group row mb-3" *ngIf="profileType === 'Register'|| (profileType === 'Register' && !isChecked)">
kumaran.m3b4814a2020-05-01 19:48:54 +0530157 <label class="col-sm-4 col-form-label" for="credentials">{{'PAGE.K8S.CREDENTIALS' | translate}}*</label>
158 <div class="col-sm-8">
SANDHYA.JS26570112024-07-05 21:35:46 +0530159 <textarea rows="5" cols="50" class="form-control" placeholder="{{'YAMLCONFIG' | translate}}"
160 formControlName="credentials" id="credentials" [ngClass]="{ 'is-invalid': submitted && f.credentials.errors }"
161 required></textarea>
kumaran.m3b4814a2020-05-01 19:48:54 +0530162 <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div>
163 <div class="custom-file">
SANDHYA.JS26570112024-07-05 21:35:46 +0530164 <input type="file" #fileInputCredentials class="fileupload custom-file-input"
165 (change)="credentialsFile($event.target.files)" id="customFileCredentials">
kumaran.m3b4814a2020-05-01 19:48:54 +0530166 </div>
167 </div>
168 </div>
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530169 <div class="form-group row mb-3" *ngIf="vimType === 'aws' && profileType === 'Manage'">
SANDHYA.JS26570112024-07-05 21:35:46 +0530170 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.REGIONNAME' | translate}}</label>
171 <div class="col-sm-8">
172 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.REGIONNAME' | translate}}" type="text"
173 formControlName="region_name" id="k8s_version"
174 [ngClass]="{ 'is-invalid': submitted && f.region_name.errors }">
175 </div>
176 </div>
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530177 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' && vimType !== 'aws' ">
SANDHYA.JS26570112024-07-05 21:35:46 +0530178 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.RESOURCEGROUP' | translate}}</label>
179 <div class="col-sm-8">
SANDHYA.JSb772de02024-12-10 15:21:03 +0530180 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.RESOURCEGROUP' | translate}}"
181 type="text" formControlName="resource_group" id="k8s_version"
SANDHYA.JS26570112024-07-05 21:35:46 +0530182 [ngClass]="{ 'is-invalid': submitted && f.resource_group.errors }">
183 </div>
184 </div>
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530185 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' && vimType !== 'aws' ">
SANDHYA.JS26570112024-07-05 21:35:46 +0530186 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODESIZE' | translate}}*</label>
187 <div class="col-sm-8">
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530188 <input autocomplete="off" class="form-control" placeholder="{{'Node Size' | translate}}" type="text"
189 formControlName="node_size" id="node_size" [ngClass]="{ 'is-invalid': submitted && f.node_size.errors }">
190 </div>
191 </div>
192 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' && vimType !== 'aws'">
193 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODECOUNT' | translate}}*</label>
194 <div class="col-sm-8">
195 <input autocomplete="off" class="form-control" placeholder="{{'Node Count' | translate}}" type="text"
196 formControlName="node_count" id="node_count" [ngClass]="{ 'is-invalid': submitted && f.node_count.errors }">
SANDHYA.JS26570112024-07-05 21:35:46 +0530197 </div>
198 </div>
SANDHYA.JSb772de02024-12-10 15:21:03 +0530199 <div class="form-group row mb-3" *ngIf="profileType === 'upgrade'">
200 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.K8SVERSION' | translate}}</label>
201 <div class="col-sm-8">
202 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.K8SVERSION' | translate}}" type="text"
203 formControlName="k8sVersion" id="k8s_version" [ngClass]="{ 'is-invalid': submitted && f.k8sVersion.errors }">
204 </div>
205 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +0530206 </div>
207 <div class="modal-footer">
208 <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button>
SANDHYA.JSb772de02024-12-10 15:21:03 +0530209 <button *ngIf="profileType === 'Manage'" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
210 <button *ngIf="profileType === 'Register'" type="submit" class="btn btn-primary">{{'REGISTER' | translate}}</button>
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530211 <button *ngIf="profileType === 'upgrade' || profileType === 'update'" type="submit" class="btn btn-primary">{{'APPLY'| translate}}</button>
kumaran.m3b4814a2020-05-01 19:48:54 +0530212 </div>
213</form>
214<app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader>