From 484276b0423a60d2707ded133f50252b64caa12c Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Mon, 22 Mar 2021 15:47:53 +0100 Subject: [PATCH] M #~: Don't show always dropdowns (#1009) --- src/sunstone/public/app/opennebula/vm.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index 05649020a5..fd6ef586aa 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -1029,9 +1029,16 @@ define(function(require) { var ipsHtml = this.ipsStr(element, { divider, groupStrFunction: groupByIpsDropdown, forceGroup: true }); var ips = []; - $.each($.parseHTML(ipsHtml), function() { - ips.push($( this ).text()); + $.each($.parseHTML(ipsHtml), function(index, element) { + if (!ips.includes($( this ).text()) && $( this ).text() !== "") + ips.push($( this ).text()); }); + + if (ips.length === 0) + return "

--

"; + else if (ips.length === 1) + return "

"+ips[0]+"

" + var firstIP = ipsHtml.split("")[0] ipsHtml = ipsHtml.split("")[1] ipsHtml =