From dbd7ab093123695320635029620a4fafa7f40879 Mon Sep 17 00:00:00 2001 From: Nikhil Ashoka Date: Mon, 28 Nov 2022 14:56:22 +0530 Subject: [PATCH] Host console pops on click in Server power ops - On click of Power on, Reboot and Shut down, the host console window pops up in the Server power ops page. - It does not apply for Read-Only users. Signed-off-by: Nikhil Ashoka --- .../ServerPowerOperations.vue | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue b/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue index cd833a3cdb..2692bbd5c5 100644 --- a/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue +++ b/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue @@ -212,6 +212,9 @@ export default { isOperationInProgress() { return this.$store.getters['controls/isOperationInProgress']; }, + isReadOnlyUser() { + return this.$store.getters['global/isReadOnlyUser']; + }, lastPowerOperationTime() { return this.$store.getters['controls/lastPowerOperationTime']; }, @@ -245,6 +248,9 @@ export default { this.bmc.statusState === 'Enabled' && this.bmc.health === 'OK' ) { + if (!this.isReadOnlyUser) { + this.showHostConsole(); + } this.$store.dispatch('controls/serverPowerOn'); } else { this.errorToast( @@ -272,17 +278,34 @@ export default { this.$bvModal .msgBoxConfirm(modalMessage, modalOptions) .then((confirmed) => { - if (confirmed) this.$store.dispatch('controls/serverSoftReboot'); + if (confirmed) { + if (!this.isReadOnlyUser) { + this.showHostConsole(); + } + this.$store.dispatch('controls/serverSoftReboot'); + } }); } else if (this.form.rebootOption === 'immediate') { this.$bvModal .msgBoxConfirm(modalMessage, modalOptions) .then((confirmed) => { - if (confirmed) this.$store.dispatch('controls/serverHardReboot'); + if (confirmed) { + if (!this.isReadOnlyUser) { + this.showHostConsole(); + } + this.$store.dispatch('controls/serverHardReboot'); + } }); } }); }, + showHostConsole() { + window.open( + '#/console/host-console-console', + '_blank', + 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=600,height=550' + ); + }, shutdownServer() { const modalMessage = `${ this.systemDumpActive