blob: 048e8cdb53d12bb8654c8dbc59a94017d7097132 [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]="packagesForm" (ngSubmit)="createPackages()" autocomplete="off">
19 <div class="modal-header">
SANDHYA.JS26570112024-07-05 21:35:46 +053020 <h4 class="modal-title" *ngIf="params.page === 'vnf-packages' || params.page === 'ns-packages'"
21 id="modal-basic-title">{{'CREATEPACKAGE' | translate}}</h4>
SANDHYA.JS07decc02024-07-01 21:50:48 +053022 <h4 class="modal-title" *ngIf="params.page === 'ns-config-template'" id="modal-basic-title">
23 {{'PAGE.NSCONFIGTEMPLATE.CREATENSCONFIGTEMPLATE' | translate}}</h4>
24 <h4 class="modal-title" *ngIf="params.page === 'ns-config-template-edit'" id="modal-basic-title">
25 {{'PAGE.NSCONFIGTEMPLATE.EDITNSCONFIGTEMPLATE' | translate}}</h4>
SANDHYA.JS26570112024-07-05 21:35:46 +053026 <h4 class="modal-title" *ngIf="params.page === 'oka-packages'" id="modal-basic-title">
27 {{'Create New OKA' | translate}}</h4>
28 <h4 class="modal-title" *ngIf="params.page === 'oka-packages-edit'" id="modal-basic-title">
29 {{'Edit OKA' | translate}}</h4>
kumaran.m3b4814a2020-05-01 19:48:54 +053030 <button class="button-xs" type="button" class="close" (click)="activeModal.close()">
31 <i class="fas fa-times-circle text-danger"></i>
32 </button>
33 </div>
34 <div class="modal-body">
SANDHYA.JSc84f1122024-06-04 21:50:03 +053035 <div class="form-group row mb-3">
SANDHYA.JS07decc02024-07-01 21:50:48 +053036 <label class="col-sm-12 col-form-label mandatory-label"
37 [ngClass]="{'text-danger': packagesForm.invalid === true && submitted === true}">{{'MANDATORYCHECK' |
38 translate}}</label>
SANDHYA.JS26570112024-07-05 21:35:46 +053039 <label class="col-sm-6 col-form-label" *ngIf="!template else configtemplate">{{'PACKAGE' | translate}} {{'NAME' |
40 translate}}*</label>
SANDHYA.JS07decc02024-07-01 21:50:48 +053041 <ng-template #configtemplate>
42 <label class="col-sm-6 col-form-label">{{'NAME' | translate}}*</label>
43 </ng-template>
kumaran.m3b4814a2020-05-01 19:48:54 +053044 <div class="col-sm-6">
SANDHYA.JS07decc02024-07-01 21:50:48 +053045 <input type="text" class="form-control" placeholder="{{'NAME' | translate}}" formControlName="name" id="name"
46 [ngClass]="{ 'is-invalid': submitted && f.name.errors }" required>
47 </div>
48 </div>
SANDHYA.JS26570112024-07-05 21:35:46 +053049 <div class="form-group row mb-3" *ngIf="oka">
50 <label class="col-sm-6 col-form-label" for="description">{{'PAGE.K8S.DESCRIPTION' | translate}}*</label>
51 <div class="col-sm-6">
52 <textarea class="form-control" placeholder="{{'PAGE.K8S.DESCRIPTION' | translate}}" type="text"
53 formControlName="description" id="description" [ngClass]="{ 'is-invalid': submitted && f.description.errors }"
54 required></textarea>
55 </div>
56 </div>
SANDHYA.JS07decc02024-07-01 21:50:48 +053057 <div class="form-group row mb-3" *ngIf="template">
58 <label class="col-sm-6 col-form-label">{{'NSD' | translate}} {{'NAME' | translate}}*</label>
59 <div class="col-sm-6">
60 <ng-select formControlName="nsdId" id="nsd" [items]="nsdDetails"
61 placeholder="{{'SELECT' | translate}} {{'NSDNAME' | translate}}" bindLabel="nsName" bindValue="nsName"
62 [ngClass]="{ 'is-invalid': submitted && f.nsdId.errors }">
63 </ng-select>
64 </div>
65 </div>
66 <div class="form-group row mb-3" *ngIf="template">
67 <label class="col-sm-6 col-form-label">{{'CONFIG' | translate}}*</label>
68 <div class="col-sm-6">
69 <textarea rows="10" cols="50" class="form-control" placeholder="{{'YAMLCONFIG' | translate}}"
70 formControlName="config" id="config"></textarea>
71 <div class="fileupload-text mt-1 mb-1">{{'FILEUPLOADLABEL' | translate}}</div>
72 <div class="custom-file">
73 <input type="file" #fileInputConfig class="fileupload custom-file-input"
74 (change)="configFile($event.target.files)" id="customConfigFile">
75 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +053076 </div>
77 </div>
SANDHYA.JS26570112024-07-05 21:35:46 +053078 <div class="form-group row mb-3" *ngIf="oka">
79 <label class="col-sm-6 col-form-label">{{'PACKAGE' | translate}}*</label>
80 <div class="col-sm-6">
81 <label for="fileInput" class="custom-file-upload" *ngIf="this.params.page === 'oka-packages-edit'">
82 <input type="file" #fileInput class="fileupload custom-file-input" formControlName="package"
83 (change)="onFileDropped($event.target.files)" id="customFile">
84 <span>{{ selectedFileName }}</span>
85 <i class="fas fa-upload"></i>
86 </label>
87 <div class="custom-file" *ngIf="this.params.page === 'oka-packages'">
88 <input type="file" #fileInput class="fileupload custom-file-input" formControlName="package"
89 (change)="onFileDropped($event.target.files)" id="customFile">
90 </div>
91 <small class="text-info">{{'PAGE.K8S.UPLOADCONFIGGZLABEL' | translate}}</small>
92 </div>
93 </div>
kumaran.m3b4814a2020-05-01 19:48:54 +053094 </div>
95 <div class="modal-footer">
96 <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button>
SANDHYA.JS26570112024-07-05 21:35:46 +053097 <button
98 *ngIf="params.page === 'ns-config-template' || params.page === 'oka-packages' || params.page === 'vnf-packages' || params.page === 'ns-packages'"
99 type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
100 <button *ngIf="params.page === 'ns-config-template-edit' || params.page === 'oka-packages-edit'" type="submit"
101 class="btn btn-primary">{{'Edit' | translate}}</button>
kumaran.m3b4814a2020-05-01 19:48:54 +0530102 </div>
103</form>
104<app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader>