Adding the Add Virtual Network window Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3ed58d8b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3ed58d8b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3ed58d8b
Branch: refs/heads/sf-plugins Commit: 3ed58d8bb725c7990bfa11ce3001334ac6be4726 Parents: 017ed7d Author: Mike Tutkowski <mike.tutkow...@solidfire.com> Authored: Tue Jul 21 12:50:50 2015 -0600 Committer: CloudStack <cloudstack@cloudstack-virtual-machine.(none)> Committed: Tue Jul 28 13:42:44 2015 -0600 ---------------------------------------------------------------------- ui/plugins/sfAdministration/sfAdministration.js | 137 ++++++++++++++++++- 1 file changed, 135 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ed58d8b/ui/plugins/sfAdministration/sfAdministration.js ---------------------------------------------------------------------- diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js index 7afeeda..cbabf39 100644 --- a/ui/plugins/sfAdministration/sfAdministration.js +++ b/ui/plugins/sfAdministration/sfAdministration.js @@ -61,7 +61,7 @@ }, messages: { confirm: function(args) { - return 'Please fill in the following data to add a new reference to a cluster.'; + return 'Please fill in the following data to add a reference to a cluster.'; }, notification: function(args) { return 'Add Reference to Cluster'; @@ -69,7 +69,7 @@ }, createForm: { title: 'Add Reference to Cluster', - desc: 'Please fill in the following data to add a new reference to a cluster.', + desc: 'Please fill in the following data to add a reference to a cluster.', fields: { availabilityZone: { label: 'label.availability.zone', @@ -337,6 +337,139 @@ args.response.error(errorMessage); } }); + }, + actions: { + add: { + label: 'Add Virtual Network', + preFilter: function(args) { + return true; + }, + messages: { + confirm: function(args) { + return 'Please fill in the following data to add a virtual network.'; + }, + notification: function(args) { + return 'Add Virtual Network'; + } + }, + createForm: { + title: 'Add Virtual Network', + desc: 'Please fill in the following data to add a virtual network.', + fields: { + account: { + label: 'Account', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listAccounts&listAll=true"), + dataType: "json", + async: true, + success: function(json) { + var accountObjs = json.listaccountsresponse.account; + + args.response.success({ + descriptionField: 'name', + data: accountObjs + }); + } + }); + } + }, + name: { + label: 'Name', + validation: { + required: true + } + }, + description: { + label: 'Description', + validation: { + required: true + } + }, + tag: { + label: 'Tag', + validation: { + required: true + } + }, + physicalnetwork: { + label: 'Physical Network', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listAccounts&listAll=true"), + dataType: "json", + async: true, + success: function(json) { + var accountObjs = json.listaccountsresponse.account; + + args.response.success({ + descriptionField: 'name', + data: accountObjs + }); + } + }); + } + }, + networkoffering: { + label: 'Network Offering', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listAccounts&listAll=true"), + dataType: "json", + async: true, + success: function(json) { + var accountObjs = json.listaccountsresponse.account; + + args.response.success({ + descriptionField: 'name', + data: accountObjs + }); + } + }); + } + }, + gateway: { + label: 'Gateway', + validation: { + required: true + } + }, + netmask: { + label: 'Netmask', + validation: { + required: true + } + }, + startip: { + label: 'Start IP', + validation: { + required: true + } + }, + endip: { + label: 'End IP', + validation: { + required: true + } + }, + svip: { + label: 'SVIP', + validation: { + required: true + } + } + } + } + } } } }