| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +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: SANDHYA JS (sandhya.j@tataelxsi.co.in) |
| 17 | --> |
| 18 | <form [formGroup]="KsuForm" (ngSubmit)="KSUAddSubmit();"> |
| 19 | <div class="modal-header"> |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame^] | 20 | <h4 *ngIf="profileType === 'add'|| profileType === 'card-add'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.ADDKSU' | translate}}</h4> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 21 | <h4 *ngIf="profileType === 'edit'"class="modal-title" id="modal-basic-title">{{'PAGE.K8S.EDITKSU' | translate}}</h4> |
| 22 | <h4 *ngIf="profileType === 'move'"class="modal-title" id="modal-basic-title">{{'PAGE.K8S.MOVE' | translate}}</h4> |
| 23 | <h4 *ngIf="profileType === 'clone'"class="modal-title" id="modal-basic-title">{{'PAGE.K8S.CLONE' | translate}}</h4> |
| 24 | <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()"> |
| 25 | <i class="fas fa-times-circle text-danger"></i> |
| 26 | </button> |
| 27 | </div> |
| 28 | <div class="modal-body modal-body-custom-height"> |
| 29 | <div class="form-group row mb-3" *ngIf="isClone || isKsu"> |
| 30 | <label class="col-sm-12 col-form-label mandatory-label" |
| 31 | [ngClass]="{'text-danger': KsuForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' | |
| 32 | translate}}</label> |
| 33 | <label class="col-sm-4 col-form-label" for="name">{{'PAGE.K8S.NAME' | translate}}*</label> |
| 34 | <div class="col-sm-8"> |
| 35 | <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NAME' | translate}}" type="text" |
| 36 | formControlName="name" id="name" [ngClass]="{ 'is-invalid': submitted && f.name.errors }" required> |
| 37 | </div> |
| 38 | </div> |
| 39 | <div class="form-group row mb-3"*ngIf="isKsu"> |
| 40 | <label class="col-sm-4 col-form-label" for="description">{{'PAGE.K8S.DESCRIPTION' | translate}}*</label> |
| 41 | <div class="col-sm-8"> |
| 42 | <textarea class="form-control" placeholder="{{'PAGE.K8S.DESCRIPTION' | translate}}" type="text" |
| 43 | formControlName="description" id="description" |
| 44 | [ngClass]="{ 'is-invalid': submitted && f.description.errors }" required></textarea> |
| 45 | </div> |
| 46 | </div> |
| 47 | <div class="form-group row mb-3" *ngIf="isClone || isMove || isKsu"> |
| 48 | <label class="col-sm-4 col-form-label" for="profile_type">{{'PAGE.K8S.PROFILETYPE' | translate}}*</label> |
| 49 | <div class="col-sm-8"> |
| 50 | <ng-select (change)="getprofileDetails($event.value)" |
| 51 | placeholder="{{'SELECT' | translate}} {{'TYPE' | translate}}" [items]="profileSelect" |
| 52 | bindLabel="title" bindValue="value" formControlName="profile_type" id="profile_type" |
| 53 | [ngClass]="{ 'is-invalid': submitted && f.profile_type.errors }" required> |
| 54 | </ng-select> |
| 55 | </div> |
| 56 | </div> |
| 57 | <div class="form-group row mb-3" *ngIf="isClone || isMove || isKsu"> |
| 58 | <label class="col-sm-4 col-form-label" for="id">{{'PAGE.K8S.PROFILENAME' | translate}}*</label> |
| 59 | <div class="col-sm-8"> |
| 60 | <ng-select placeholder=" {{'SELECT' | translate}} {{'NAME' | |
| 61 | translate}}" [items]="profileDetails" bindLabel="name" bindValue="id" formControlName="id" id="id" |
| 62 | [ngClass]="{ 'is-invalid': submitted && f.id.errors }" required> |
| 63 | </ng-select> |
| 64 | </div> |
| 65 | </div> |
| 66 | <div class="form-group row p-2 bg-light text-white justify-content-end mb-3"*ngIf="isKsu"> |
| 67 | <div class="col-4"> |
| 68 | <button class="button-xs" type="button" class="btn btn-primary" (click)="addOka()"> |
| 69 | <i class="fas fa-plus-circle"></i>{{'PAGE.K8S.SELECTOKA' | translate}}</button> |
| 70 | </div> |
| 71 | </div> |
| 72 | <ng-container *ngIf="isKsu"> |
| 73 | <div formArrayName="oka" *ngFor="let params of getControls(); let i = index;"> |
| 74 | <div class="form-group row" [formGroupName]="i"> |
| 75 | <div class="card bg-light"> |
| 76 | <div class="card-body"> |
| 77 | <div class="form-group row"> |
| 78 | <label class="col-sm-3 col-md-3 col-form-label" for="_id{{i}}">{{'PAGE.K8S.OKA' | |
| 79 | translate}}</label> |
| 80 | <div class="col-sm-8 col-md-8"> |
| 81 | <ng-select |
| 82 | placeholder="{{'SELECT' | translate}} {{'PAGE.K8S.OKANAME' | translate}}" [items]="okaDetail" bindLabel="name" |
| 83 | bindValue="id" formControlName="_id" id="_id{{i}}" |
| 84 | [ngClass]="{ 'is-invalid': submitted && params.controls._id.errors }"> |
| 85 | </ng-select> |
| 86 | <div class="fileupload-text mt-1 mb-1">or {{'PAGE.K8S.PATH' | translate}}</div> |
| 87 | <div class="col-sm-8 col-md-8"> |
| 88 | <input autocomplete="off" class="form-control" |
| 89 | placeholder="{{'PAGE.K8S.PATH' | translate}}" type="text" formControlName="sw_catalog_path" |
| 90 | id="sw_catalog_path" [ngClass]="{ 'is-invalid': submitted && params.controls.sw_catalog_path.errors }"> |
| 91 | </div> |
| 92 | </div> |
| 93 | <label class="col-sm-3 col-md-3 col-form-label" |
| 94 | for="transformation{{i}}">{{'PAGE.K8S.TRANSFORMFILE' | |
| 95 | translate}}</label> |
| 96 | <div class="col-sm-8 col-md-8"> |
| 97 | <textarea rows="5" cols="50" class="form-control" placeholder="{{'YAMLCONFIG' | translate}}" |
| 98 | formControlName="transformation" id="transformation"></textarea> |
| 99 | <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div> |
| 100 | <div class="custom-file"> |
| 101 | <input type="file" #fileInputConfig class="fileupload custom-file-input" |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame^] | 102 | (change)="configFile($event.target.files)" id="customConfigFile" [ngClass]="{ 'is-invalid': submitted && transformation.errors }"> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 103 | </div> |
| 104 | </div> |
| 105 | <div class="col-sm-1"> |
| 106 | <button class="button-xs" type="button" class="close" (click)="removeMapping(i)" |
| 107 | placement="right" ngbTooltip="{{ 'CANCEL' | translate }}"> |
| 108 | <i class="fas fa-minus-circle text-danger"></i> |
| 109 | </button> |
| 110 | </div> |
| 111 | </div> |
| 112 | </div> |
| 113 | </div> |
| 114 | </div> |
| 115 | </div> |
| 116 | </ng-container> |
| 117 | </div> |
| 118 | <div class="modal-footer"> |
| 119 | <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button> |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame^] | 120 | <button *ngIf="profileType === 'add' || profileType === 'card-add'" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button> |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 121 | <button *ngIf="profileType === 'edit'" type="submit" class="btn btn-primary">{{'Edit' | translate}}</button> |
| 122 | <button *ngIf="profileType === 'move'" type="submit" class="btn btn-primary">{{'Move' | translate}}</button> |
| 123 | <button *ngIf="profileType === 'clone'" type="submit" class="btn btn-primary">{{'Clone' | translate}}</button> |
| 124 | </div> |
| 125 | </form> |
| 126 | <app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader> |