You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/03/08 07:33:04 UTC
[03/15] stratos git commit: add deployment policy to application
editor
add deployment policy to application editor
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/54f736d5
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/54f736d5
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/54f736d5
Branch: refs/heads/master
Commit: 54f736d50406ea96ca12fa3c3b9cd0ff0a52cded
Parents: 7c7510c
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Sat Feb 28 15:13:08 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Sun Mar 8 12:02:54 2015 +0530
----------------------------------------------------------------------
.../console/applications_form.jag | 3 +++
.../theme0/js/custom/applications-editor.js | 19 ++++++++++++++++++-
.../theme0/partials/applications_editor.hbs | 1 +
.../themes/theme0/renderers/applications_form.js | 1 +
4 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/54f736d5/components/org.apache.stratos.manager.console/console/applications_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/applications_form.jag b/components/org.apache.stratos.manager.console/console/applications_form.jag
index 4273069..d65d92d 100644
--- a/components/org.apache.stratos.manager.console/console/applications_form.jag
+++ b/components/org.apache.stratos.manager.console/console/applications_form.jag
@@ -33,6 +33,7 @@ var log = new Log("apachestratos.applications_form"),
elements = uriMatcher.match('/{context}/applications/{formtype}/'),
breadcrumbPathLevelOne = 'applications',
formDataEdit = topologyData = editorGroups = editorCartridges = editorAutoscalePolicies = applicationHbs ='',
+ editorDeploymentPolicies = '',
isEdit = isForm = false,
userPermissions = session.get('PERMISSIONS');
@@ -68,6 +69,7 @@ if (!elements) {
editorGroups = util.RESTCalls.getGroups();
editorCartridges = util.RESTCalls.getCartridges();
editorAutoscalePolicies = util.RESTCalls.getPolicyAutoScales();
+ editorDeploymentPolicies = util.RESTCalls.getPolicyDeployments();
}else if(elements.formtype == 'groups' && elements.action == 'new'){
applicationHbs = 'applicationsGroupEditor';
editorCartridges = util.RESTCalls.getCartridges();
@@ -126,6 +128,7 @@ var caramelData = {
editorGroups: JSON.stringify(editorGroups),
editorCartridges: JSON.stringify(editorCartridges),
editorAutoscalePolicies: JSON.stringify(editorAutoscalePolicies),
+ editorDeploymentPolicies:JSON.stringify(editorDeploymentPolicies),
applicationHbs: applicationHbs,
applicationAlias:applicationAlias,
applicationName:applicationName,
http://git-wip-us.apache.org/repos/asf/stratos/blob/54f736d5/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js
index 5d0a0a2..ab09072 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/js/custom/applications-editor.js
@@ -497,6 +497,14 @@ var cartridgeBlockTemplate = {
"enum": [],
"required":false
},
+ "deploymentPolicy": {
+ "type":"string",
+ "id": "root/subscribableInfo/deploymentPolicy",
+ "default": "deployment_policy_1",
+ "title":"Deployment Policy: ",
+ "enum": [],
+ "required":false
+ },
"artifactRepository": {
"id": "root/subscribableInfo/artifactRepository",
"type": "object",
@@ -536,6 +544,7 @@ var cartridgeBlockDefault = {
"subscribableInfo":{
"alias":"alias2",
"autoscalingPolicy":"",
+ "deploymentPolicy":"",
"artifactRepository":{
"privateRepo":"true",
"repoUrl":"http://xxx:10080/git/default.git",
@@ -741,9 +750,17 @@ $(document).ready(function(){
for(var i=0; i<policies.length; i++){
policiesEnum.push(policies[i].id);
}
-
cartridgeBlockTemplate['properties']['subscribableInfo']['properties']['autoscalingPolicy']['enum']
=policiesEnum;
+ //get list of deploymentpolicies
+ var dpolicies = editorDeploymentPolicies;
+ var dpoliciesEnum = [];
+ for(var i=0; i<dpolicies.length; i++){
+ dpoliciesEnum.push(dpolicies[i].id);
+ }
+ cartridgeBlockTemplate['properties']['subscribableInfo']['properties']['deploymentPolicy']['enum']
+ =dpoliciesEnum;
+
}else{
startval = groupBlockDefault;
startval['name'] = ctype;
http://git-wip-us.apache.org/repos/asf/stratos/blob/54f736d5/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs
index 771cb7d..7fbaca5 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/partials/applications_editor.hbs
@@ -149,4 +149,5 @@
var cartridgeList = {{{editorCartridges}}};
var groupList = {{{editorGroups}}};
var editorAutoscalePolicies = {{{editorAutoscalePolicies}}};
+ var editorDeploymentPolicies = {{{editorDeploymentPolicies}}};
</script>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/stratos/blob/54f736d5/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
index 220ddc7..de011b6 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
+++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/applications_form.js
@@ -272,6 +272,7 @@ var render = function (theme, data, meta, require) {
editorCartridges: data.editorCartridges,
editorGroups:data.editorGroups,
editorAutoscalePolicies: data.editorAutoscalePolicies,
+ editorDeploymentPolicies: data.editorDeploymentPolicies,
form_action: data.form_action,
formHtml: data.formHtml,
formData: data.formData,