From 0358ef8166876a83486017ce5a6a771dad44e854 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 15 Dec 2011 12:48:36 -0800 Subject: [PATCH] bug 12557: Instances NICs tab -Show whether NIC is default -Add title to each NIC -Cleanup styling of NICs tab status 12557: resolved fixed --- ui/css/cloudstack3.css | 7 ++++++- ui/scripts/instances.js | 21 ++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 4dace3cde97..5b772bb8609 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -1268,6 +1268,11 @@ div.list-view td.state.off span { border-top: none; } +.details.group-multiple table.header { + width: 94%; + margin-bottom: 1px; +} + .details.group-multiple table tbody { border-top: 1px solid #F2F0F0; } @@ -1324,7 +1329,7 @@ div.list-view td.state.off span { } div.group-multiple div.detail-group table { - margin-top: -12px; + margin-top: -1px; } div.group-multiple div.detail-group table.header { diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index 4add90b9df5..bcffbb5942c 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -1623,15 +1623,30 @@ multiple: true, fields: [ { - id: { label: 'ID' }, + name: { label: 'Name', header: true }, ipaddress: { label: 'IP Address' }, type: { label: 'Type' }, gateway: { label: 'Default gateway' }, - netmask: { label: 'Netmask' } + netmask: { label: 'Netmask' }, + isdefault: { + label: 'Default', + converter: function(data) { + return data ? 'Yes' : 'No'; + } + } } ], dataProvider: function(args) { - args.response.success({data: args.context.instances[0].nic}); + args.response.success({data: $.map(args.context.instances[0].nic, function(nic, index) { + var name = 'NIC ' + (index + 1); + + if (nic.isdefault) { + name += ' (Default)'; + } + return $.extend(nic, { + name: name + }); + })}); } },