Repository: stratos Updated Branches: refs/heads/master bb28c542f -> 0251ad3aa
http://git-wip-us.apache.org/repos/asf/stratos/blob/0251ad3a/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 b0e4e55..fe30daf 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 @@ -22,72 +22,68 @@ var render = function (theme, data, meta, require) { if(data.error.length === 0 ){ - if(data.applicationView == true) { - theme('index', { - page_meta: [ - { - partial: 'index_title', - context: { - page_title: 'Apache Stratos - Application Managment', - page_description: 'Apache Stratos - Application Managment' + switch (data.applicationHbs) { + case "applicationView": + theme('index', { + page_meta: [ + { + partial: 'index_title', + context: { + page_title: 'Apache Stratos - Application Managment', + page_description: 'Apache Stratos - Application Managment' + } } - } - ], - header: [ - { - partial: 'index_header', - context: { + ], + header: [ + { + partial: 'index_header', + context: { + } } - } - ], - sub_header: [ - { - partial: 'index_sub_header', - context: { - breadcrumbPathLevelOne: data.breadcrumbPathLevelOne, - breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo + ], + sub_header: [ + { + partial: 'index_sub_header', + context: { + breadcrumbPathLevelOne: data.breadcrumbPathLevelOne, + breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo + } } - } - ], - left_menu: [ - { - partial: 'index_left_menu', - context: { - left_menu: data.left_menu + ], + left_menu: [ + { + partial: 'index_left_menu', + context: { + left_menu: data.left_menu + } } - } - ], - right_menu_help: [ - { - partial: 'index_right_menu_help', - context: { + ], + right_menu_help: [ + { + partial: 'index_right_menu_help', + context: { + } } - } - ], - content: [ - { - partial: 'applications_topology', - context: { - formContext: data.breadcrumbPathLevelTwo, - appName: data.appName, - topology_data: data.topology_data, - form_action: data.form_action, - formHtml: data.formHtml, - formData: data.formData, - formDataRaw: data.formDataRaw, - formDataEdit: data.formDataEdit, - isForm: data.isForm, - isEdit: data.isEdit, - formTitle: data.formTitle, - content_body: {sections: data.list_data + ], + content: [ + { + partial: 'applications_view', + context: { + applicationName: data.applicationName, + formContext: data.breadcrumbPathLevelTwo, + appName: data.appName, + applicationJSON: data.applicationJSON, + formTitle: data.formTitle } } - } - ] - }); - }else if(data.applicationDeploy == true){ + ] + }); + break; + + case "applicationTopology": + theme('index', { page_meta: [ { @@ -97,193 +93,331 @@ var render = function (theme, data, meta, require) { page_description: 'Apache Stratos - Application Managment' } } - ], - header: [ - { - partial: 'index_header', - context: { + ], + header: [ + { + partial: 'index_header', + context: { + } } - } - ], - sub_header: [ - { - partial: 'index_sub_header', - context: { - breadcrumbPathLevelOne: data.breadcrumbPathLevelOne, - breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo + ], + sub_header: [ + { + partial: 'index_sub_header', + context: { + breadcrumbPathLevelOne: data.breadcrumbPathLevelOne, + breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo + } } - } - ], - left_menu: [ - { - partial: 'index_left_menu', - context: { - left_menu: data.left_menu + ], + left_menu: [ + { + partial: 'index_left_menu', + context: { + left_menu: data.left_menu + } } - } - ], - right_menu_help: [ - { - partial: 'index_right_menu_help', - context: { + ], + right_menu_help: [ + { + partial: 'index_right_menu_help', + context: { + } } - } - ], - content: [ - { - partial: 'applications_deploy', - context: { - formContext: data.breadcrumbPathLevelTwo, - applicationName: data.applicationName, - applicationJSON: data.applicationJSON, - editorCartridges: data.editorCartridges, - editorGroups:data.editorGroups, - form_action: data.form_action, - formHtml: data.formHtml, - formData: data.formData, - formDataRaw: data.formDataRaw, - formDataEdit: data.formDataEdit, - isForm: data.isForm, - isEdit: data.isEdit, - formTitle: data.formTitle + ], + content: [ + { + partial: 'applications_topology', + context: { + formContext: data.breadcrumbPathLevelTwo, + appName: data.appName, + topologyData: data.topologyData, + form_action: data.form_action, + formHtml: data.formHtml, + formData: data.formData, + formDataRaw: data.formDataRaw, + formDataEdit: data.formDataEdit, + isForm: data.isForm, + isEdit: data.isEdit, + formTitle: data.formTitle, + content_body: {sections: data.list_data + } + } + } + + ] + }); + break; + case "applicationDeploy": + theme('index', { + page_meta: [ + { + partial: 'index_title', + context: { + page_title: 'Apache Stratos - Application Managment', + page_description: 'Apache Stratos - Application Managment' + } } - } + ], + header: [ + { + partial: 'index_header', + context: { + } + } + ], + sub_header: [ + { + partial: 'index_sub_header', + context: { + breadcrumbPathLevelOne: data.breadcrumbPathLevelOne, + breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo + } + } + ], + left_menu: [ + { + partial: 'index_left_menu', + context: { + left_menu: data.left_menu + } + } + ], + right_menu_help: [ + { + partial: 'index_right_menu_help', + context: { - ] - }); - }else if(data.applicationEditor == true){ - theme('index', { - page_meta: [ - { - partial: 'index_title', - context: { - page_title: 'Apache Stratos - Application Managment', - page_description: 'Apache Stratos - Application Managment' + } } - } - ], - header: [ - { - partial: 'index_header', - context: { + ], + content: [ + { + partial: 'applications_deploy', + context: { + formContext: data.breadcrumbPathLevelTwo, + applicationName: data.applicationName, + applicationJSON: data.applicationJSON, + editorCartridges: data.editorCartridges, + editorGroups:data.editorGroups, + form_action: data.form_action, + formHtml: data.formHtml, + formData: data.formData, + formDataRaw: data.formDataRaw, + formDataEdit: data.formDataEdit, + isForm: data.isForm, + isEdit: data.isEdit, + formTitle: data.formTitle + + } } - } - ], - sub_header: [ - { - partial: 'index_sub_header', - context: { - breadcrumbPathLevelOne: data.breadcrumbPathLevelOne, - breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo + + ] + }); + break; + + case "applicationEditor": + theme('index', { + page_meta: [ + { + partial: 'index_title', + context: { + page_title: 'Apache Stratos - Application Managment', + page_description: 'Apache Stratos - Application Managment' + } } - } - ], - left_menu: [ - { - partial: 'index_left_menu', - context: { - left_menu: data.left_menu + ], + header: [ + { + partial: 'index_header', + context: { + } } - } - ], - right_menu_help: [ - { - partial: 'index_right_menu_help', - context: { + ], + sub_header: [ + { + partial: 'index_sub_header', + context: { + breadcrumbPathLevelOne: data.breadcrumbPathLevelOne, + breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo + } + } + ], + left_menu: [ + { + partial: 'index_left_menu', + context: { + left_menu: data.left_menu + } + } + ], + right_menu_help: [ + { + partial: 'index_right_menu_help', + context: { + } } - } - ], - content: [ - { - partial: 'applications_editor', - context: { - formContext: data.breadcrumbPathLevelTwo, - appName: data.appName, - editorCartridges: data.editorCartridges, - editorGroups:data.editorGroups, - form_action: data.form_action, - formHtml: data.formHtml, - formData: data.formData, - formDataRaw: data.formDataRaw, - formDataEdit: data.formDataEdit, - isForm: data.isForm, - isEdit: data.isEdit, - formTitle: data.formTitle + ], + content: [ + { + partial: 'applications_editor', + context: { + formContext: data.breadcrumbPathLevelTwo, + appName: data.appName, + editorCartridges: data.editorCartridges, + editorGroups:data.editorGroups, + form_action: data.form_action, + formHtml: data.formHtml, + formData: data.formData, + formDataRaw: data.formDataRaw, + formDataEdit: data.formDataEdit, + isForm: data.isForm, + isEdit: data.isEdit, + formTitle: data.formTitle + } } - } - ] - }); + ] + }); + break; - }else{ - theme('index', { - page_meta: [ - { - partial: 'index_title', - context: { - page_title: 'Apache Stratos - Application Managment', - page_description: 'Apache Stratos - Application Managment' + case "applicationsGroupEditor": + theme('index', { + page_meta: [ + { + partial: 'index_title', + context: { + page_title: 'Apache Stratos - Application Managment', + page_description: 'Apache Stratos - Application Managment' + } } - } - ], - header:[ - { - partial: 'index_header', - context:{ + ], + header: [ + { + partial: 'index_header', + context: { + } } - } - ], - sub_header:[ - { - partial:'index_sub_header', - context:{ - breadcrumbPathLevelOne:data.breadcrumbPathLevelOne, - breadcrumbPathLevelTwo:data.breadcrumbPathLevelTwo + ], + sub_header: [ + { + partial: 'index_sub_header', + context: { + breadcrumbPathLevelOne: data.breadcrumbPathLevelOne, + breadcrumbPathLevelTwo: data.breadcrumbPathLevelTwo + } } - } - ], - left_menu:[ - { - partial:'index_left_menu', - context:{ - left_menu:data.left_menu + ], + left_menu: [ + { + partial: 'index_left_menu', + context: { + left_menu: data.left_menu + } } - } - ], - right_menu_help:[ - { - partial:'index_right_menu_help', - context:{ + ], + right_menu_help: [ + { + partial: 'index_right_menu_help', + context: { + } } - } - ], - content: [ - { - partial:'applications_form', - context:{ - formContext: data.breadcrumbPathLevelTwo, - form_action: data.form_action, - formHtml: data.formHtml, - formData: data.formData, - formDataRaw: data.formDataRaw, - formDataEdit: data.formDataEdit, - formtype:data.formtype, - isForm: data.isForm, - isEdit:data.isEdit, - formTitle: data.formTitle, - content_body: {sections: - data.list_data + ], + content: [ + { + partial: 'applications_group_editor', + context: { + formContext: data.breadcrumbPathLevelTwo, + appName: data.appName, + editorCartridges: data.editorCartridges, + editorGroups:data.editorGroups, + form_action: data.form_action, + formHtml: data.formHtml, + formData: data.formData, + formDataRaw: data.formDataRaw, + formDataEdit: data.formDataEdit, + isForm: data.isForm, + isEdit: data.isEdit, + formTitle: data.formTitle + } } - } - ] - }); + ] + }); + break; + default: + theme('index', { + page_meta: [ + { + partial: 'index_title', + context: { + page_title: 'Apache Stratos - Application Managment', + page_description: 'Apache Stratos - Application Managment' + } + } + ], + header:[ + { + partial: 'index_header', + context:{ + } + } + ], + sub_header:[ + { + partial:'index_sub_header', + context:{ + breadcrumbPathLevelOne:data.breadcrumbPathLevelOne, + breadcrumbPathLevelTwo:data.breadcrumbPathLevelTwo + } + } + ], + left_menu:[ + { + partial:'index_left_menu', + context:{ + left_menu:data.left_menu + } + } + ], + right_menu_help:[ + { + partial:'index_right_menu_help', + context:{ + + } + } + ], + content: [ + { + partial:'applications_form', + context:{ + formContext: data.breadcrumbPathLevelTwo, + form_action: data.form_action, + formHtml: data.formHtml, + formData: data.formData, + formDataRaw: data.formDataRaw, + formDataEdit: data.formDataEdit, + formtype:data.formtype, + isForm: data.isForm, + isEdit:data.isEdit, + formTitle: data.formTitle, + content_body: {sections: + data.list_data + } + } + } + + ] + }); + break; + } }else{ http://git-wip-us.apache.org/repos/asf/stratos/blob/0251ad3a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure.js ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure.js index 38e0428..c462a84 100644 --- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure.js +++ b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/configure.js @@ -42,8 +42,7 @@ var render = function (theme, data, meta, require) { { partial:'index_sub_header', context:{ - breadcrumbPathLevelOne:data.breadcrumbPathLevelOne, - breadcrumbPathLevelTwo:data.breadcrumbPathLevelTwo + breadcrumbPathLevelOne:data.breadcrumbPathLevelOne } } ], http://git-wip-us.apache.org/repos/asf/stratos/blob/0251ad3a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/my_cartridges.js ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/my_cartridges.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/my_cartridges.js deleted file mode 100644 index 947c5d3..0000000 --- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/my_cartridges.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -var render = function (theme, data, meta, require) { - - if(data.error.length == 0 ){ - theme('index', { - page_meta: [ - { - partial:'index_title', - context:{ - page_title:'Apache Stratos - My Cartrides', - page_description:'Apache Stratos - My Cartrides' - } - } - ], - header:[ - { - partial: 'index_header', - context:{ - } - } - ], - sub_header:[ - { - partial:'index_sub_header', - context:{ - breadcrumbPathLevelOne:data.breadcrumbPathLevelOne, - breadcrumbPathLevelTwo:data.breadcrumbPathLevelTwo - } - } - ], - left_menu:[ - { - partial:'index_left_menu', - context:{ - left_menu:data.left_menu - } - } - ], - right_menu_help:[ - { - partial:'index_right_menu_help', - context:{ - - } - } - ], - content: [ - - { - partial: 'my_cartridges', - context:{ - content_title:'My Cartridges', - content_body:{ - sections:data.myCartridges, - myCartridgeInfoStatus: data.myCartridgeInfoStatus, - myCartridgeInfo: data.myCartridgeInfo - } - - } - } - ] - }); - - }else{ - theme('index', { - page_meta: [ - { - partial:'index_title', - context:{ - page_title:'Apache Stratos Home - Error', - page_description:'Apache Stratos Home - Error' - } - } - ], - header:[ - { - partial: 'index_header', - context:{ - } - } - ], - content: [ - - { - partial: 'error_page', - context:{ - error:data.error, - content_title:'Sorry Something went Wrong...! ', - content_body:{ - - } - - } - } - ] - }); - - } -}; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/0251ad3a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/my_cartridges_info.js ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/my_cartridges_info.js b/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/my_cartridges_info.js deleted file mode 100644 index 331bdb1..0000000 --- a/components/org.apache.stratos.manager.console/console/themes/theme0/renderers/my_cartridges_info.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -var render = function (theme, data, meta, require) { - - if(data.error.length == 0 ){ - theme('index', { - page_meta: [ - { - partial:'index_title', - context:{ - page_title:'Apache Stratos My Cartrides', - page_description:'Apache Stratos My Cartrides' - } - } - ], - header:[ - { - partial: 'index_header', - context:{ - } - } - ], - sub_header:[ - { - partial:'index_sub_header', - context:{ - breadcrumbPathLevelOne:data.breadcrumbPathLevelOne, - breadcrumbPathLevelTwo:data.breadcrumbPathLevelTwo - } - } - ], - left_menu:[ - { - partial:'index_left_menu', - context:{ - left_menu:data.left_menu - } - } - ], - right_menu_help:[ - { - partial:'index_right_menu_help', - context:{ - - } - } - ], - content: [ - - { - partial: 'my_cartridges_info', - context:{ - content_title:'My Cartridge: ', - content_body:{ - myCartridgeInfo: data.myCartridgeInfo - } - - } - } - ] - }); - - }else{ - theme('index', { - page_meta: [ - { - partial:'index_title', - context:{ - page_title:'Apache Stratos Home - Error', - page_description:'Apache Stratos Home - Error' - } - } - ], - header:[ - { - partial: 'index_header', - context:{ - } - } - ], - content: [ - - { - partial: 'error_page', - context:{ - error:data.error, - content_title:'Sorry Something went Wrong...! ', - content_body:{ - - } - - } - } - ] - }); - - } -}; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/0251ad3a/components/org.apache.stratos.manager.console/console/themes/theme0/theme.js ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/themes/theme0/theme.js b/components/org.apache.stratos.manager.console/console/themes/theme0/theme.js index 69b7c05..5df0122 100644 --- a/components/org.apache.stratos.manager.console/console/themes/theme0/theme.js +++ b/components/org.apache.stratos.manager.console/console/themes/theme0/theme.js @@ -79,6 +79,13 @@ var engine = require('caramel').engine('handlebars', (function () { } }); + Handlebars.registerHelper('UnixConvert', function(unixtimestamp){ + var newDate = new Date(); + newDate.setTime(unixtimestamp); + dateString = newDate.toUTCString(); + return dateString; + }); + Handlebars.registerHelper('user', function(action, options) { if(caramel.meta().session.get("USER_NAME") != undefined ) { return caramel.meta().session.get("USER_NAME"); http://git-wip-us.apache.org/repos/asf/stratos/blob/0251ad3a/components/org.apache.stratos.manager.console/console/users_form.jag ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/users_form.jag b/components/org.apache.stratos.manager.console/console/users_form.jag index 4c2460d..21a3ec5 100644 --- a/components/org.apache.stratos.manager.console/console/users_form.jag +++ b/components/org.apache.stratos.manager.console/console/users_form.jag @@ -38,22 +38,32 @@ var caramel = require('caramel'), if (!elements) { elements = uriMatcher.match('/{context}/users/{formtype}/{action}/'); isForm = true; + if(elements.action == 'new'){ + try { + var formData = require('controllers/forms/schema/users/' + elements.formtype + '.json'), + formDataRaw = require('controllers/forms/default/users/' + elements.formtype + '.json'), + formTitle = formData.title; + }catch (e) { + log.error(e.message); + error.push({"errorMessage": e.message}); + } + } } //create left menu var leftMenu = menuGenerator(context, menuJson.menu, userPermissions); -var formData = require('controllers/forms/schema/users/' + elements.formtype + '.json'), - formDataRaw = require('controllers/forms/default/users/' + elements.formtype + '.json'), - formTitle = formData.title; + if (elements.formtype == 'users') { + formTitle = 'User'; list_data = util.RESTCalls.getUserList(); if (list_data && list_data.length === 0) { list_data = null; } } else if (elements.formtype == 'tenants') { + formTitle = 'Tenant' list_data = util.RESTCalls.getTenants(); if (list_data && list_data.length === 0) { list_data = null;
