| 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]="k8sclusterForm" (ngSubmit)="k8sAddClusterSubmit();"> |
| 19 | <div class="modal-header"> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 20 | <h4 *ngIf="profileType === 'Register'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.REGISTERCLUSTER' | |
| 21 | translate}} |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 22 | </h4> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 23 | <h4 *ngIf="profileType === 'Manage'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.CREATECLUSTER' | |
| 24 | translate}} |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 25 | </h4> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 26 | <h4 *ngIf="profileType === 'upgrade'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.UPGRADECLUSTER' | |
| 27 | translate}} |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 28 | </h4> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 29 | <h4 *ngIf="profileType === 'vertical'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.VERTICALSCALING' | |
| 30 | translate}} |
| 31 | </h4> |
| 32 | <h4 *ngIf="profileType === 'horizontal'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.HORIZONTALSCALING' | |
| 33 | translate}} |
| 34 | </h4> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 35 | <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()"> |
| 36 | <i class="fas fa-times-circle text-danger"></i> |
| 37 | </button> |
| 38 | </div> |
| 39 | <div class="modal-body modal-body-custom-height"> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 40 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register'"> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 41 | <div class="col-sm-12"> |
| 42 | <label class="form-check-label"> |
| 43 | <input class="quotacheck form-check-input" (click)=getValue($event) type="checkbox" |
| 44 | formControlName="bootstrap" id="quotacheck"> |
| 45 | <label class="form-check-label" for="quotaCheck"> <b>{{ 'PAGE.K8S.BOOTSTRAP' | translate }}</b> </label> |
| 46 | <i class="fas fa-info-circle tooltip-icon"> |
| 47 | <span class="tooltip-text">{{ 'PAGE.K8S.BOOTSTRAPINFO' | translate }}</span> |
| 48 | </i> |
| 49 | </label> |
| 50 | </div> |
| 51 | </div> |
| 52 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register' || !isChecked"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 53 | <label class="col-sm-12 col-form-label mandatory-label" |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 54 | [ngClass]="{'text-danger': k8sclusterForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | |
| 55 | translate}}</label> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 56 | <label class="col-sm-4 col-form-label" for="name">{{'PAGE.K8S.NAME' | translate}}*</label> |
| 57 | <div class="col-sm-8"> |
| 58 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NAME' | translate}}" type="text" |
| 59 | formControlName="name" id="name" [ngClass]="{ 'is-invalid': submitted && f.name.errors }" required> |
| 60 | </div> |
| 61 | </div> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 62 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage'|| !isChecked"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 63 | <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.K8SVERSION' | translate}}*</label> |
| 64 | <div class="col-sm-8"> |
| 65 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.K8SVERSION' | translate}}" type="text" |
| 66 | formControlName="k8s_version" id="k8s_version" [ngClass]="{ 'is-invalid': submitted && f.k8s_version.errors }" |
| 67 | required> |
| 68 | </div> |
| 69 | </div> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 70 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register' || !isChecked"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 71 | <label class="col-sm-4 col-form-label" for="vim_account">{{'PAGE.K8S.VIMACCOUNT' | translate}}*</label> |
| 72 | <div class="col-sm-8"> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 73 | <ng-select (change)="getDetailsvim($event)" |
| 74 | placeholder="{{'SELECT' | translate}} {{'PAGE.K8S.VIMACCOUNT' | translate}}" [items]="vimAccountSelect" |
| 75 | bindLabel="name" bindValue="name" formControlName="vim_account" id="vimAccountId" |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 76 | [ngClass]="{ 'is-invalid': submitted && f.vim_account.errors }" required> |
| 77 | </ng-select> |
| 78 | </div> |
| 79 | </div> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 80 | <div class="form-group row mb-3" *ngIf="!isChecked && profileType === 'Register'"> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 81 | <label class="col-sm-4 col-form-label" for="deployment_methods">{{'PAGE.K8S.DEPLOYMENTMETHODS' | |
| 82 | translate}}*</label> |
| bacigalupo | f633dbf | 2022-03-25 17:24:56 +0000 | [diff] [blame] | 83 | <div class="col-sm-8"> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 84 | <ng-select placeholder="{{'SELECT' | translate}} {{'PAGE.K8S.DEPLOYMENTMETHODS' | translate}}" multiple="true" |
| 85 | [items]="deploymentMethodsSelect" bindLabel="title" bindValue="value" formControlName="deployment_methods" |
| 86 | id="deploymentMethodsId" [ngClass]="{ 'is-invalid': submitted && f.deployment_methods.errors }" |
| 87 | [(ngModel)]="selectedDeploymentMethods" required> |
| bacigalupo | f633dbf | 2022-03-25 17:24:56 +0000 | [diff] [blame] | 88 | </ng-select> |
| 89 | </div> |
| 90 | </div> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 91 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register' || !isChecked"> |
| 92 | <label class="col-sm-4 col-form-label" for="description">{{'PAGE.K8S.DESCRIPTION' | translate}}</label> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 93 | <div class="col-sm-8"> |
| 94 | <textarea class="form-control" placeholder="{{'PAGE.K8S.DESCRIPTION' | translate}}" type="text" |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 95 | formControlName="description" id="description" |
| 96 | [ngClass]="{ 'is-invalid': submitted && f.description.errors }"></textarea> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 97 | </div> |
| 98 | </div> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 99 | <div class="form-group row mb-3" *ngIf="!isChecked && profileType === 'Register'"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 100 | <label class="col-sm-4 col-form-label" for="nets">{{'PAGE.K8S.NETS' | translate}}*</label> |
| 101 | <div class="col-sm-8"> |
| 102 | <textarea rows="5" cols="50" class="form-control" placeholder="{{'PAGE.K8S.NETSPLACEHOLDER' | translate}}" |
| 103 | formControlName="nets" id="nets" [ngClass]="{ 'is-invalid': submitted && f.nets.errors }" required></textarea> |
| 104 | <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div> |
| 105 | <div class="custom-file"> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 106 | <input type="file" #fileInputNets class="fileupload custom-file-input" |
| 107 | (change)="netsFile($event.target.files)" id="customFileNets"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 108 | </div> |
| 109 | </div> |
| 110 | </div> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 111 | <div class="form-group row mb-3" *ngIf="profileType === 'Register'|| (profileType === 'Register' && !isChecked)"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 112 | <label class="col-sm-4 col-form-label" for="credentials">{{'PAGE.K8S.CREDENTIALS' | translate}}*</label> |
| 113 | <div class="col-sm-8"> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 114 | <textarea rows="5" cols="50" class="form-control" placeholder="{{'YAMLCONFIG' | translate}}" |
| 115 | formControlName="credentials" id="credentials" [ngClass]="{ 'is-invalid': submitted && f.credentials.errors }" |
| 116 | required></textarea> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 117 | <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div> |
| 118 | <div class="custom-file"> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 119 | <input type="file" #fileInputCredentials class="fileupload custom-file-input" |
| 120 | (change)="credentialsFile($event.target.files)" id="customFileCredentials"> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 121 | </div> |
| 122 | </div> |
| 123 | </div> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 124 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage'"> |
| 125 | <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.REGIONNAME' | translate}}</label> |
| 126 | <div class="col-sm-8"> |
| 127 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.REGIONNAME' | translate}}" type="text" |
| 128 | formControlName="region_name" id="k8s_version" |
| 129 | [ngClass]="{ 'is-invalid': submitted && f.region_name.errors }"> |
| 130 | </div> |
| 131 | </div> |
| 132 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage'"> |
| 133 | <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.RESOURCEGROUP' | translate}}</label> |
| 134 | <div class="col-sm-8"> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 135 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.RESOURCEGROUP' | translate}}" |
| 136 | type="text" formControlName="resource_group" id="k8s_version" |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 137 | [ngClass]="{ 'is-invalid': submitted && f.resource_group.errors }"> |
| 138 | </div> |
| 139 | </div> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 140 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage'"> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 141 | <label class="col-sm-4 col-form-label" for="node_count">{{'PAGE.K8S.NODECOUNT' | translate}}*</label> |
| 142 | <div class="col-sm-8"> |
| 143 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODECOUNT' | translate}}" type="text" |
| 144 | formControlName="node_count" id="node_count" [ngClass]="{ 'is-invalid': submitted && f.node_count.errors }" |
| 145 | required> |
| 146 | </div> |
| 147 | </div> |
| 148 | <div class="form-group row mb-3" *ngIf="profileType === 'Manage'"> |
| 149 | <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODESIZE' | translate}}*</label> |
| 150 | <div class="col-sm-8"> |
| 151 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODESIZE' | translate}}" type="text" |
| 152 | formControlName="node_size" id="k8s_version" [ngClass]="{ 'is-invalid': submitted && f.node_size.errors }" |
| 153 | required> |
| 154 | </div> |
| 155 | </div> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 156 | <div class="form-group row mb-3" *ngIf="profileType === 'horizontal'"> |
| 157 | <label class="col-sm-4 col-form-label" for="node_count">{{'PAGE.K8S.NODECOUNT' | translate}}</label> |
| 158 | <div class="col-sm-8"> |
| 159 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODECOUNT' | translate}}" type="text" |
| 160 | formControlName="nodeCount" id="node_count" [ngClass]="{ 'is-invalid': submitted && f.nodeCount.errors }"> |
| 161 | </div> |
| 162 | </div> |
| 163 | <div class="form-group row mb-3" *ngIf="profileType === 'vertical'"> |
| 164 | <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODESIZE' | translate}}</label> |
| 165 | <div class="col-sm-8"> |
| 166 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODESIZE' | translate}}" type="text" |
| 167 | formControlName="nodeSize" id="k8s_version" [ngClass]="{ 'is-invalid': submitted && f.nodeSize.errors }"> |
| 168 | </div> |
| 169 | </div> |
| 170 | <div class="form-group row mb-3" *ngIf="profileType === 'upgrade'"> |
| 171 | <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.K8SVERSION' | translate}}</label> |
| 172 | <div class="col-sm-8"> |
| 173 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.K8SVERSION' | translate}}" type="text" |
| 174 | formControlName="k8sVersion" id="k8s_version" [ngClass]="{ 'is-invalid': submitted && f.k8sVersion.errors }"> |
| 175 | </div> |
| 176 | </div> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 177 | </div> |
| 178 | <div class="modal-footer"> |
| 179 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| SANDHYA.JS | b772de0 | 2024-12-10 15:21:03 +0530 | [diff] [blame^] | 180 | <button *ngIf="profileType === 'Manage'" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button> |
| 181 | <button *ngIf="profileType === 'Register'" type="submit" class="btn btn-primary">{{'REGISTER' | translate}}</button> |
| 182 | <button *ngIf="profileType === 'upgrade' || profileType === 'vertical' || profileType === 'horizontal'" |
| 183 | type="submit" class="btn btn-primary">{{'APPLY' |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 184 | | translate}}</button> |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 185 | </div> |
| 186 | </form> |
| 187 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |