You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/08/08 01:17:41 UTC
[1/2] git commit: updated refs/heads/4.2 to 9df9d99
Updated Branches:
refs/heads/4.2 fae824a95 -> 9df9d9919
refs/heads/master cab72c019 -> f1680ef9f
CLOUDSTACK-3268: Support transfer of portable IP
Allow UI to implicitly transfer portable IP, through enabling static
NAT on a VM/NIC from another cross-zone network.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9df9d991
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9df9d991
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9df9d991
Branch: refs/heads/4.2
Commit: 9df9d991957f073506de0529c1ce2e42a8dd5a78
Parents: fae824a
Author: Brian Federle <br...@citrix.com>
Authored: Wed Aug 7 16:16:56 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Aug 7 16:17:16 2013 -0700
----------------------------------------------------------------------
ui/scripts/network.js | 56 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 53 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9df9d991/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index fd4ad9f..cf6b3c3 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -35,9 +35,49 @@
return elemData;
};
- var instanceSecondaryIPSubselect = function(args) {
+ var instanceSecondaryIPSubselect = function(args) {
var instance = args.context.instances[0];
var network = args.context.networks[0];
+
+ if (args.context.ipAddresses[0].isportable) {
+ $.ajax({
+ url: createURL('listNics'),
+ data: {
+ virtualmachineid: instance.id
+ },
+ success: function(json) {
+ var nics = json.listnicsresponse.nic;
+ var ipSelection = [];
+
+ $(nics).map(function(index, nic) {
+ var ips = nic.secondaryip ? nic.secondaryip : [];
+ var prefix = '[NIC ' + (index + 1) + '] ';
+
+ // Add primary IP as default
+ ipSelection.push({
+ id: nic.networkid + ',-1',
+ description: prefix + nic.ipaddress + ' (Primary)'
+ });
+
+ // Add secondary IPs
+ $(ips).map(function(index, ip) {
+ ipSelection.push({
+ id: nic.networkid + ',' + ip.ipaddress,
+ description: prefix + ip.ipaddress
+ });
+ });
+ });
+
+
+ args.response.success({
+ data: ipSelection
+ });
+ }
+ });
+
+ return;
+ }
+
var nic = $.grep(instance.nic, function(nic) {
return nic.networkid == network.id;
})[0];
@@ -2338,7 +2378,7 @@
networkid: $tierSelect.val(),
vpcid: args.context.vpc[0].id
});
- } else if ('networks' in args.context) {
+ } else if ('networks' in args.context && !args.context.ipAddresses[0].isportable) {
$.extend(data, {
networkid: args.context.networks[0].id
});
@@ -2382,7 +2422,17 @@
virtualmachineid: args.context.instances[0].id
};
- if (args._subselect && args._subselect != -1) {
+ if (args.context.ipAddresses[0].isportable) {
+ var subselect = args._subselect.split(',');
+ var networkid = subselect[0];
+ var vmguestip = subselect[1];
+
+ data.networkid = subselect[0];
+
+ if (parseInt(vmguestip) !== -1) {
+ data.vmguestip = vmguestip;
+ }
+ } else if (args._subselect && args._subselect != -1) {
data.vmguestip = args._subselect;
}
[2/2] git commit: updated refs/heads/master to f1680ef
Posted by bf...@apache.org.
CLOUDSTACK-3268: Support transfer of portable IP
Allow UI to implicitly transfer portable IP, through enabling static
NAT on a VM/NIC from another cross-zone network.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f1680ef9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f1680ef9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f1680ef9
Branch: refs/heads/master
Commit: f1680ef9ff9951a990f9ab8712da804a7caecbc0
Parents: cab72c0
Author: Brian Federle <br...@citrix.com>
Authored: Wed Aug 7 16:16:56 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Aug 7 16:17:35 2013 -0700
----------------------------------------------------------------------
ui/scripts/network.js | 56 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 53 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f1680ef9/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index fd4ad9f..cf6b3c3 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -35,9 +35,49 @@
return elemData;
};
- var instanceSecondaryIPSubselect = function(args) {
+ var instanceSecondaryIPSubselect = function(args) {
var instance = args.context.instances[0];
var network = args.context.networks[0];
+
+ if (args.context.ipAddresses[0].isportable) {
+ $.ajax({
+ url: createURL('listNics'),
+ data: {
+ virtualmachineid: instance.id
+ },
+ success: function(json) {
+ var nics = json.listnicsresponse.nic;
+ var ipSelection = [];
+
+ $(nics).map(function(index, nic) {
+ var ips = nic.secondaryip ? nic.secondaryip : [];
+ var prefix = '[NIC ' + (index + 1) + '] ';
+
+ // Add primary IP as default
+ ipSelection.push({
+ id: nic.networkid + ',-1',
+ description: prefix + nic.ipaddress + ' (Primary)'
+ });
+
+ // Add secondary IPs
+ $(ips).map(function(index, ip) {
+ ipSelection.push({
+ id: nic.networkid + ',' + ip.ipaddress,
+ description: prefix + ip.ipaddress
+ });
+ });
+ });
+
+
+ args.response.success({
+ data: ipSelection
+ });
+ }
+ });
+
+ return;
+ }
+
var nic = $.grep(instance.nic, function(nic) {
return nic.networkid == network.id;
})[0];
@@ -2338,7 +2378,7 @@
networkid: $tierSelect.val(),
vpcid: args.context.vpc[0].id
});
- } else if ('networks' in args.context) {
+ } else if ('networks' in args.context && !args.context.ipAddresses[0].isportable) {
$.extend(data, {
networkid: args.context.networks[0].id
});
@@ -2382,7 +2422,17 @@
virtualmachineid: args.context.instances[0].id
};
- if (args._subselect && args._subselect != -1) {
+ if (args.context.ipAddresses[0].isportable) {
+ var subselect = args._subselect.split(',');
+ var networkid = subselect[0];
+ var vmguestip = subselect[1];
+
+ data.networkid = subselect[0];
+
+ if (parseInt(vmguestip) !== -1) {
+ data.vmguestip = vmguestip;
+ }
+ } else if (args._subselect && args._subselect != -1) {
data.vmguestip = args._subselect;
}