diff --git a/src/sunstone/public/app/opennebula/vm.js b/src/sunstone/public/app/opennebula/vm.js
index 77098b3d62..186a3138e2 100644
--- a/src/sunstone/public/app/opennebula/vm.js
+++ b/src/sunstone/public/app/opennebula/vm.js
@@ -789,7 +789,7 @@ define(function(require) {
}
// Return the IP or several IPs of a VM
- function ipsStr(element, divider, groupStrFunction = groupByIpsStr) {
+ function ipsStr(element, divider, groupStrFunction) {
var divider = divider || "
";
var nics = getNICs(element);
var ips = [];
@@ -811,14 +811,14 @@ define(function(require) {
// infoextended: alias will be group by nic
return Config.isExtendedVmInfo
- ? groupStrFuntion(element, nics)
+ ? (groupStrFunction !== null && typeof groupStrFunction === "function"? groupStrFunction(element, nics) : groupByIpsStr(element, nics))
: (ips.length == 0 && nics && nics.length > 0)
? $.map(nics, function(nic) {
if (nic["IP"]) {
return nic["IP"];
}
else{
- var ipv6 = ""
+ var ipv6 = "";
if (nic["IP6_ULA"]){
ipv6 += nic["IP6_ULA"];
}
@@ -835,12 +835,12 @@ define(function(require) {
// Return a dropdown with all the
function ipsDropdown(element, divider) {
var ipsStr = this.ipsStr(element,divider,groupByIpsDropdown);
- var ips = ipsStr.split('
');
+ var ips = ipsStr.split("
");
var html = "";
// If its generated by groupByIpsDropdown
if (~ipsStr.indexOf("li")){
- ips = []
+ ips = [];
$.each($.parseHTML(ipsStr), function( index ) {
ips.push($( this ).text());
});
@@ -860,11 +860,11 @@ define(function(require) {
// Format the other IPs inside a dropdown
if (ips.length){
- html += '
").css("margin-bottom", 0).html(nic.NIC_ID + ": " + ip);
if (nic.ALIAS_IDS) {
@@ -913,19 +913,19 @@ define(function(require) {
nic.ALIAS_IDS.split(",").forEach(function(aliasId) {
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 });
+ var alias = templateAlias.find(function(alias) { return alias.NIC_ID === aliasId; });
if (alias) {
- var alias_ip = alias.IP ? alias.IP : alias.IP6_ULA + '
' + identation + '> ' + alias.IP6_GLOBAL;
+ var alias_ip = alias.IP ? alias.IP : alias.IP6_ULA + "
" + identation + "> " + alias.IP6_GLOBAL;
nicSection.append($("