Advanced Cluster Management Enhancements
- Chnaged cluster page design from switch to single page
- Added bootstrap option in creation and registration
- Added horizontal scaling, vertical scaling and upgrade in
cluster action
- In cluster page, for list combined two apis to show list done
temporary fix from UI
Change-Id: Ie4d30f5db28025ec92398cc60fc50ab7030f8f9b
Signed-off-by: SANDHYA.JS <sandhya.j@tataelxsi.co.in>
diff --git a/src/app/k8s/k8s-action/K8sActionComponent.html b/src/app/k8s/k8s-action/K8sActionComponent.html
index efa3616..5482868 100644
--- a/src/app/k8s/k8s-action/K8sActionComponent.html
+++ b/src/app/k8s/k8s-action/K8sActionComponent.html
@@ -16,28 +16,34 @@
Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
-->
<div class="btn-group list action" role="group">
- <button *ngIf="getK8sType === 'repo'" type="button" class="btn btn-primary" (click)="infoK8s(getK8sType)"
+ <button *ngIf="getK8sType === 'repo' || !isCluster && !isKSU && !isProfile" type="button" class="btn btn-primary"
+ (click)="infoK8s(getK8sType)" placement="top" container="body" ngbTooltip="{{'INFO' | translate}}">
+ <i class="fas fa-info icons list" title="info"></i>
+ </button>
+ <button *ngIf="isCluster && !isKSU && !isProfile " type="button" class="btn btn-primary" (click)="infoK8s(getK8sType)"
placement="top" container="body" ngbTooltip="{{'INFO' | translate}}">
<i class="fas fa-info icons list" title="info"></i>
</button>
- <button *ngIf="(isCluster || isProfile || isKSU) && getK8sType !== 'repo' && !checkRegister" [disabled]="state != 'CREATED'"
- type="button" class="btn btn-primary" (click)="deleteK8s()" placement="top" container="body"
- ngbTooltip="{{'DELETE' | translate}}">
+ <button *ngIf="(isCluster || isProfile || isKSU)" type="button" class="btn btn-primary" (click)="deleteK8s()"
+ placement="top" container="body" ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons" title="delete"></i>
</button>
- <button *ngIf="(!isCluster || !isProfile || !isKSU) && getK8sType === 'repo'" type="button" class="btn btn-primary"
- (click)="deleteK8s()" placement="top" container="body" ngbTooltip="{{'DELETE' | translate}}">
+ <button *ngIf="getK8sType === 'repo'" type="button" class="btn btn-primary" (click)="deleteK8s()" placement="top"
+ container="body" ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons" title="delete"></i>
</button>
- <button *ngIf="checkRegister && !isCluster && !isProfile && !isKSU && getK8sType !== 'repo'"
- [disabled]="state != 'CREATED'" type="button" class="btn btn-primary" (click)="deleteK8s()" placement="top"
+ <button *ngIf="!isCluster && !isKSU && !isProfile && getK8sType !== 'repo' " type="button" class="btn btn-primary" (click)="deleteK8s()" placement="top"
container="body" ngbTooltip="{{'DEREGISTER' | translate}}">
<i class="fas fa-window-close icons" title="deregister"></i>
</button>
- <div *ngIf="isCluster && !isProfile && !isKSU && getK8sType !== 'repo'" class="btn-group" placement="bottom-right" ngbDropdown
+ <button *ngIf="isProfile" type="button" class="btn btn-primary" placement="top" container="body"
+ (click)="editProfile(getK8sType)" ngbTooltip="{{'PAGE.K8S.EDITPROFILE' | translate}}">
+ <i class="fa fa-edit icons"></i>
+ </button>
+ <div *ngIf="isCluster || !isCluster && !isKSU && !isProfile && getK8sType !== 'repo' " class="btn-group" placement="bottom-right" ngbDropdown
display="dynamic" container="body">
- <button type="button" class="btn btn-primary" [disabled]="state != 'CREATED'" ngbDropdownToggle placement="top" container="body"
- ngbTooltip="{{'Attach Profile' | translate}}">
+ <button type="button" class="btn btn-primary" [disabled]="!isCluster" ngbDropdownToggle placement="top"
+ container="body" ngbTooltip="{{'Attach Profile' | translate}}">
<i class="fas fa-link"></i>
</button>
<div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
@@ -60,39 +66,47 @@
</button>
</div>
</div>
- <div *ngIf="(isProfile || isKSU || isCluster && getK8sType !== 'repo')" class="btn-group" ngbDropdown display="dynamic" container="body">
- <button type="button" [disabled]="state != 'CREATED'" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
+ <div *ngIf="((isCluster || !isCluster)&& !isKSU && !isProfile && getK8sType !== 'repo' )" class="btn-group" ngbDropdown display="dynamic" container="body">
+ <button type="button" [disabled]="!isCluster" class="btn btn-primary dropdown-toggle action-button"
+ ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
<div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
- <button *ngIf="isProfile && !KSU && !isCluster" type="button" class="btn btn-primary dropdown-item"
- placement="left" container="body" (click)="editProfile(getK8sType)" ngbTooltip="{{'PAGE.K8S.EDITPROFILE' | translate}}">
- <i class="fa fa-edit icons"></i> {{'PAGE.K8S.EDITPROFILE' | translate}}
+ <button *ngIf="isCluster" type="button" class="btn btn-primary dropdown-item" placement="left"
+ (click)="editCluster('upgrade')" container="body" ngbTooltip="{{'PAGE.K8S.UPGRADECLUSTER' | translate}}">
+ <i class="fa fa-arrow-up"></i> {{'PAGE.K8S.UPGRADECLUSTER' | translate}}
</button>
- <button *ngIf="isKSU && !isProfile && !isCluster" type="button" class="btn btn-primary dropdown-item"
- placement="left" (click)="moveKsu()" container="body" ngbTooltip="{{'PAGE.K8S.MOVE' | translate}}">
+ <button *ngIf="isCluster" type="button" class="btn btn-primary dropdown-item" placement="left"
+ (click)="editCluster('horizontal')" container="body" ngbTooltip="{{'PAGE.K8S.HORIZONTALSCALING' | translate}}">
+ <i class="fas fa-arrows-alt-h"></i> {{'PAGE.K8S.HORIZONTALSCALING' | translate}}
+ </button>
+ <button *ngIf="isCluster" type="button" class="btn btn-primary dropdown-item" placement="left"
+ (click)="editCluster('vertical')" container="body" ngbTooltip="{{'PAGE.K8S.VERTICALSCALING' | translate}}">
+ <i class="fas fa-arrows-alt-v"></i> {{'PAGE.K8S.VERTICALSCALING' | translate}}
+ </button>
+ <button *ngIf="isCluster" type="button" class="btn btn-primary dropdown-item" placement="left"
+ (click)="getCredentials()" container="body" ngbTooltip="{{'PAGE.K8S.GETCREDENTIALS' | translate}}">
+ <i class="fas fa-download icons"></i> {{'PAGE.K8S.GETCREDENTIALS' | translate}}
+ </button>
+ </div>
+ </div>
+ <div *ngIf="isKSU" class="btn-group" ngbDropdown display="dynamic" container="body">
+ <button type="button" class="btn btn-primary dropdown-toggle action-button" ngbDropdownToggle>
+ {{'ACTION' | translate}}
+ </button>
+ <div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
+ <button *ngIf="isKSU" type="button" class="btn btn-primary dropdown-item" placement="left" (click)="moveKsu()"
+ container="body" ngbTooltip="{{'PAGE.K8S.MOVE' | translate}}">
<i class="fas fa-truck-moving"></i> {{'PAGE.K8S.MOVE' | translate}}
</button>
- <button *ngIf="isKSU && !isProfile && !isCluster" type="button" class="btn btn-primary dropdown-item"
- placement="left" (click)="cloneKsu()" container="body" ngbTooltip="{{'PAGE.K8S.CLONE' | translate}}">
+ <button *ngIf="isKSU" type="button" class="btn btn-primary dropdown-item" placement="left" (click)="cloneKsu()"
+ container="body" ngbTooltip="{{'PAGE.K8S.CLONE' | translate}}">
<i class="fa fa-clone icons"></i> {{'PAGE.K8S.CLONE' | translate}}
</button>
- <button *ngIf="isKSU && !isProfile && !isCluster" type="button" class="btn btn-primary dropdown-item"
- placement="left" (click)="editKsu()" container="body" ngbTooltip="{{'EDIT' | translate}}">
+ <button *ngIf="isKSU" type="button" class="btn btn-primary dropdown-item" placement="left" (click)="editKsu()"
+ container="body" ngbTooltip="{{'EDIT' | translate}}">
<i class="fa fa-edit icons"></i> {{'EDIT' | translate}}
</button>
- <button *ngIf="!isKSU && !isProfile && isCluster" type="button" class="btn btn-primary dropdown-item"
- placement="left" (click)="editCluster('upgrade')" container="body" ngbTooltip="{{'PAGE.K8S.UPGRADE' | translate}}">
- <i class="fa fa-arrow-up"></i> {{'PAGE.K8S.UPGRADE' | translate}}
- </button>
- <button *ngIf="!isKSU && !isProfile && isCluster" type="button" class="btn btn-primary dropdown-item"
- placement="left" (click)="editCluster('scale')" container="body" ngbTooltip="{{'PAGE.K8S.SCALE' | translate}}">
- <i class="fas fa-compress-alt"></i> {{'PAGE.K8S.SCALE' | translate}}
- </button>
- <button *ngIf="!isKSU && !isProfile && isCluster" type="button" class="btn btn-primary dropdown-item"
- placement="left" (click)="getCredentials()" container="body" ngbTooltip="{{'PAGE.K8S.GETCREDENTIALS' | translate}}">
- <i class="fas fa-download icons"></i> {{'PAGE.K8S.GETCREDENTIALS' | translate}}
- </button>
</div>
</div>
<app-loader [waitingMessage]="message" *ngIf="isLoadingDownloadResult"></app-loader>
\ 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 4723deb..bbd574f 100644
--- a/src/app/k8s/k8s-action/K8sActionComponent.ts
+++ b/src/app/k8s/k8s-action/K8sActionComponent.ts
@@ -121,21 +121,20 @@
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') {
+ if ((this.value.createdbyosm) === 'true') {
this.isCluster = true;
- this.isProfile = false;
- this.isKSU = false;
+ } else if ((this.value.createdbyosm) === 'false') {
+ this.isCluster = false;
}
if (this.getK8sType === 'k8-ksu') {
this.isKSU = true;
- this.isCluster = false;
+ } else {
+ this.isKSU = false;
+ }
+
+ if (this.getK8sType === 'infra-config' || this.getK8sType === 'infra-controller' || this.getK8sType === 'app-profile' || this.getK8sType === 'resource-profile') {
+ this.isProfile = true;
+ } else {
this.isProfile = false;
}
}
@@ -168,7 +167,10 @@
this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.instanceID,
page: pageName,
- titleName: title
+ titleName: title,
+ createdbyosm: this.value.createdbyosm,
+ bootstrap: this.value.bootstrap,
+ key: this.value.key
};
}
/** Edit profile @public */