ui: fix enable static nat only towards first nic and not on any other interface (#3338)

When enable static nat in a vpc on UI, it only lists the primary and secondary ips of first nic of a vm, no matter which vpc tier is selected. The same issue happens when add a vm to load balancer.

Fixes #3334
This commit is contained in:
ustcweizhou 2019-05-30 08:14:52 +02:00 committed by Rohit Yadav
parent f1efcc1af6
commit f6f381fc68
2 changed files with 6 additions and 2 deletions

View File

@ -91,7 +91,7 @@
url: createURL('listNics'),
data: {
virtualmachineid: instance.id,
networkId: network.id
networkid: (args.context.networkid != undefined) ? args.context.networkid : network.id
},
success: function(json) {
var nic = json.listnicsresponse.nic[0];
@ -2465,6 +2465,10 @@
networkid: $tierSelect.val(),
vpcid: args.context.vpc[0].id
});
$.extend(args.context, {
networkid: $tierSelect.val(),
vpcid: args.context.vpc[0].id
});
} else if ('networks' in args.context && !args.context.ipAddresses[0].isportable) {
$.extend(data, {
networkid: args.context.networks[0].id

View File

@ -39,7 +39,7 @@
url: createURL('listNics'),
data: {
virtualmachineid: instance.id,
nicId: instance.nic[0].id
networkId: network.id
},
success: function(json) {
var nic = json.listnicsresponse.nic[0];