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/03/08 19:51:45 UTC
[1/2] git commit: refs/heads/ui-multiple-nics - Make primary IP
default selection
Make primary IP default selection
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/03135ce4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/03135ce4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/03135ce4
Branch: refs/heads/ui-multiple-nics
Commit: 03135ce4fad97c2b0a6499d8204c85e51d0c8ce8
Parents: 3cea795
Author: Brian Federle <br...@citrix.com>
Authored: Fri Mar 8 10:51:03 2013 -0800
Committer: Brian Federle <br...@citrix.com>
Committed: Fri Mar 8 10:51:03 2013 -0800
----------------------------------------------------------------------
ui/scripts/network.js | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/03135ce4/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 9eb82f9..7ab2f20 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -52,14 +52,22 @@
success: function(json) {
var nic = json.listnics.nic[0];
var ips = nic.secondaryip ? nic.secondaryip : [];
+ var ipSelection = [];
+
+ // Add primary IP as default
+ ipSelection.push({ id: -1, description: nic.ipaddress + ' (Primary)' });
+
+ // Add secondary IPs
+ $(ips).map(function(index, ip) {
+ ipSelection.push({
+ id: ip.ipaddress,
+ description: ip.ipaddress
+ });
+ });
+
args.response.success({
- data: $(ips).map(function(index, ip) {
- return {
- id: ip.ipaddress,
- description: ip.ipaddress
- };
- })
+ data: ipSelection
});
}
})
@@ -3098,7 +3106,7 @@
openfirewall: false
};
- if (args.itemData[0]._subselect) {
+ if (args.itemData[0]._subselect && args.itemData[0]._subselect != -1) {
data.vmguestip = args.itemData[0]._subselect;
}