From 1c1ecff0f0ab7860b0e83cb921b9d3ace278199b Mon Sep 17 00:00:00 2001 From: Sanjay Tripathi Date: Tue, 31 Jul 2012 13:28:35 +0530 Subject: [PATCH] CS-15698: No option to update customer vpn gateway details through UI --- ui/scripts/network.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 2e6d4296a21..e41135024f7 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -4103,6 +4103,43 @@ } }, + edit: { + label: 'label.edit', + action: function(args) { + var array1 = []; + array1.push("&gateway=" + args.context.vpnCustomerGateway[0].gateway); + array1.push("&ipsecpsk=" + todb(args.context.vpnCustomerGateway[0].ipsecpsk)); + array1.push("&cidrlist=" + args.context.vpnCustomerGateway[0].cidrlist); + array1.push("&ikepolicy=" + args.context.vpnCustomerGateway[0].ikepolicy); + array1.push("&esppolicy=" + args.context.vpnCustomerGateway[0].esppolicy); + $.ajax({ + url: createURL("updateVpnCustomerGateway&id=" + args.context.vpnCustomerGateway[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jobId = json.updatecustomergatewayresponse.jobid; + args.response.success( + {_custom: + { + jobId: jobId, + getUpdatedItem: function(json) { + var item = json.queryasyncjobresultresponse.jobresult.vpncustomergateway; + return {data: item}; + } + } + } + ); + }, + error: function(json) { + args.response.error('Could not edit Vpn Customer Gateway information; please ensure all fields are valid.'); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + remove: { label: 'delete VPN Customer Gateway', messages: {