Updated Branches: refs/heads/vpc 969786093 -> 6aee5f2ae
cloudstack 3.0 UI - site to site VPN - VPN customer gateway - implement Edit
mode.
Conflicts:
ui/scripts/network.js
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit:
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6aee5f2a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6aee5f2a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6aee5f2a
Branch: refs/heads/vpc
Commit: 6aee5f2aefa4a8b7fd0af4d32599e5212358a5ea
Parents: 9697860
Author: Jessica Wang <[email protected]>
Authored: Thu Aug 2 15:04:12 2012 -0700
Committer: Jessica Wang <[email protected]>
Committed: Fri Aug 3 13:24:34 2012 -0700
----------------------------------------------------------------------
ui/scripts/network.js | 246 ++++++++++++++++++++++++++++++--------------
1 files changed, 169 insertions(+), 77 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6aee5f2a/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index a5df76f..9319416 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -3936,81 +3936,127 @@
label: 'CIDR list',
validation: { required: true }
},
-
ipsecpsk: {
-
label: 'IPsec Preshared-Key',
-
validation: { required: true }
- },
-
ikepolicy: {
-
label: 'IKE policy',
-
select: function(args) {
-
var items = [];
-
items.push({id: '3des-md5', description: '3des-md5'});
-
items.push({id: 'aes-md5', description: 'aes-md5'});
-
items.push({id: 'aes128-md5', description: 'aes128-md5'});
-
items.push({id: '3des-sha1', description: '3des-sha1'});
-
items.push({id: 'aes-sha1', description: 'aes-sha1'});
-
items.push({id: 'aes128-sha1', description: 'aes128-sha1'});
-
args.response.success({data: items});
-
}
- },
-
esppolicy: {
-
label: 'ESP policy',
-
select: function(args) {
-
var items = [];
-
items.push({id: '3des-md5', description: '3des-md5'});
-
items.push({id: 'aes-md5', description: 'aes-md5'});
-
items.push({id: 'aes128-md5', description: 'aes128-md5'});
-
items.push({id: '3des-sha1', description: '3des-sha1'});
-
items.push({id: 'aes-sha1', description: 'aes-sha1'});
-
items.push({id: 'aes128-sha1', description: 'aes128-sha1'});
-
args.response.success({data: items});
-
}
- },
-
lifetime: {
-
label: 'Lifetime (second)',
-
defaultValue: '86400',
-
validation: { required: false, number: true }
- }
- }
- },
- action: function(args)
{
- $.ajax({
- url:
createURL('createVpnCustomerGateway'),
- data: {
+ gateway: {
+ label: 'label.gateway',
+ validation: { required: true }
+ },
+ cidrlist: {
+ label: 'CIDR list',
+ validation: { required: true }
+ },
+ ipsecpsk: {
+ label: 'IPsec Preshared-Key',
+ validation: { required: true }
+ },
+ ikepolicy: {
+ label: 'IKE policy',
+ select: function(args) {
+ var items = [];
+ items.push({id: '3des-md5', description: '3des-md5'});
+ items.push({id: 'aes-md5', description: 'aes-md5'});
+ items.push({id: 'aes128-md5', description:
'aes128-md5'});
+ items.push({id: '3des-sha1', description: '3des-sha1'});
+ items.push({id: 'aes-sha1', description: 'aes-sha1'});
+ items.push({id: 'aes128-sha1', description:
'aes128-sha1'});
+ args.response.success({data: items});
+ }
+ },
+ esppolicy: {
+ label: 'ESP policy',
+ select: function(args) {
+ var items = [];
+ items.push({id: '3des-md5', description: '3des-md5'});
+ items.push({id: 'aes-md5', description: 'aes-md5'});
+ items.push({id: 'aes128-md5', description:
'aes128-md5'});
+ items.push({id: '3des-sha1', description: '3des-sha1'});
+ items.push({id: 'aes-sha1', description: 'aes-sha1'});
+ items.push({id: 'aes128-sha1', description:
'aes128-sha1'});
+ args.response.success({data: items});
+ }
+ },
+ lifetime: {
+ label: 'Lifetime (second)',
+ defaultValue: '86400',
+ validation: { required: false, number: true }
+ }
+ }
+ },
+ action: function(args) {
+ $.ajax({
+ url: createURL('createVpnCustomerGateway'),
+ data: {
name:
args.data.name,
+ gateway: args.data.gateway,
+ cidrlist: args.data.cidrlist,
+ ipsecpsk: args.data.ipsecpsk,
+ ikepolicy: args.data.ikepolicy,
+ esppolicy: args.data.esppolicy,
+ lifetime: args.data.lifetime
+ },
+ dataType: 'json',
+ success: function(json) {
+ var jid = json.createvpncustomergatewayresponse.jobid;
+ args.response.success(
+ {_custom:
+ {
+ jobId: jid,
+ getUpdatedItem: function(json) {
+ return
json.queryasyncjobresultresponse.jobresult.vpncustomergateway;
+ }
+ }
+ }
+ );
+ }
+ });
+ },
+ notification: {
+ poll: pollAsyncJobResult
+ }
+ }
+ },
+
+ detailView: {
+ name: 'label.details',
+ actions: {
+ edit: {
+ label: 'label.edit',
+ action: function(args) {
+ var
data = {
+ id:
args.context.vpnCustomerGateway[0].id,
+
name: args.data.name,
gateway: args.data.gateway,
cidrlist: args.data.cidrlist,
ipsecpsk: args.data.ipsecpsk,
ikepolicy: args.data.ikepolicy,
esppolicy: args.data.esppolicy,
lifetime: args.data.lifetime
- },
-
dataType: 'json',
-
success: function(json) {
-
var jid = json.createvpncustomergatewayresponse.jobid;
-
args.response.success(
-
{_custom:
-
{
-
jobId: jid,
-
getUpdatedItem: function(json) {
-
return
json.queryasyncjobresultresponse.jobresult.vpncustomergateway;
-
}
+ };
+
+ $.ajax({
+ url: createURL('updateVpnCustomerGateway'),
+ data: data,
+ success: function(json) {
+
var jobId = json.updatecustomergatewayresponse.jobid;
+
args.response.success(
+
{_custom:
+
{
+
jobId: jobId,
+
getUpdatedItem: function(json) {
+
var item =
json.queryasyncjobresultresponse.jobresult.vpncustomergateway;
+
args.response.success({ data: item });
+
}
+
}
}
-
}
-
);
- }
- });
- },
- notification: {
- poll:
pollAsyncJobResult
- }
- }
- },
-
- detailView: {
- name: 'label.details',
- actions: {
- remove: {
+
);
+ }
+ });
+ },
+ notification: {
+ poll: pollAsyncJobResult
+ }
+ },
+
+ remove: {
label: 'delete VPN Customer Gateway',
messages: {
confirm: function(args) {
@@ -4049,17 +4095,63 @@
title: 'label.details',
fields: [
{
- gateway: { label: 'label.gateway' }
- },
- {
-
cidrlist: { label: 'CIDR list' },
-
ipsecpsk: { label: 'IPsec Preshared-Key' },
+ name:
{
+
label: 'label.name',
+
isEditable: true,
+ validation: { required:
true }
+
}
+ },
+ {
+
gateway: {
+
label: 'label.gateway',
+ isEditable: true,
+ validation: { required:
true }
+
},
+ cidrlist: {
+
label: 'CIDR list',
+ isEditable: true,
+ validation: { required:
true }
+
},
+ ipsecpsk: {
+
label: 'IPsec Preshared-Key',
+ isEditable: true,
+ validation: { required:
true }
+
},
+ ikepolicy: {
+
label: 'IKE policy',
+ isEditable: true,
+
select: function(args) {
+
var items = [];
+
items.push({id: '3des-md5', description: '3des-md5'});
+
items.push({id: 'aes-md5', description: 'aes-md5'});
+
items.push({id: 'aes128-md5', description: 'aes128-md5'});
+
items.push({id: '3des-sha1', description: '3des-sha1'});
+
items.push({id: 'aes-sha1', description: 'aes-sha1'});
+
items.push({id: 'aes128-sha1', description: 'aes128-sha1'});
+
args.response.success({data: items});
+
}
+
},
+ esppolicy:{
+
label: 'ESP policy',
+ isEditable: true,
+
select: function(args) {
+
var items = [];
+
items.push({id: '3des-md5', description: '3des-md5'});
+
items.push({id: 'aes-md5', description: 'aes-md5'});
+
items.push({id: 'aes128-md5', description: 'aes128-md5'});
+
items.push({id: '3des-sha1', description: '3des-sha1'});
+
items.push({id: 'aes-sha1', description: 'aes-sha1'});
+
items.push({id: 'aes128-sha1', description: 'aes128-sha1'});
+
args.response.success({data: items});
+
}
+
},
+ lifetime :{
+
label: 'Lifetime (second)',
+ isEditable: true
+
},
id: { label: 'label.id' },
-
ikepolicy: { label: 'IKE policy'},
-
esppolicy:{ label: 'ESP policy'},
-
lifetime :{label: 'Lifetime (second)'},
-
domain: { label: 'label.domain' },
-
account: { label: 'label.account' }
+ domain: { label: 'label.domain' },
+ account: { label: 'label.account' }
}
],
dataProvider: function(args) {
