M #-: Fix RDP 1 nic (#4315)

Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
Tino Vázquez authored and GitHub committed 2020-03-05 17:48:49 +01:00
1 parent 0dad03df8c
commit 363e3f1b56
1 file changed
+10 -7
+10 -7
View File
@@ -873,13 +873,16 @@ define(function(require) {
// returns true if the RDP button should be enabled
function isRDPSupported(element) {
return ( element.TEMPLATE &&
element.TEMPLATE.NIC &&
Array.isArray(element.TEMPLATE.NIC) &&
element.TEMPLATE.NIC.some(function(nic) {
return nic.RDP && nic.RDP == "YES"
})
);
var rtn = false;
if(element.TEMPLATE && element.TEMPLATE.NIC){
if(!Array.isArray(element.TEMPLATE.NIC)){
element.TEMPLATE.NIC = [element.TEMPLATE.NIC];
}
element.TEMPLATE.NIC.some(function(nic) {
rtn = nic.RDP && nic.RDP == "YES"
})
}
return rtn;
}
return VM;