blob: 5c44524abaf26ccd9ae022437a23e1d720c5f70b [file] [log] [blame]
SANDHYA.JS92379ec2025-06-13 17:29:35 +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: SANDHYA JS (sandhya.j@tataelxsi.co.in)
17-->
18<form [formGroup]="nodeForm" (ngSubmit)="nodeSubmit();" (keydown.enter)="$event.preventDefault()">
19 <div class="modal-header">
20 <h4 *ngIf="profileType === 'card_node'" class="modal-title" id="modal-basic-title">
21 {{'PAGE.K8S.CREATENODEGROUP' |
22 translate}}
23 </h4>
24 <h4 *ngIf="profileType === 'edit-node'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.EDITNODE' |
25 translate}}
26 </h4>
27 <h4 *ngIf="profileType === 'k8s-scale'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.K8SSCALING' |
28 translate}}
29 </h4>
30 <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()">
31 <i class="fas fa-times-circle text-danger"></i>
32 </button>
33 </div>
34 <div class="modal-body modal-body-custom-height">
35 <div class="form-group row mb-3" *ngIf="profileType === 'card_node'">
36 <label class="col-sm-12 col-form-label mandatory-label"
37 [ngClass]="{'text-danger': nodeForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' |
38 translate}}</label>
39 <label class="col-sm-4 col-form-label" for="name">{{'PAGE.K8S.NAME' | translate}}*</label>
40 <div class="col-sm-8">
41 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NAME' | translate}}" type="text"
42 formControlName="name" id="name" [ngClass]="{ 'is-invalid': submitted && f.name.errors }" required>
43 </div>
44 </div>
45 <div class="form-group row mb-3" *ngIf="profileType === 'edit-node'">
46 <label class="col-sm-4 col-form-label" for="name">{{'PAGE.K8S.NAME' | translate}}</label>
47 <div class="col-sm-8">
48 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NAME' | translate}}" type="text"
49 formControlName="edit_name" id="name" [ngClass]="{ 'is-invalid': submitted && f.edit_name.errors }">
50 </div>
51 </div>
52 <div class="form-group row mb-3" *ngIf="profileType === 'card_node' || profileType === 'edit-node'">
53 <label class="col-sm-4 col-form-label" for="description">{{'PAGE.K8S.DESCRIPTION' | translate}}</label>
54 <div class="col-sm-8">
55 <textarea class="form-control" placeholder="{{'PAGE.K8S.DESCRIPTION' | translate}}" type="text"
56 formControlName="description" id="description"
57 [ngClass]="{ 'is-invalid': submitted && f.description.errors }"></textarea>
58 </div>
59 </div>
60 <div class="form-group row mb-3" *ngIf="profileType === 'card_node'">
61 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODESIZE' | translate}}*</label>
62 <div class="col-sm-8">
63 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODESIZE' | translate}}" type="text"
64 formControlName="node_size" id="node_size" [ngClass]="{ 'is-invalid': submitted && f.node_size.errors }"
65 required>
66 </div>
67 </div>
68 <div class="form-group row mb-3" *ngIf="profileType === 'card_node'">
69 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODECOUNT' | translate}}*</label>
70 <div class="col-sm-8">
71 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODECOUNT' | translate}}" type="text"
72 formControlName="node_count" id="node_count" [ngClass]="{ 'is-invalid': submitted && f.node_count.errors }"
73 required>
74 </div>
75 </div>
76 <div class="form-group row mb-3" *ngIf="profileType === 'k8s-scale'">
77 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODECOUNT' | translate}}</label>
78 <div class="col-sm-8">
79 <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODECOUNT' | translate}}" type="text"
80 formControlName="nodeCount" id="node_count" [ngClass]="{ 'is-invalid': submitted && f.node_count.errors }">
81 </div>
82 </div>
83 <div class="form-group row mb-3" *ngIf="profileType === 'card_node'">
84 <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODEROLE' | translate}}</label>
85 <div class="col-sm-8">
86 <input autocomplete="off" class="form-control" placeholder="{{'arn:aws:iam::[account-id]:role/[role-name]' | translate}}" type="text"
87 formControlName="role" id="role" [ngClass]="{ 'is-invalid': submitted && f.role.errors }">
88 </div>
89 </div>
90 <div class="card bg-light" *ngIf="profileType === 'card_node'">
91 <div class="card-body">
92 <div class="form-group row mb-3">
93 <label class="col-sm-4 col-form-label fw-semibold" for="k8s_version">{{'PAGE.K8S.SUBNET' | translate}}*</label>
94 </div>
95 <div class="form-group row mb-3">
96 <label class="col-sm-4 col-form-label" for="subnets_id">{{ 'PAGE.K8S.PRIVATESUBNET' | translate }}</label>
97 <div class="col-sm-8">
98 <ng-select placeholder="{{'SELECT' | translate}} {{'PAGE.K8S.PRIVATESUBNET' | translate}}"
99 [items]="privatesubnetItems" bindLabel="id" bindValue="id" [multiple]="true" id="private_subnet"
100 formControlName="private_subnet" [ngClass]="{ 'is-invalid': submitted && f.private_subnet.errors }"
101 [(ngModel)]="privateItems">
102 </ng-select>
103 </div>
104 </div>
105 <div class="form-group row mb-3">
106 <label class="col-sm-4 col-form-label" for="subnets_id">{{ 'PAGE.K8S.PUBLICSUBNET' | translate }}</label>
107 <div class="col-sm-8">
108 <ng-select placeholder="{{'SELECT' | translate}} {{'PAGE.K8S.PUBLICSUBNET' | translate}}"
109 [items]="publicsubnetItems" bindLabel="id" bindValue="id" [multiple]="true" id="public_subnet"
110 formControlName="public_subnet" [ngClass]="{ 'is-invalid': submitted && f.public_subnet.errors }"
111 [(ngModel)]="publicItems">
112 </ng-select>
113 </div>
114 </div>
115 </div>
116 </div>
117 </div>
118 <div class="modal-footer">
119 <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button>
120 <button *ngIf="profileType === 'card_node'" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
121 <button *ngIf="profileType === 'k8s-scale' || profileType === 'edit-node'" type="submit"
122 class="btn btn-primary">{{'APPLY'
123 | translate}}</button>
124 </div>
125</form>
126<app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader>