1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B #5707: Hide remote console options not available (#1807)

This commit is contained in:
Frederick Borges 2022-02-23 19:17:43 +01:00 committed by GitHub
parent ec1ed29980
commit 65e66ddad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1247,6 +1247,11 @@ define(function(require) {
String(element.USER_TEMPLATE.HYPERVISOR).toLowerCase() === "vcenter");
}
function isKVMVM(element = {}){
return Boolean(element.USER_TEMPLATE &&
String(element.USER_TEMPLATE.HYPERVISOR).toLowerCase() === "kvm");
}
function isVMRCSupported(element = {}) {
var actionEnabled = Config.isTabActionEnabled("vms-tab", "VM.startvmrc");
var vmrcSupported = graphicSupported(element, "vnc");
@ -1266,9 +1271,9 @@ define(function(require) {
var actionEnabled = Config.isTabActionEnabled("vms-tab", "VM.save_virt_viewer");
var vncSupported = graphicSupported(element, "vnc");
var spiceSupported = graphicSupported(element, "spice");
var isvCenterVM = isVCenterVM(element);
var isKVM = isKVMVM(element);
return (actionEnabled && history && (vncSupported || spiceSupported) && !isvCenterVM)
return (actionEnabled && history && (vncSupported || spiceSupported) && isKVM)
? {
hostname: history.HOSTNAME,
type: element.TEMPLATE.GRAPHICS.TYPE.toLowerCase(),