I added reset all console connection control on nodes menu and removed red circle from nodes action confirmation dialog

This commit is contained in:
Rajnikant Lodhi 2022-07-05 08:59:48 +05:30
parent 9c3667277c
commit 5bddf9c5fc
4 changed files with 22 additions and 6 deletions

View File

@ -1,12 +1,7 @@
<div class="row">
<div class="col-md-10">
<div class="col-md-12">
<h5 class="heading-txt">Confirm {{ confirmActionData.actionType}} All</h5>
</div>
<div class="col-md-2 txt-align">
<button mat-mini-fab color="warn" class="close-btn" mat-dialog-close>
<mat-icon class="close-icon">close</mat-icon>
</button>
</div>
</div>
<mat-divider></mat-divider>
<mat-dialog-content>

View File

@ -44,4 +44,14 @@
>
<mat-icon>replay</mat-icon>
</button>
<button
matTooltip="Reset all console connections"
matTooltipClass="custom-tooltip"
mat-icon-button
(click)="confirmControlsActions('reset')"
class="menu-button"
>
<mat-icon>compare_arrows</mat-icon>
</button>
</div>

View File

@ -86,6 +86,13 @@ export class NodesMenuComponent {
this.toasterService.success('All nodes successfully reloaded');
});
}
resetNodes() {
this.nodeService.resetAllNodes(this.server, this.project).subscribe(() => {
this.toasterService.success('Successfully reset all console connections');
});
}
public confirmControlsActions(type) {
const dialogRef = this.dialog.open(NodesMenuConfirmationDialogComponent, {
width: '500px',
@ -105,6 +112,7 @@ export class NodesMenuComponent {
} else if (confirmAction_result.isAction && confirmAction_result.actionType == 'suspend') {
this.suspendNodes();
} else {
this.resetNodes()
}
});
}

View File

@ -55,6 +55,9 @@ export class NodeService {
reloadAll(server: Server, project: Project) {
return this.httpServer.post(server, `/projects/${project.project_id}/nodes/reload`, {});
}
resetAllNodes(server: Server, project: Project) {
return this.httpServer.post(server, `/projects/${project.project_id}/nodes/console/reset`, {});
}
createFromTemplate(
server: Server,