Skip to content

Commit f6f381f

Browse files
ustcweizhouyadvr
authored andcommitted
ui: fix enable static nat only towards first nic and not on any other interface (apache#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 apache#3334
1 parent f1efcc1 commit f6f381f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

ui/scripts/network.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
url: createURL('listNics'),
9292
data: {
9393
virtualmachineid: instance.id,
94-
networkId: network.id
94+
networkid: (args.context.networkid != undefined) ? args.context.networkid : network.id
9595
},
9696
success: function(json) {
9797
var nic = json.listnicsresponse.nic[0];
@@ -2465,6 +2465,10 @@
24652465
networkid: $tierSelect.val(),
24662466
vpcid: args.context.vpc[0].id
24672467
});
2468+
$.extend(args.context, {
2469+
networkid: $tierSelect.val(),
2470+
vpcid: args.context.vpc[0].id
2471+
});
24682472
} else if ('networks' in args.context && !args.context.ipAddresses[0].isportable) {
24692473
$.extend(data, {
24702474
networkid: args.context.networks[0].id

ui/scripts/vpc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
url: createURL('listNics'),
4040
data: {
4141
virtualmachineid: instance.id,
42-
nicId: instance.nic[0].id
42+
networkId: network.id
4343
},
4444
success: function(json) {
4545
var nic = json.listnicsresponse.nic[0];

0 commit comments

Comments
 (0)