From: SANDHYA.JS Date: Fri, 5 Jul 2024 16:05:46 +0000 (+0530) Subject: Advanced Cluster Management - NGUI X-Git-Tag: release-v16.0-start^0 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fv16.0;p=osm%2FNG-UI.git 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 --- 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 -->