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/11/15 21:02:51 UTC

[06/50] git commit: updated refs/heads/ui-restyle to 06ccb84

CLOUDSTACK-3980: UI > Regions > GSLB > detailView > implement Edit action.


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

Branch: refs/heads/ui-restyle
Commit: 81949ec64489a0146c177abf78d2b5138076ac3e
Parents: f091b6a
Author: Jessica Wang <je...@apache.org>
Authored: Tue Nov 12 15:31:16 2013 -0800
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Nov 12 15:34:10 2013 -0800

----------------------------------------------------------------------
 ui/scripts/regions.js | 50 ++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 46 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81949ec6/ui/scripts/regions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index 28f241c..ac573b7 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -475,8 +475,33 @@
                             path: 'regions.lbUnderGSLB',
                             label: 'assigned load balancing'
                         },
-                        actions: {
-                            remove: {
+                        actions: {                            
+                        	edit: {
+                                label: 'label.edit',
+                                action: function(args) {                                	
+                                    var data = {
+                                    	id: args.context.GSLB[0].id,
+                                    	description: args.data.description,
+                                    	gslblbmethod: args.data.gslblbmethod
+                                    };                                    
+                                    $.ajax({
+                                        url: createURL('updateGlobalLoadBalancerRule'),
+                                        data: data,
+                                        success: function(json) {                                        	
+                                            var jid = json.updategloballoadbalancerruleresponse.jobid;                                           
+                                            args.response.success({
+                                                _custom: {
+                                                    jobId: jid
+                                                }
+                                            });                                            
+                                        }
+                                    });
+                                },                                
+                                notification: {
+                                    poll: pollAsyncJobResult
+                                }
+                            },                        	
+                        	remove: {
                                 label: 'delete GSLB',
                                 messages: {
                                     confirm: function(args) {
@@ -517,13 +542,30 @@
                                     }
                                 }, {
                                     description: {
-                                        label: 'label.description'
+                                        label: 'label.description',
+                                        isEditable: true
                                     },
                                     gslbdomainname: {
                                         label: 'GSLB Domain Name'
                                     },
                                     gslblbmethod: {
-                                        label: 'Algorithm'
+                                        label: 'Algorithm',
+                                        isEditable: true,
+                                        select: function(args) {
+                                            var array1 = [{
+                                                id: 'roundrobin',
+                                                description: 'roundrobin'
+                                            }, {
+                                                id: 'leastconn',
+                                                description: 'leastconn'
+                                            }, {
+                                                id: 'proximity',
+                                                description: 'proximity'
+                                            }];
+                                            args.response.success({
+                                                data: array1
+                                            });
+                                        }
                                     },
                                     gslbservicetype: {
                                         label: 'Service Type'