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