From 26570118ff9a615f06d9b64b965c8ede4edd1006 Mon Sep 17 00:00:00 2001 From: "SANDHYA.JS" Date: Fri, 5 Jul 2024 21:35:46 +0530 Subject: [PATCH] Advanced Cluster Management - NGUI - Added new OKA packages module under packages - Added Profiless, KSU under k8s section - Feature 11020. 11022, 11023, 11024, 11025, 11026 Change-Id: Ibddeb4d5693ce24d80e378277693405c810f6e04 Signed-off-by: SANDHYA.JS --- src/app/AppModule.ts | 4 +- src/app/k8s/K8sModule.ts | 58 ++- .../k8s/k8s-action/K8sActionComponent.html | 76 ++- src/app/k8s/k8s-action/K8sActionComponent.ts | 143 +++++- .../K8sAddClusterComponent.html | 90 +++- .../k8s-add-cluster/K8sAddClusterComponent.ts | 180 ++++++- .../K8sAttachProfileComponent.html | 73 +++ .../K8sAttachProfileComponent.scss | 49 ++ .../K8sAttachProfileComponent.ts | 321 ++++++++++++ .../k8s/k8s-ksu/ksu-add/KSUAddComponent.html | 126 +++++ .../k8s/k8s-ksu/ksu-add/KSUAddComponent.scss | 17 + .../k8s/k8s-ksu/ksu-add/KSUAddComponent.ts | 481 ++++++++++++++++++ .../k8s/k8s-ksu/ksu-details/KSUComponent.html | 45 ++ .../k8s/k8s-ksu/ksu-details/KSUComponent.scss | 17 + .../k8s/k8s-ksu/ksu-details/KSUComponent.ts | 254 +++++++++ .../K8sAppProfileComponent.html | 45 ++ .../K8sAppProfileComponent.scss | 17 + .../K8sAppProfileComponent.ts | 254 +++++++++ .../K8sInfraConfigAddComponent.html | 52 ++ .../K8sInfraConfigAddComponent.scss | 17 + .../K8sInfraConfigAddComponent.ts | 220 ++++++++ .../K8sInfraConfigProfileComponent.html | 45 ++ .../K8sInfraConfigProfileComponent.scss | 17 + .../K8sInfraConfigProfileComponent.ts | 254 +++++++++ .../K8sInfraControllerProfileComponent.html | 45 ++ .../K8sInfraControllerProfileComponent.scss | 17 + .../K8sInfraControllerProfileComponent.ts | 253 +++++++++ .../K8sResourceProfileComponent.html | 45 ++ .../K8sResourceProfileComponent.scss | 17 + .../K8sResourceProfileComponent.ts | 254 +++++++++ .../k8s/k8scluster/K8sClusterComponent.html | 40 +- .../k8s/k8scluster/K8sClusterComponent.scss | 87 +++- src/app/k8s/k8scluster/K8sClusterComponent.ts | 92 +++- src/app/packages/PackagesModule.ts | 11 +- .../oka-packages/OKAPackageComponent.html | 44 ++ .../oka-packages/OKAPackageComponent.scss | 17 + .../oka-packages/OKAPackageComponent.ts | 269 ++++++++++ .../compose-packages/ComposePackages.html | 42 +- .../compose-packages/ComposePackages.scss | 32 +- .../compose-packages/ComposePackages.ts | 204 +++++++- src/app/utilities/delete/DeleteComponent.html | 9 +- src/app/utilities/delete/DeleteComponent.ts | 38 +- .../OkaPackagesActionComponent.html | 28 + .../OkaPackagesActionComponent.scss | 17 + .../OkaPackagesActionComponent.ts | 103 ++++ src/assets/i18n/de.json | 61 ++- src/assets/i18n/en.json | 61 ++- src/assets/i18n/es.json | 61 ++- src/assets/i18n/pt.json | 59 ++- src/environments/environment.prod.ts | 15 +- src/environments/environment.ts | 15 +- src/models/CommonModel.ts | 8 +- src/models/K8sModel.ts | 122 ++++- src/models/MenuModel.ts | 60 +++ src/models/VNFDModel.ts | 10 +- src/services/RestService.ts | 67 ++- src/services/SharedService.ts | 4 +- tsconfig.json | 12 +- 58 files changed, 4914 insertions(+), 160 deletions(-) create mode 100644 src/app/k8s/k8s-attach-detatch-profile/K8sAttachProfileComponent.html create mode 100644 src/app/k8s/k8s-attach-detatch-profile/K8sAttachProfileComponent.scss create mode 100644 src/app/k8s/k8s-attach-detatch-profile/K8sAttachProfileComponent.ts create mode 100644 src/app/k8s/k8s-ksu/ksu-add/KSUAddComponent.html create mode 100644 src/app/k8s/k8s-ksu/ksu-add/KSUAddComponent.scss create mode 100644 src/app/k8s/k8s-ksu/ksu-add/KSUAddComponent.ts create mode 100644 src/app/k8s/k8s-ksu/ksu-details/KSUComponent.html create mode 100644 src/app/k8s/k8s-ksu/ksu-details/KSUComponent.scss create mode 100644 src/app/k8s/k8s-ksu/ksu-details/KSUComponent.ts create mode 100644 src/app/k8s/k8s-profile/k8s-app-profile-details/K8sAppProfileComponent.html create mode 100644 src/app/k8s/k8s-profile/k8s-app-profile-details/K8sAppProfileComponent.scss create mode 100644 src/app/k8s/k8s-profile/k8s-app-profile-details/K8sAppProfileComponent.ts create mode 100644 src/app/k8s/k8s-profile/k8s-infra-config-add/K8sInfraConfigAddComponent.html create mode 100644 src/app/k8s/k8s-profile/k8s-infra-config-add/K8sInfraConfigAddComponent.scss create mode 100644 src/app/k8s/k8s-profile/k8s-infra-config-add/K8sInfraConfigAddComponent.ts create mode 100644 src/app/k8s/k8s-profile/k8s-infra-config-details/K8sInfraConfigProfileComponent.html create mode 100644 src/app/k8s/k8s-profile/k8s-infra-config-details/K8sInfraConfigProfileComponent.scss create mode 100644 src/app/k8s/k8s-profile/k8s-infra-config-details/K8sInfraConfigProfileComponent.ts create mode 100644 src/app/k8s/k8s-profile/k8s-infra-controller-details/K8sInfraControllerProfileComponent.html create mode 100644 src/app/k8s/k8s-profile/k8s-infra-controller-details/K8sInfraControllerProfileComponent.scss create mode 100644 src/app/k8s/k8s-profile/k8s-infra-controller-details/K8sInfraControllerProfileComponent.ts create mode 100644 src/app/k8s/k8s-profile/k8s-resource-profile/K8sResourceProfileComponent.html create mode 100644 src/app/k8s/k8s-profile/k8s-resource-profile/K8sResourceProfileComponent.scss create mode 100644 src/app/k8s/k8s-profile/k8s-resource-profile/K8sResourceProfileComponent.ts create mode 100644 src/app/packages/oka-packages/OKAPackageComponent.html create mode 100644 src/app/packages/oka-packages/OKAPackageComponent.scss create mode 100644 src/app/packages/oka-packages/OKAPackageComponent.ts create mode 100644 src/app/utilities/oka-packages-action/OkaPackagesActionComponent.html create mode 100644 src/app/utilities/oka-packages-action/OkaPackagesActionComponent.scss create mode 100644 src/app/utilities/oka-packages-action/OkaPackagesActionComponent.ts diff --git a/src/app/AppModule.ts b/src/app/AppModule.ts index d9a089f..cd145c3 100644 --- a/src/app/AppModule.ts +++ b/src/app/AppModule.ts @@ -59,6 +59,7 @@ import { NSConfigTemplateActionComponent } from 'NSCONFIGTEMPLATEACTION'; import { NSInstancesActionComponent } from 'NSInstancesActionComponent'; import { NsPackagesActionComponent } from 'NsPackagesAction'; import { NsUpdateComponent } from 'NsUpdateComponent'; +import { OkaPackagesActionComponent } from 'OkaPackagesActionComponent'; import { PageNotFoundComponent } from 'PageNotFound'; import { PDUInstancesActionComponent } from 'PDUInstancesActionComponent'; import { ProjectLinkComponent } from 'ProjectLinkComponent'; @@ -136,7 +137,8 @@ const customNotifierOptions: NotifierOptions = { WarningComponent, StartStopRebuildComponent, HealingComponent, - NSConfigTemplateActionComponent + NSConfigTemplateActionComponent, + OkaPackagesActionComponent ], imports: [ NotifierModule.withConfig(customNotifierOptions), diff --git a/src/app/k8s/K8sModule.ts b/src/app/k8s/K8sModule.ts index 14d8165..4b9ff15 100644 --- a/src/app/k8s/K8sModule.ts +++ b/src/app/k8s/K8sModule.ts @@ -31,9 +31,17 @@ import { DataService } from 'DataService'; import { K8sActionComponent } from 'K8sActionComponent'; import { K8sAddClusterComponent } from 'K8sAddClusterComponent'; import { K8sAddRepoComponent } from 'K8sAddRepoComponent'; +import { K8sAppProfileComponent } from 'K8sAppProfileComponent'; +import { K8sAttachProfileComponent } from 'K8sAttachProfileComponent'; import { K8sClusterComponent } from 'K8sClusterComponent'; import { K8sComponent } from 'K8sComponent'; +import { K8sInfraConfigAddComponent } from 'K8sInfraConfigAddComponent'; +import { K8sInfraConfigProfileComponent } from 'K8sInfraConfigProfileComponent'; +import { K8sInfraControllerProfileComponent } from 'K8sInfraControllerProfileComponent'; import { K8sRepositoryComponent } from 'K8sRepositoryComponent'; +import { K8sResourceProfileComponent } from 'K8sResourceProfileComponent'; +import { KSUAddComponent } from 'KSUAddComponent'; +import { KSUComponent } from 'KSUComponent'; import { LoaderModule } from 'LoaderModule'; import { Ng2SmartTableModule } from 'ng2-smart-table'; import { PagePerRowModule } from 'PagePerRowModule'; @@ -58,6 +66,46 @@ const routes: Routes = [ }, component: K8sClusterComponent }, + { + path: 'infra-config-profile', + data: { + breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, + projectInfo, { title: 'PAGE.K8S.INFRACONFIG', url: null }] + }, + component: K8sInfraConfigProfileComponent + }, + { + path: 'infra-controller-profile', + data: { + breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, + projectInfo, { title: 'PAGE.K8S.INFRACONTROLLER', url: null }] + }, + component: K8sInfraControllerProfileComponent + }, + { + path: 'app-profile', + data: { + breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, + projectInfo, { title: 'PAGE.K8S.APP', url: null }] + }, + component: K8sAppProfileComponent + }, + { + path: 'resource-profile', + data: { + breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, + projectInfo, { title: 'PAGE.K8S.RESOURCE', url: null }] + }, + component: K8sResourceProfileComponent + }, + { + path: 'ksu', + data: { + breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, + projectInfo, { title: 'PAGE.K8S.KSU', url: null }] + }, + component: KSUComponent + }, { path: 'repo', data: { @@ -93,7 +141,15 @@ const routes: Routes = [ K8sRepositoryComponent, K8sActionComponent, K8sAddClusterComponent, - K8sAddRepoComponent + K8sAddRepoComponent, + K8sAttachProfileComponent, + K8sInfraConfigProfileComponent, + K8sInfraControllerProfileComponent, + K8sInfraConfigAddComponent, + K8sAppProfileComponent, + K8sResourceProfileComponent, + KSUComponent, + KSUAddComponent ], providers: [DataService], schemas: [CUSTOM_ELEMENTS_SCHEMA] diff --git a/src/app/k8s/k8s-action/K8sActionComponent.html b/src/app/k8s/k8s-action/K8sActionComponent.html index c35bb19..ddce99c 100644 --- a/src/app/k8s/k8s-action/K8sActionComponent.html +++ b/src/app/k8s/k8s-action/K8sActionComponent.html @@ -16,12 +16,78 @@ limitations under the License. Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) -->
- - -
\ No newline at end of file + + +
+ + +
+
+ + +
\ No newline at end of file diff --git a/src/app/k8s/k8s-action/K8sActionComponent.ts b/src/app/k8s/k8s-action/K8sActionComponent.ts index f68eff6..eef33ca 100644 --- a/src/app/k8s/k8s-action/K8sActionComponent.ts +++ b/src/app/k8s/k8s-action/K8sActionComponent.ts @@ -7,7 +7,7 @@ http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and @@ -23,7 +23,11 @@ import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; import { MODALCLOSERESPONSEDATA } from 'CommonModel'; import { DeleteComponent } from 'DeleteComponent'; -import { K8SCLUSTERDATADISPLAY, K8SREPODATADISPLAY } from 'K8sModel'; +import { K8sAddClusterComponent } from 'K8sAddClusterComponent'; +import { K8sAttachProfileComponent } from 'K8sAttachProfileComponent'; +import { K8sInfraConfigAddComponent } from 'K8sInfraConfigAddComponent'; +import { INFRACONFIGPAYLOAD, K8SCLUSTERDATADISPLAY, K8SPayload, K8SREPODATADISPLAY } from 'K8sModel'; +import { KSUAddComponent } from 'KSUAddComponent'; import { SharedService } from 'SharedService'; import { ShowInfoComponent } from 'ShowInfoComponent'; /** @@ -36,19 +40,34 @@ import { ShowInfoComponent } from 'ShowInfoComponent'; styleUrls: ['./K8sActionComponent.scss'] }) /** Exporting a class @exports K8sActionComponent */ -export class K8sActionComponent{ +export class K8sActionComponent { /** To inject services @public */ public injector: Injector; /** To get the value from the Users action via valuePrepareFunction default Property of ng-smarttable @public */ - public value: K8SCLUSTERDATADISPLAY | K8SREPODATADISPLAY; + public value: K8SCLUSTERDATADISPLAY | K8SREPODATADISPLAY | INFRACONFIGPAYLOAD; /** handle translate @public */ public translateService: TranslateService; - /** Contains K8s Type @private */ + /** Contains K8s Type @public */ public getK8sType: string; + /** Check register page @public */ + public checkRegister = false; + + /** Contains state @public */ + public state: string; + + /** Check profile or not @public */ + public isProfile = false; + + /** Check ksu or not @public */ + public isKSU = false; + + /** Check cluster or not @public */ + public isCluster = false; + /** Instance of the modal service @private */ private modalService: NgbModal; @@ -71,10 +90,28 @@ export class K8sActionComponent{ public ngOnInit(): void { this.instanceID = this.value.identifier; this.getK8sType = this.value.pageType; + this.state = this.value.state; + if (sessionStorage.getItem('clusterType') === 'Registered') { + this.checkRegister = true; + } + if (this.getK8sType === 'infra-config' || this.getK8sType === 'infra-controller' || this.getK8sType === 'app-profile' || this.getK8sType === 'resource-profile') { + this.isCluster = false; + this.isProfile = true; + this.isKSU = false; + } else if (sessionStorage.getItem('clusterType') === 'Managed') { + this.isCluster = true; + this.isProfile = false; + this.isKSU = false; + } + if (this.getK8sType === 'k8-ksu') { + this.isKSU = true; + this.isCluster = false; + this.isProfile = false; + } } /** Delete User Account @public */ - public deleteK8s(pageType: string): void { + public deleteK8s(): void { // eslint-disable-next-line security/detect-non-literal-fs-filename const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' }); modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { @@ -83,7 +120,7 @@ export class K8sActionComponent{ } }).catch((): void => { // Catch Navigation Error - }); + }); } /** Shows information using modalservice @public */ @@ -104,4 +141,96 @@ export class K8sActionComponent{ titleName: title }; } + /** Edit profile @public */ + public editProfile(editType: string): void { + // eslint-disable-next-line security/detect-non-literal-fs-filename + const modalRef: NgbModalRef = this.modalService.open(K8sInfraConfigAddComponent, { backdrop: 'static' }); + modalRef.componentInstance.profileID = this.value.identifier; + modalRef.componentInstance.profileType = editType; + modalRef.componentInstance.profileName = this.value.name; + modalRef.componentInstance.profileDescription = this.value.description; + modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { + if (result) { + this.sharedService.callData(); + } + }).catch((): void => { + // Catch Navigation Error + }); + } + + /** Edit cluster @public */ + public editCluster(editType: string): void { + // eslint-disable-next-line security/detect-non-literal-fs-filename + const modalRef: NgbModalRef = this.modalService.open(K8sAddClusterComponent, { backdrop: 'static' }); + modalRef.componentInstance.profileID = this.value.identifier; + modalRef.componentInstance.profileType = editType; + modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { + if (result) { + this.sharedService.callData(); + } + }).catch((): void => { + // Catch Navigation Error + }); + } + + + /** Edit profile under cluster @public */ + public editClusterProfile(editType: string): void { + // eslint-disable-next-line security/detect-non-literal-fs-filename + const modalRef: NgbModalRef = this.modalService.open(K8sAttachProfileComponent, { backdrop: 'static' }); + modalRef.componentInstance.profileID = this.value.identifier; + modalRef.componentInstance.profileType = editType; + modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { + if (result) { + this.sharedService.callData(); + } + }).catch((): void => { + // Catch Navigation Error + }); + } + + /** Move KSU @public */ + public moveKsu(): void { + // eslint-disable-next-line security/detect-non-literal-fs-filename + const modalRef: NgbModalRef = this.modalService.open(KSUAddComponent, { backdrop: 'static' }); + modalRef.componentInstance.profileID = this.value.identifier; + modalRef.componentInstance.profileType = 'move'; + modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { + if (result) { + this.sharedService.callData(); + } + }).catch((): void => { + // Catch Navigation Error + }); + } + + /** Edit KSU @public */ + public editKsu(): void { + // eslint-disable-next-line security/detect-non-literal-fs-filename + const modalRef: NgbModalRef = this.modalService.open(KSUAddComponent, { backdrop: 'static' }); + modalRef.componentInstance.profileID = this.value.identifier; + modalRef.componentInstance.profileType = 'edit'; + modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { + if (result) { + this.sharedService.callData(); + } + }).catch((): void => { + // Catch Navigation Error + }); + } + + /** Clone KSU @public */ + public cloneKsu(): void { + // eslint-disable-next-line security/detect-non-literal-fs-filename + const modalRef: NgbModalRef = this.modalService.open(KSUAddComponent, { backdrop: 'static' }); + modalRef.componentInstance.profileID = this.value.identifier; + modalRef.componentInstance.profileType = 'clone'; + modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { + if (result) { + this.sharedService.callData(); + } + }).catch((): void => { + // Catch Navigation Error + }); + } } diff --git a/src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.html b/src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.html index 707d8d6..a8d5820 100644 --- a/src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.html +++ b/src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.html @@ -17,22 +17,30 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i -->