From 81949ec64489a0146c177abf78d2b5138076ac3e Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 12 Nov 2013 15:31:16 -0800 Subject: [PATCH] CLOUDSTACK-3980: UI > Regions > GSLB > detailView > implement Edit action. --- ui/scripts/regions.js | 50 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index 28f241ca848..ac573b74025 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'