blob: a8d5820a29e5ec0c37058933e839a9870064146b [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]="k8sclusterForm" (ngSubmit)="k8sAddClusterSubmit();">
19 <div class="modal-header">
SANDHYA.JS26570112024-07-05 21:35:46 +053020 <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.m3b4814a2020-05-01 19:48:54 +053027 <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.JS26570112024-07-05 21:35:46 +053032 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register'">
kumaran.m3b4814a2020-05-01 19:48:54 +053033 <label class="col-sm-12 col-form-label mandatory-label"
SANDHYA.JS26570112024-07-05 21:35:46 +053034 [ngClass]="{'text-danger': k8sclusterForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' |
35 translate}}</label>
kumaran.m3b4814a2020-05-01 19:48:54 +053036 <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.JS26570112024-07-05 21:35:46 +053042 <div class="form-group row mb-3"
43 *ngIf="profileType === 'Manage' || profileType === 'Register'|| profileType === 'upgrade'">
kumaran.m3b4814a2020-05-01 19:48:54 +053044 <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.JS26570112024-07-05 21:35:46 +053051 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register'">
kumaran.m3b4814a2020-05-01 19:48:54 +053052 <label class="col-sm-4 col-form-label" for="vim_account">{{'PAGE.K8S.VIMACCOUNT' | translate}}*</label>
53 <div class="col-sm-8">
SANDHYA.JS26570112024-07-05 21:35:46 +053054 <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.m3b4814a2020-05-01 19:48:54 +053057 [ngClass]="{ 'is-invalid': submitted && f.vim_account.errors }" required>
58 </ng-select>
59 </div>
60 </div>
SANDHYA.JS26570112024-07-05 21:35:46 +053061 <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>
bacigalupof633dbf2022-03-25 17:24:56 +000064 <div class="col-sm-8">
SANDHYA.JS26570112024-07-05 21:35:46 +053065 <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>
bacigalupof633dbf2022-03-25 17:24:56 +000069 </ng-select>
70 </div>
71 </div>
SANDHYA.JS26570112024-07-05 21:35:46 +053072 <div class="form-group row mb-3" *ngIf="profileType === 'Manage' || profileType === 'Register'">
kumaran.m3b4814a2020-05-01 19:48:54 +053073 <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.JS26570112024-07-05 21:35:46 +053080 <div class="form-group row mb-3" *ngIf="profileType === 'Register'">
kumaran.m3b4814a2020-05-01 19:48:54 +053081 <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.JSc84f1122024-06-04 21:50:03 +053087 <input type="file" #fileInputNets class="fileupload custom-file-input" (change)="netsFile($event.target.files)"
kumaran.m3b4814a2020-05-01 19:48:54 +053088 id="customFileNets">
kumaran.m3b4814a2020-05-01 19:48:54 +053089 </div>
90 </div>
91 </div>
SANDHYA.JS26570112024-07-05 21:35:46 +053092 <div class="form-group row mb-3" *ngIf="profileType === 'Register'">
kumaran.m3b4814a2020-05-01 19:48:54 +053093 <label class="col-sm-4 col-form-label" for="credentials">{{'PAGE.K8S.CREDENTIALS' | translate}}*</label>
94 <div class="col-sm-8">
SANDHYA.JS26570112024-07-05 21:35:46 +053095 <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.m3b4814a2020-05-01 19:48:54 +053098 <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div>
99 <div class="custom-file">
SANDHYA.JS26570112024-07-05 21:35:46 +0530100 <input type="file" #fileInputCredentials class="fileupload custom-file-input"
101 (change)="credentialsFile($event.target.files)" id="customFileCredentials">
kumaran.m3b4814a2020-05-01 19:48:54 +0530102 </div>
103 </div>
104 </div>
SANDHYA.JS26570112024-07-05 21:35:46 +0530105 <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.m3b4814a2020-05-01 19:48:54 +0530137 </div>
138 <div class="modal-footer">
139 <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button>
SANDHYA.JS26570112024-07-05 21:35:46 +0530140 <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.m3b4814a2020-05-01 19:48:54 +0530144 </div>
145</form>
146<app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader>