Multiple IPs per NIC: Fixes

-Remove redundant columns from NIC IPs list view

-Fix remove, add action to use correct data from API response
This commit is contained in:
Brian Federle 2013-03-13 11:06:48 -07:00
parent 7566424a0b
commit 66a6520e4d
1 changed files with 9 additions and 12 deletions

View File

@ -1119,6 +1119,7 @@
id: 'secondaryNicIps',
label: 'label.ips',
fields: {
virtualmachinedisplayname: { label: 'label.vm.name' },
ipaddress: {
label: 'label.ips',
converter: function(text, item) {
@ -1128,15 +1129,6 @@
return text;
}
},
zonename: { label: 'label.zone' },
virtualmachinedisplayname: { label: 'label.vm.name' },
state: {
converter: function(str) {
// For localization
return str;
},
label: 'label.state', indicator: { 'Allocated': 'on', 'Released': 'off' }
}
},
actions: {
@ -1163,7 +1155,13 @@
args.response.success({
_custom: {
getUpdatedItem: function(data) {
return $.extend(
data.queryasyncjobresultresponse.jobresult.nicsecondaryip,
{
zoneid: args.context.instances[0].zoneid,
virtualmachinedisplayname: args.context.instances[0].displayname
}
);
},
jobId: json.addiptovmnicresponse.jobid
}
@ -1194,7 +1192,6 @@
data: $(ips).map(function(index, ip) {
return $.extend(ip, {
zoneid: args.context.instances[0].zoneid,
zonename: args.context.instances[0].zonename,
virtualmachinedisplayname: args.context.instances[0].displayname
});
})
@ -1213,7 +1210,7 @@
$.ajax({
url: createURL('removeIpFromNic'),
data: {
id: args.context.secondaryNicIps[0].ipaddress
id: args.context.secondaryNicIps[0].id
},
success: function(json) {
args.response.success({