cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/4.2 to d72ae03
Date Mon, 12 Aug 2013 22:07:20 GMT
Updated Branches:
  refs/heads/4.2 b6a523e01 -> d72ae0326


CLOUDSTACK-4111: UI > IP Addresses page > Associate New IP dialog - show/hide cross
zone dropdown upon new property "portableipserviceenabled" in listRegions API response.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d72ae032
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d72ae032
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d72ae032

Branch: refs/heads/4.2
Commit: d72ae0326c4c3743085e8d13f9e82cc239c61691
Parents: b6a523e
Author: Jessica Wang <jessicawang@apache.org>
Authored: Mon Aug 12 15:05:41 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Mon Aug 12 15:07:10 2013 -0700

----------------------------------------------------------------------
 ui/scripts/network.js | 40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d72ae032/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index d875182..6be772e 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1994,21 +1994,30 @@
                                     return true; //VPC section, show Acquire IP button
                                 }
                             },
-                            messages: {
-                                /*
-                confirm: function(args) {
-                  if(args.context.vpc)
-                    return 'message.acquire.new.ip.vpc';
-                   else
-                     return 'message.acquire.new.ip';
-                },
-                */
+                            messages: {                           
                                 notification: function(args) {
                                     return 'label.acquire.new.ip';
                                 }
                             },
                             createForm: {
                                 title: 'label.acquire.new.ip',
+                                desc: 'Please confirm that you want to acquire new IP',
+                                preFilter: function(args) {                            	
+                                	$.ajax({
+                                		url: createURL('listRegions'),
+                                		success: function(json) {
+                                		    var items = json.listregionsresponse.region;	
+                                		    if(items != null) {
+                                		    	var region = items[0];                           
    		    	
+                                		    	if(region.portableipserviceenabled == true) {
+                                		    		args.$form.find('.form-item[rel=isportable]').css('display',
'inline-block');
+                                		    	} else {
+                                		    		args.$form.find('.form-item[rel=isportable]').hide();
+                                		    	}                              		    	
+                                		    }
+                                		}                                		
+                                	});                                	
+                                },
                                 fields: {
                                     isportable: {
                                         label: 'label.cross.zones',
@@ -2025,14 +2034,19 @@
                                             args.response.success({
                                                 data: items
                                             });
-                                        }
+                                        },
+                                        isHidden: true
                                     }
                                 }
                             },
                             action: function(args) {
-                                var dataObj = {
-                                    isportable: args.data.isportable
-                                };
+                            	var dataObj = {};                            	
+                            	if (args.$form.find('.form-item[rel=isportable]').css("display")
!= "none") {
+                            		$.extend(dataObj, {
+                            			isportable: args.data.isportable
+                            		});                            	
+                            	}
+                            	                            	
                                 if ('vpc' in args.context) { //from VPC section
                                     $.extend(dataObj, {
                                         vpcid: args.context.vpc[0].id


Mime
View raw message