placement="top" container="body" ngbTooltip="{{'INFO' | translate}}">
<i class="fas fa-info icons list" title="info"></i>
</button>
- <button *ngIf="(isCluster || isProfile || isKSU)" type="button" class="btn btn-primary" (click)="deleteK8s()"
+ <button *ngIf="(isCluster || isProfile || isKSU)" type="button" class="btn btn-primary" (click)="deleteK8s(false)"
placement="top" container="body" ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons" title="delete"></i>
</button>
- <button *ngIf="getK8sType === 'repo'" type="button" class="btn btn-primary" (click)="deleteK8s()" placement="top"
+ <button *ngIf="getK8sType === 'repo'" type="button" class="btn btn-primary" (click)="deleteK8s(false)" placement="top"
container="body" ngbTooltip="{{'DELETE' | translate}}">
<i class="far fa-trash-alt icons" title="delete"></i>
</button>
- <button *ngIf="!isCluster && !isKSU && !isProfile && getK8sType !== 'repo' " 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(false)" placement="top"
container="body" ngbTooltip="{{'DEREGISTER' | translate}}">
<i class="fas fa-window-close icons" title="deregister"></i>
</button>
<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>
+ <button *ngIf="(isCluster || isProfile || isKSU || !isCluster && getK8sType !== 'repo')" type="button" class="btn btn-primary" (click)="deleteK8s(true)"
+ placement="top" container="body" [disabled]="!isCluster && !isProfile && !isKSU" ngbTooltip="{{'FORCEDELETE' | translate}}">
+ <i class="fas fa-trash-alt icons text-danger" title="delete"></i>
</button>
<div *ngIf="isCluster || !isCluster && !isKSU && !isProfile && getK8sType !== 'repo' " class="btn-group" placement="bottom-right" ngbDropdown
display="dynamic" container="body">
(click)="editCluster('upgrade')" container="body" ngbTooltip="{{'PAGE.K8S.UPGRADECLUSTER' | translate}}">
<i class="fa fa-arrow-up"></i> {{'PAGE.K8S.UPGRADECLUSTER' | translate}}
</button>
- <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}}
</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>
+ <button type="button" class="btn btn-primary dropdown-toggle action-button" [disabled]="state != 'CREATED'" ngbDropdownToggle>
{{'ACTION' | translate}}
</button>
<div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
}
if (this.getK8sType === 'infra-config' || this.getK8sType === 'infra-controller' || this.getK8sType === 'app-profile' || this.getK8sType === 'resource-profile') {
- this.isProfile = true;
+ this.isProfile = true;
} else {
this.isProfile = false;
}
}
/** Delete User Account @public */
- public deleteK8s(): void {
+ public deleteK8s(forceAction: boolean): void {
// eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
+ modalRef.componentInstance.params = {
+ forceDeleteType: forceAction
+ };
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
<h4 *ngIf="profileType === 'update'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.UPDATECLUSTER' |
translate}}
</h4>
- <h4 *ngIf="profileType === 'vertical'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.VERTICALSCALING' |
- translate}}
- </h4>
- <h4 *ngIf="profileType === 'horizontal'" class="modal-title" id="modal-basic-title">{{'PAGE.K8S.HORIZONTALSCALING' |
- translate}}
- </h4>
<button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()">
<i class="fas fa-times-circle text-danger"></i>
</button>
required>
</div>
</div>
- <div class="form-group row mb-3" *ngIf="profileType === 'horizontal'">
- <label class="col-sm-4 col-form-label" for="node_count">{{'PAGE.K8S.NODECOUNT' | translate}}</label>
- <div class="col-sm-8">
- <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODECOUNT' | translate}}" type="text"
- formControlName="nodeCount" id="node_count" [ngClass]="{ 'is-invalid': submitted && f.nodeCount.errors }">
- </div>
- </div>
- <div class="form-group row mb-3" *ngIf="profileType === 'vertical'">
- <label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.NODESIZE' | translate}}</label>
- <div class="col-sm-8">
- <input autocomplete="off" class="form-control" placeholder="{{'PAGE.K8S.NODESIZE' | translate}}" type="text"
- formControlName="nodeSize" id="k8s_version" [ngClass]="{ 'is-invalid': submitted && f.nodeSize.errors }">
- </div>
- </div>
<div class="form-group row mb-3" *ngIf="profileType === 'upgrade'">
<label class="col-sm-4 col-form-label" for="k8s_version">{{'PAGE.K8S.K8SVERSION' | translate}}</label>
<div class="col-sm-8">
<button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button>
<button *ngIf="profileType === 'Manage'" type="submit" class="btn btn-primary">{{'CREATE' | translate}}</button>
<button *ngIf="profileType === 'Register'" type="submit" class="btn btn-primary">{{'REGISTER' | translate}}</button>
- <button *ngIf="profileType === 'upgrade' || profileType === 'vertical' || profileType === 'horizontal' || profileType === 'update'"
+ <button *ngIf="profileType === 'upgrade'|| profileType === 'update'"
type="submit" class="btn btn-primary">{{'APPLY'
| translate}}</button>
</div>
public selectedDeploymentMethods: string[] = ['helm-chart-v3', 'juju-bundle'];
/** Contains all action types */
- public actionTypes: string[] = ['update', 'upgrade', 'horizontal', 'vertical'];
+ public actionTypes: string[] = ['update', 'upgrade'];
/** Instance for active modal service @public */
public activeModal: NgbActiveModal;
node_size: ['', [Validators.required]],
bootstrap: [true],
k8sVersion: ['', [Validators.required]],
- nodeCount: ['', [Validators.required]],
- nodeSize: ['', [Validators.required]],
update: ['']
});
}
this.k8sclusterForm.patchValue({ update: k8sData.name, description: !isNullOrUndefined(k8sData.description) ? k8sData.description : '' });
} else if (this.profileType === 'upgrade') {
this.k8sclusterForm.patchValue({ k8sVersion: !isNullOrUndefined(k8sData.k8s_version) ? k8sData.k8s_version : '' });
- } else if (this.profileType === 'horizontal') {
- this.k8sclusterForm.patchValue({ nodeCount: !isNullOrUndefined(k8sData.node_count) ? k8sData.node_count : '' });
- } else if (this.profileType === 'vertical') {
- this.k8sclusterForm.patchValue({ nodeSize: !isNullOrUndefined(k8sData.node_size) ? k8sData.node_size : '' });
}
this.isLoadingResults = false;
}, (error: ERRORDATA) => {
this.getFormControl('credentials').disable();
this.getFormControl('deployment_methods').disable();
this.getFormControl('k8sVersion').disable();
- this.getFormControl('nodeSize').disable();
- this.getFormControl('nodeCount').disable();
this.getFormControl('update').disable();
this.manageCluster();
} else if (this.profileType === 'Register' && this.isChecked === true) {
this.getFormControl('nets').disable();
this.getFormControl('deployment_methods').disable();
this.getFormControl('k8sVersion').disable();
- this.getFormControl('nodeSize').disable();
- this.getFormControl('nodeCount').disable();
this.getFormControl('update').disable();
this.registerCluster();
} if (this.isChecked === false && this.profileType === 'Register') {
this.getFormControl('node_count').disable();
this.getFormControl('node_size').disable();
this.getFormControl('k8sVersion').disable();
- this.getFormControl('nodeSize').disable();
- this.getFormControl('nodeCount').disable();
this.getFormControl('update').disable();
this.oldregisterCluster();
- } else if (this.profileType === 'upgrade' || this.profileType === 'horizontal' || this.profileType === 'vertical') {
- this.clusterUrl = environment.K8SCREATECLUSTER_URL + '/' + this.profileID + '/' + 'update';
+ } else if (this.profileType === 'upgrade') {
+ this.clusterUrl = environment.K8SCREATECLUSTER_URL + '/' + this.profileID + '/' + 'upgrade';
this.getFormControl('region_name').disable();
this.getFormControl('resource_group').disable();
this.getFormControl('nets').disable();
this.getFormControl('node_size').disable();
this.getFormControl('k8s_version').disable();
this.getFormControl('update').disable();
- if (this.profileType === 'upgrade') {
- this.getFormControl('nodeCount').disable();
- this.getFormControl('nodeSize').disable();
- } else if (this.profileType === 'vertical') {
- this.getFormControl('nodeCount').disable();
- this.getFormControl('k8sVersion').disable();
- } else if (this.profileType === 'horizontal') {
- this.getFormControl('nodeSize').disable();
- this.getFormControl('k8sVersion').disable();
- }
this.updateCluster();
} else if (this.profileType === 'update') {
this.clusterUrl = environment.K8SCREATECLUSTER_URL + '/' + this.profileID;
this.getFormControl('node_count').disable();
this.getFormControl('node_size').disable();
this.getFormControl('k8s_version').disable();
- this.getFormControl('nodeCount').disable();
this.getFormControl('k8sVersion').disable();
- this.getFormControl('nodeSize').disable();
this.getFormControl('name').disable();
this.editCluster();
this.payload = {
k8s_version: this.k8sclusterForm.value.k8sVersion
};
- } else if (this.profileType === 'vertical') {
- this.payload = {
- node_size: (this.k8sclusterForm.value.nodeSize)
- };
- } else if (this.profileType === 'horizontal') {
- this.payload = {
- node_count: Number(this.k8sclusterForm.value.nodeCount)
- };
}
this.isLoadingResults = true;
this.restService.postResource(apiURLHeader, this.payload).subscribe((result: {}) => {
this.deleteURL = environment.NSCONFIGTEMPLATE_URL;
this.notifyMessage = 'DELETEDSUCCESSFULLY';
} else if (data.page === 'k8-infra-profile') {
+ this.forceDelete = this.params.forceDeleteType;
this.deleteURL = environment.K8SINFRACONFIGPROFILE_URL;
} else if (data.page === 'k8-infra-controller') {
+ this.forceDelete = this.params.forceDeleteType;
this.deleteURL = environment.K8SINFRACONTROLLERPROFILE_URL;
} else if (data.page === 'k8-app-profile') {
+ this.forceDelete = this.params.forceDeleteType;
this.deleteURL = environment.K8SAPPPROFILE_URL;
} else if (data.page === 'k8-resource-profile') {
+ this.forceDelete = this.params.forceDeleteType;
this.deleteURL = environment.K8SRESOURCEPROFILE_URL;
} else if (data.page === 'oka-packages') {
+ this.forceDelete = this.params.forceDeleteType;
this.deleteURL = environment.OKAPACKAGES_URL;
} else if (data.page === 'k8-ksu') {
+ this.forceDelete = this.params.forceDeleteType;
this.deleteURL = environment.KSU_URL;
} else if (data.page === 'k8-cluster') {
+ this.forceDelete = this.params.forceDeleteType;
this.page = data.page;
}
}
};
let deletingURl: string = '';
if (this.forceDelete) {
+ if (this.page === 'k8-cluster') {
+ if (this.createdbyosm === 'true') {
+ this.deleteURL = environment.K8SCREATECLUSTER_URL;
+ }
+ }
deletingURl = this.deleteURL + '/' + this.id + '?FORCE=true';
this.notifyMessage = 'DELETEDSUCCESSFULLY';
} else if (this.page === 'k8-cluster') {
Author: SANDHYA JS (sandhya.j@tataelxsi.co.in)
-->
<div class="btn-group list action" role="group">
- <button [disabled]="state != 'CREATED'" type="button" class="btn btn-primary" (click)="deleteoka()" placement="top" container="body"
- ngbTooltip="{{'DELETE' | translate}}">
- <i class="far fa-trash-alt icons"></i>
- </button>
- <button [disabled]="state != 'CREATED'" type="button" class="btn btn-primary" (click)="okaEdit()" placement="top" container="body"
- ngbTooltip="{{'EDIT' | translate}}">
- <i class="far fa-edit icons"></i>
- </button>
- </div>
- <app-loader [waitingMessage]="message" *ngIf="isLoadingDownloadResult"></app-loader>
\ No newline at end of file
+ <button type="button" class="btn btn-primary" (click)="deleteoka(false)"
+ placement="top" container="body" ngbTooltip="{{'DELETE' | translate}}">
+ <i class="far fa-trash-alt icons"></i>
+ </button>
+ <button [disabled]="state != 'CREATED'" type="button" class="btn btn-primary" (click)="okaEdit()" placement="top"
+ container="body" ngbTooltip="{{'EDIT' | translate}}">
+ <i class="far fa-edit icons"></i>
+ </button>
+ <button type="button" class="btn btn-primary" (click)="deleteoka(true)"
+ placement="top" container="body" ngbTooltip="{{'FORCEDELETE' | translate}}">
+ <i class="fas fa-trash-alt icons text-danger" title="delete"></i>
+ </button>
+</div>
+<app-loader [waitingMessage]="message" *ngIf="isLoadingDownloadResult"></app-loader>
\ No newline at end of file
}
/** Delete NS Config oka @public */
- public deleteoka(): void {
+ public deleteoka(forceAction: boolean): void {
// eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
+ modalRef.componentInstance.params = {
+ forceDeleteType: forceAction
+ };
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();