From 363e3f1b56436f174ea4c04a06feda8611fa1fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tino=20V=C3=A1zquez?= Date: Thu, 5 Mar 2020 17:48:49 +0100 Subject: [PATCH] M #-: Fix RDP 1 nic (#4315) Signed-off-by: Jorge Lobo --- src/sunstone/public/app/opennebula/vm.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index 44502fd9c7..345e394ac2 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -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;