From 98376cdd3bc5ab72e1a0c8135da9a4903102c6f2 Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Tue, 12 May 2020 13:23:25 +0200 Subject: [PATCH] B #1417: Fix VMs IPs (#4710) --- src/sunstone/public/app/opennebula/vm.js | 38 ++++++++++++++++++------ 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js index 89816a64c1..f8d81acf43 100644 --- a/src/sunstone/public/app/opennebula/vm.js +++ b/src/sunstone/public/app/opennebula/vm.js @@ -820,25 +820,46 @@ define(function(require) { : "--"; }; - // Return a dropdown with all the + // Return a dropdown with all the function ipsDropdown(element, divider) { var ipsStr = this.ipsStr(element,divider,groupByIpsDropdown); - const ips = ipsStr.split('
'); - if ((ips.length < 2) && (!~ipsStr.indexOf("li"))) return ipsStr; - var html = ''; + return html; }; function groupByIpsDropdown(element = {}, nics = []) { + return nics.reduce(function(column, nic) { var nicSection = $("
  • ").append($("").css("color", "gray").text(nic.IP)); @@ -849,7 +870,6 @@ define(function(require) { var templateAlias = Array.isArray(element.TEMPLATE.NIC_ALIAS) ? element.TEMPLATE.NIC_ALIAS : [element.TEMPLATE.NIC_ALIAS]; var alias = templateAlias.find(function(alias) { return alias.NIC_ID === aliasId }); - if (alias) { nicSection.append($("
  • ").append($("").css({ "color": "gray",