diff --git a/src/sunstone/public/app/tabs/vms-tab/dialogs/attach-nic.js b/src/sunstone/public/app/tabs/vms-tab/dialogs/attach-nic.js index ef9eb1aad3..c5f780ae6a 100644 --- a/src/sunstone/public/app/tabs/vms-tab/dialogs/attach-nic.js +++ b/src/sunstone/public/app/tabs/vms-tab/dialogs/attach-nic.js @@ -129,9 +129,11 @@ define(function(require) { var that = this; nicsNames.forEach(function(element) { - var alias_str = element.ID + " " + element.NET + " " + element.IP; - - $("#parent", that.context).append(new Option(alias_str, element.NAME)); + var nicID = element && element.ID? element.ID : ""; + var nicNET = element && element.NET? element.NET : ""; + var nicIP = element && element.IP? element.IP : ""; + var alias_str = nicID + " - " + nicNET + " " + nicIP; + $("#parent", that.context).append(new Option(alias_str, element.NAME)); }); } }); diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/network.js b/src/sunstone/public/app/tabs/vms-tab/panels/network.js index 554153ac4d..e48d45514c 100644 --- a/src/sunstone/public/app/tabs/vms-tab/panels/network.js +++ b/src/sunstone/public/app/tabs/vms-tab/panels/network.js @@ -18,7 +18,6 @@ define(function(require) { /* DEPENDENCIES */ - var Locale = require("utils/locale"); var Config = require("sunstone-config"); var Sunstone = require("sunstone"); @@ -378,14 +377,13 @@ define(function(require) { $(nRow).attr("nic_id", aData.NIC_ID); } }); - + $("#tab_network_form .nics_table", context).dataTable().fnSort([[1, "asc"]]); // Add event listener for opening and closing each NIC row details context.off("click", "#tab_network_form .nics_table td.open-control"); context.on("click", "#tab_network_form .nics_table td.open-control", function () { var row = $(this).closest("table").DataTable().row($(this).closest("tr")); - if (row.child.isShown()) { row.child.hide(); $(this).children("span").addClass("fa-chevron-down"); @@ -395,18 +393,29 @@ define(function(require) { var html = ""; $.each(row.data().NIC_ALIAS, function(index, elem) { - var new_div = "
" + - "" + "- Alias-" + this.ALIAS_ID + ":" + "" + - "   " + this.IP + - "   " + this.MAC + - "   " + this.ACTIONS + "
"; + var new_div = "
- Alias-" + this.ALIAS_ID + ":"; - html += new_div; + if(!!this.IP) { + new_div += "   " + this.IP; + } + if(!!this.IP6) { + new_div += "   " + this.IP6; + } + new_div += "   " + this.MAC; + if(!!this.IP6_ULA) { + new_div += "   ULA: " + this.IP6_ULA; + } + if(!!this.IP6_GLOBAL) { + new_div += "   Global: " + this.IP6_GLOBAL; + } + new_div += "   " + this.ACTIONS + "
"; - if (Config.isTabActionEnabled("vms-tab", "VM.detachnic")) { - context.off("click", ".detachnic"); - context.on("click", ".detachnic", {element_id: that.element.ID}, detach_alias); - } + html += new_div; + + if (Config.isTabActionEnabled("vms-tab", "VM.detachnic")) { + context.off("click", ".detachnic"); + context.on("click", ".detachnic", {element_id: that.element.ID}, detach_alias); + } }); } else { html = ""; @@ -573,7 +582,6 @@ define(function(require) { return state; } - function _setState(state, context) { var that = this;