Skip to content

Commit dbd7ab0

Browse files
committed
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 <[email protected]>
1 parent b311334 commit dbd7ab0

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue

+25-2
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ export default {
212212
isOperationInProgress() {
213213
return this.$store.getters['controls/isOperationInProgress'];
214214
},
215+
isReadOnlyUser() {
216+
return this.$store.getters['global/isReadOnlyUser'];
217+
},
215218
lastPowerOperationTime() {
216219
return this.$store.getters['controls/lastPowerOperationTime'];
217220
},
@@ -245,6 +248,9 @@ export default {
245248
this.bmc.statusState === 'Enabled' &&
246249
this.bmc.health === 'OK'
247250
) {
251+
if (!this.isReadOnlyUser) {
252+
this.showHostConsole();
253+
}
248254
this.$store.dispatch('controls/serverPowerOn');
249255
} else {
250256
this.errorToast(
@@ -272,17 +278,34 @@ export default {
272278
this.$bvModal
273279
.msgBoxConfirm(modalMessage, modalOptions)
274280
.then((confirmed) => {
275-
if (confirmed) this.$store.dispatch('controls/serverSoftReboot');
281+
if (confirmed) {
282+
if (!this.isReadOnlyUser) {
283+
this.showHostConsole();
284+
}
285+
this.$store.dispatch('controls/serverSoftReboot');
286+
}
276287
});
277288
} else if (this.form.rebootOption === 'immediate') {
278289
this.$bvModal
279290
.msgBoxConfirm(modalMessage, modalOptions)
280291
.then((confirmed) => {
281-
if (confirmed) this.$store.dispatch('controls/serverHardReboot');
292+
if (confirmed) {
293+
if (!this.isReadOnlyUser) {
294+
this.showHostConsole();
295+
}
296+
this.$store.dispatch('controls/serverHardReboot');
297+
}
282298
});
283299
}
284300
});
285301
},
302+
showHostConsole() {
303+
window.open(
304+
'#/console/host-console-console',
305+
'_blank',
306+
'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=600,height=550'
307+
);
308+
},
286309
shutdownServer() {
287310
const modalMessage = `${
288311
this.systemDumpActive

0 commit comments

Comments
 (0)