From 475f81807b9484b2e1a36b043dfb0696a4b93d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 3 Nov 2014 15:59:28 +0100 Subject: [PATCH] Feature #3175: Better management of nics without security groups --- src/sunstone/public/js/plugins/vms-tab.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 8918f5409e..e6630c633f 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -1535,7 +1535,16 @@ function updateVMInfo(request,vm){ { "data": "IP6_ULA" }, { "data": "IP6_GLOBAL" }, { "data": "ACTIONS" } - ] + ], + + "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { + + if (aData.SECURITY_GROUP_RULES == undefined || + aData.SECURITY_GROUP_RULES.length == 0){ + + $("td.open-control", nRow).html("").removeClass('open-control'); + } + } }); $("#tab_network_form .nics_table", $info_panel).dataTable().fnSort( [ [1,'asc'] ] ); @@ -2237,11 +2246,13 @@ function printNics(vm_info){ }); } - $.each(vm_info.TEMPLATE.SECURITY_GROUP_RULE, function(){ - if ( nic_secgroups[this.SECURITY_GROUP_ID] ){ - secgroups.push(this); - } - }); + if (vm_info.TEMPLATE.SECURITY_GROUP_RULE != undefined){ + $.each(vm_info.TEMPLATE.SECURITY_GROUP_RULE, function(){ + if ( nic_secgroups[this.SECURITY_GROUP_ID] ){ + secgroups.push(this); + } + }); + } nic_dt_data.push({ NIC_ID : nic.NIC_ID,