@@ -212,6 +212,9 @@ export default {
212
212
isOperationInProgress () {
213
213
return this .$store .getters [' controls/isOperationInProgress' ];
214
214
},
215
+ isReadOnlyUser () {
216
+ return this .$store .getters [' global/isReadOnlyUser' ];
217
+ },
215
218
lastPowerOperationTime () {
216
219
return this .$store .getters [' controls/lastPowerOperationTime' ];
217
220
},
@@ -245,6 +248,9 @@ export default {
245
248
this .bmc .statusState === ' Enabled' &&
246
249
this .bmc .health === ' OK'
247
250
) {
251
+ if (! this .isReadOnlyUser ) {
252
+ this .showHostConsole ();
253
+ }
248
254
this .$store .dispatch (' controls/serverPowerOn' );
249
255
} else {
250
256
this .errorToast (
@@ -272,17 +278,34 @@ export default {
272
278
this .$bvModal
273
279
.msgBoxConfirm (modalMessage, modalOptions)
274
280
.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
+ }
276
287
});
277
288
} else if (this .form .rebootOption === ' immediate' ) {
278
289
this .$bvModal
279
290
.msgBoxConfirm (modalMessage, modalOptions)
280
291
.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
+ }
282
298
});
283
299
}
284
300
});
285
301
},
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
+ },
286
309
shutdownServer () {
287
310
const modalMessage = ` ${
288
311
this .systemDumpActive
@@ -302,14 +325,24 @@ export default {
302
325
this .$bvModal
303
326
.msgBoxConfirm (modalMessage, modalOptions)
304
327
.then ((confirmed ) => {
305
- if (confirmed) this .$store .dispatch (' controls/serverSoftPowerOff' );
328
+ if (confirmed) {
329
+ if (! this .isReadOnlyUser ) {
330
+ this .showHostConsole ();
331
+ }
332
+ this .$store .dispatch (' controls/serverSoftPowerOff' );
333
+ }
306
334
});
307
335
}
308
336
if (this .form .shutdownOption === ' immediate' ) {
309
337
this .$bvModal
310
338
.msgBoxConfirm (modalMessage, modalOptions)
311
339
.then ((confirmed ) => {
312
- if (confirmed) this .$store .dispatch (' controls/serverHardPowerOff' );
340
+ if (confirmed) {
341
+ if (! this .isReadOnlyUser ) {
342
+ this .showHostConsole ();
343
+ }
344
+ this .$store .dispatch (' controls/serverHardPowerOff' );
345
+ }
313
346
});
314
347
}
315
348
},
0 commit comments