ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-1831 Fixed routing.
Date Thu, 05 Nov 2015 08:04:17 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 0e5d1674f -> 7348d2732


IGNITE-1831 Fixed routing.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7348d273
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7348d273
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7348d273

Branch: refs/heads/ignite-843-rc1
Commit: 7348d273277c87c4d5a3148677c6c46343808253
Parents: 0e5d167
Author: Andrey <anovikov@gridgain.com>
Authored: Thu Nov 5 15:04:09 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Thu Nov 5 15:04:09 2015 +0700

----------------------------------------------------------------------
 modules/control-center-web/src/main/js/app.js   |  11 --
 .../src/main/js/config/default.json             |   6 +-
 .../src/main/js/controllers/common-module.js    |  37 +++--
 .../main/js/controllers/metadata-controller.js  |   6 +-
 .../main/js/controllers/profile-controller.js   |  24 ++--
 .../src/main/js/controllers/sql-controller.js   |  18 ++-
 .../src/main/js/public/stylesheets/style.scss   |   2 +-
 .../src/main/js/routes/public.js                |  28 +++-
 .../src/main/js/routes/sql.js                   |  10 +-
 .../src/main/js/views/includes/header.jade      |   8 +-
 .../src/main/js/views/index.jade                | 141 -------------------
 .../src/main/js/views/login.jade                | 141 +++++++++++++++++++
 .../src/main/js/views/reset.jade                |   4 +-
 .../src/main/js/views/sql/sql.jade              |   4 +-
 .../src/main/js/views/templates/layout.jade     |   2 +-
 15 files changed, 237 insertions(+), 205 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/app.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app.js b/modules/control-center-web/src/main/js/app.js
index 2468774..6c994fc 100644
--- a/modules/control-center-web/src/main/js/app.js
+++ b/modules/control-center-web/src/main/js/app.js
@@ -117,17 +117,6 @@ var adminOnly = function(req, res, next) {
 app.all('/configuration/*', mustAuthenticated);
 
 app.all('*', function(req, res, next) {
-    var becomeUsed = req.session.viewedUser && req.user.admin;
-
-    if (req.url.lastIndexOf('/reset', 0) === 0) {
-        res.locals.user = null;
-        res.locals.becomeUsed = false;
-    }
-    else {
-        res.locals.user = becomeUsed ? req.session.viewedUser : req.user;
-        res.locals.becomeUsed = becomeUsed;
-    }
-
     req.currentUserId = function() {
         if (!req.user)
             return null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/config/default.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/config/default.json b/modules/control-center-web/src/main/js/config/default.json
index bf1e88b..35d58d1 100644
--- a/modules/control-center-web/src/main/js/config/default.json
+++ b/modules/control-center-web/src/main/js/config/default.json
@@ -18,8 +18,8 @@
         "keyPassphrase": "password"
     },
     "smtp": {
-        "service": "",
-        "username": "",
-        "password": ""
+            "service": "gmail",
+            "username": "no-reply@gridgain.com",
+            "password": "2!e50j1V17SO6wv"
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 711a209..9da2543 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -16,7 +16,15 @@
  */
 
 var consoleModule = angular.module('ignite-web-console',
-    ['ngAnimate', 'ngSanitize', 'mgcrea.ngStrap', 'smart-table', 'ui.ace', 'treeControl',
'darthwade.loading', 'agGrid', 'nvd3', 'dndLists']);
+    ['ngAnimate', 'ngSanitize', 'mgcrea.ngStrap', 'smart-table', 'ui.ace', 'treeControl',
'darthwade.loading', 'agGrid', 'nvd3', 'dndLists'])
+    .run(function ($rootScope, $http) {
+        $http.post('/user')
+            .success(function (user) {
+                $rootScope.user = user;
+
+                $rootScope.$broadcast('user', user);
+            });
+    });
 
 // Modal popup configuration.
 consoleModule.config(function ($modalProvider) {
@@ -1906,14 +1914,16 @@ consoleModule.controller('auth', [
 
         $scope.userDropdown = [{text: 'Profile', href: '/profile'}];
 
-        $focus('user_email');
+        $scope.$on('user', function($rootScope, user) {
+            if (user && !user.becomeUsed) {
+                if (user && user.admin)
+                    $scope.userDropdown.push({text: 'Admin Panel', href: '/admin'});
 
-        if (!$scope.becomeUsed) {
-            if ($scope.user && $scope.user.admin)
-                $scope.userDropdown.push({text: 'Admin Panel', href: '/admin'});
+                $scope.userDropdown.push({text: 'Log Out', href: '/logout'});
+            }
+        });
 
-            $scope.userDropdown.push({text: 'Log Out', href: '/logout'});
-        }
+        $focus('user_email');
 
         if ($scope.token && !$scope.error)
             $focus('user_password');
@@ -1933,6 +1943,15 @@ consoleModule.controller('auth', [
                 });
         };
 
+        $scope.validateToken = function () {
+            $http.post('/password/validate-token', {token: $common.getQueryVariable('token')})
+                .success(function (res) {
+                    $scope.email = res.email;
+                    $scope.token = res.token;
+                    $scope.error = res.error;
+                });
+        };
+
         // Try to reset user password for provided token.
         $scope.resetPassword = function (reset_info) {
             $http.post('/password/reset', reset_info)
@@ -2127,7 +2146,7 @@ consoleModule.controller('notebooks', ['$scope', '$modal', '$window',
'$http', '
         _.forEach($scope.$root.notebooks, function (notebook) {
             $scope.notebookDropdown.push({
                 text: notebook.name,
-                href: '/sql/' + notebook._id,
+                href: '/sql?id=' + notebook._id,
                 target: '_self'
             });
         });
@@ -2155,7 +2174,7 @@ consoleModule.controller('notebooks', ['$scope', '$modal', '$window',
'$http', '
             .success(function (id) {
                 _notebookNewModal.hide();
 
-                $window.location = '/sql/' + id;
+                $window.location = '/sql?id=' + id;
             })
             .error(function (message, state) {
                 $common.showError(message);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/controllers/metadata-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/metadata-controller.js b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
index 242c74c..bce3bc1 100644
--- a/modules/control-center-web/src/main/js/controllers/metadata-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
@@ -29,6 +29,10 @@ consoleModule.controller('metadataController', [
 
             $scope.ui = $common.formUI();
 
+            $scope.$on('user', function($rootScope, user) {
+                $scope.ui.packageName = user.email.replace('@', '.').split('.').reverse().join('.')
+ '.model';
+            });
+
             $scope.showMoreInfo = $message.message;
 
             $scope.agentGoal = 'load metadata from database schema';
@@ -403,8 +407,6 @@ consoleModule.controller('metadataController', [
                 return javaName.charAt(0).toLocaleLowerCase() + javaName.slice(1);
             }
 
-            $scope.ui.packageName = $scope.user.email.replace('@', '.').split('.').reverse().join('.')
+ '.model';
-
             function _saveBatch(batch) {
                 if (batch && batch.length > 0) {
                     $loading.start('loadingMetadataFromDb');

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/controllers/profile-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/profile-controller.js b/modules/control-center-web/src/main/js/controllers/profile-controller.js
index 8d37c18..894ccc3 100644
--- a/modules/control-center-web/src/main/js/controllers/profile-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/profile-controller.js
@@ -18,10 +18,12 @@
 // Controller for Profile screen.
 consoleModule.controller('profileController',
     ['$scope', '$http', '$common', '$focus', '$confirm', function ($scope, $http, $common,
$focus, $confirm) {
-    $scope.profileUser = angular.copy($scope.user);
+    $scope.$on('user', function($rootScope, user) {
+        $scope.profileUser = angular.copy(user);
 
-    if ($scope.profileUser && !$scope.profileUser.token)
-        $scope.profileUser.token = 'No security token. Regenerate please.';
+        if ($scope.profileUser && !$scope.profileUser.token)
+            $scope.profileUser.token = 'No security token. Regenerate please.';
+    });
 
     $scope.generateToken = function () {
         $confirm.confirm('Are you sure you want to change security token?')
@@ -31,11 +33,11 @@ consoleModule.controller('profileController',
     };
 
     $scope.profileChanged = function () {
-        var old = $scope.user;
+        var old = $scope.$root.user;
         var cur = $scope.profileUser;
 
-        return old.username != cur.username || old.email != cur.email || old.token != cur.token
||
-            (cur.changePassword && !$common.isEmptyString(cur.newPassword));
+        return old && (old.username != cur.username || old.email != cur.email ||
old.token != cur.token ||
+            (cur.changePassword && !$common.isEmptyString(cur.newPassword)));
     };
 
     $scope.profileCouldBeSaved = function () {
@@ -54,13 +56,13 @@ consoleModule.controller('profileController',
 
         if (profile) {
             var userName = profile.username;
-            var changeUsername = userName != $scope.user.username;
+            var changeUsername = userName != $scope.$root.user.username;
 
             var email = profile.email;
-            var changeEmail = email != $scope.user.email;
+            var changeEmail = email != $scope.$root.user.email;
 
             var token = profile.token;
-            var changeToken = token != $scope.user.token;
+            var changeToken = token != $scope.$root.user.token;
 
             if (changeUsername || changeEmail || changeToken || profile.changePassword) {
                 $http.post('/profile/save', {
@@ -77,10 +79,10 @@ consoleModule.controller('profileController',
                     profile.confirmPassword = null;
 
                     if (changeUsername)
-                        $scope.user.username = userName;
+                        $scope.$root.user.username = userName;
 
                     if (changeEmail)
-                        $scope.user.email = email;
+                        $scope.$root.user.email = email;
 
                     $focus('profile-username');
                 }).error(function (err) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index 7c4467b..1e42437 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -225,12 +225,14 @@ consoleModule.controller('sqlController',
     var loadNotebook = function () {
         $loading.start('loadingNotebookScreen');
 
-        $http.post('/notebooks/get', {noteId: $scope.noteId})
+        $http.post('/notebooks/get', {noteId: $common.getQueryVariable('id')})
             .success(function (notebook) {
                 $scope.notebook = notebook;
 
                 $scope.notebook_name = notebook.name;
 
+                $scope.expandedParagraphs = notebook.expandedParagraphs;
+
                 _.forEach(notebook.paragraphs, function (paragraph) {
                     paragraph.id = paragraphId++;
 
@@ -255,7 +257,11 @@ consoleModule.controller('sqlController',
     loadNotebook();
 
     var _saveNotebook = function (f) {
-        $http.post('/notebooks/save', $scope.notebook)
+        var note = angular.copy($scope.notebook);
+
+        note.expandedParagraphs = $scope.expandedParagraphs;
+
+        $http.post('/notebooks/save', note)
             .success(f || function() {})
             .error(function (errMsg) {
                 $common.showError(errMsg);
@@ -353,7 +359,7 @@ consoleModule.controller('sqlController',
         if ($scope.caches && $scope.caches.length > 0)
             paragraph.cacheName = $scope.caches[0].name;
 
-        $scope.notebook.expandedParagraphs.push($scope.notebook.paragraphs.length);
+        $scope.expandedParagraphs.push($scope.notebook.paragraphs.length);
 
         $scope.notebook.paragraphs.push(paragraph);
 
@@ -393,12 +399,12 @@ consoleModule.controller('sqlController',
                         return paragraph == item;
                     });
 
-                    var panel_idx = _.findIndex($scope.notebook.expandedParagraphs, function
(item) {
+                    var panel_idx = _.findIndex($scope.expandedParagraphs, function (item)
{
                         return paragraph_idx == item;
                     });
 
                     if (panel_idx >= 0)
-                        $scope.notebook.expandedParagraphs.splice(panel_idx, 1);
+                        $scope.expandedParagraphs.splice(panel_idx, 1);
 
                     $scope.notebook.paragraphs.splice(paragraph_idx, 1);
 
@@ -413,7 +419,7 @@ consoleModule.controller('sqlController',
             return paragraph == item;
         });
 
-        var panel_idx = _.findIndex($scope.notebook.expandedParagraphs, function (item) {
+        var panel_idx = _.findIndex($scope.expandedParagraphs, function (item) {
             return paragraph_idx == item;
         });
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index 5901783..565853e 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -1625,7 +1625,7 @@ a {
 }
 
 .dw-loading {
-    min-height: 200px;
+    min-height: 100px;
 }
 
 .dw-loading > .dw-loading-body > .dw-loading-text {

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/routes/public.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/public.js b/modules/control-center-web/src/main/js/routes/public.js
index c73204f..5c331c7 100644
--- a/modules/control-center-web/src/main/js/routes/public.js
+++ b/modules/control-center-web/src/main/js/routes/public.js
@@ -23,6 +23,21 @@ var db = require('../db');
 var config = require('../helpers/configuration-loader.js');
 var $commonUtils = require('./../helpers/common-utils');
 
+// GET user.
+router.post('/user', function (req, res) {
+    var becomeUsed = req.session.viewedUser && req.user.admin;
+
+    var user = req.user;
+
+    if (becomeUsed) {
+        user = req.session.viewedUser;
+
+        user.becomeUsed = true;
+    }
+
+    res.json(user);
+});
+
 // GET dropdown-menu template.
 router.get('/select', function (req, res) {
     res.render('templates/select', {});
@@ -133,8 +148,7 @@ router.post('/password/forgot', function(req, res) {
     };
 
     if (transporter.service == '' || transporter.auth.user == '' || transporter.auth.pass
== '')
-        return res.status(401).send('Can\'t send e-mail with instructions to reset password.<br
/>' +
-            'Please ask webmaster to setup smtp server!');
+        return res.status(401).send('Can\'t send e-mail with instructions to reset password.
Please ask webmaster to setup smtp server!');
 
     var token = $commonUtils.randomString(20);
 
@@ -161,7 +175,7 @@ router.post('/password/forgot', function(req, res) {
                 subject: 'Password Reset',
                 text: 'You are receiving this because you (or someone else) have requested
the reset of the password for your account.\n\n' +
                 'Please click on the following link, or paste this into your browser to complete
the process:\n\n' +
-                'http://' + req.headers.host + '/password/reset/' + token + '\n\n' +
+                'http://' + req.headers.host + '/password/reset?token=' + token + '\n\n'
+
                 'If you did not request this, please ignore this email and your password
will remain unchanged.\n\n' +
                 '--------------\n' +
                 'Apache Ignite Web Console\n'
@@ -236,8 +250,8 @@ router.get('/password/reset', function (req, res) {
 });
 
 /* GET reset password page. */
-router.get('/password/reset/:token', function (req, res) {
-    var token = req.params.token;
+router.post('/password/validate-token', function (req, res) {
+    var token = req.body.token;
 
     var data = {token: token};
 
@@ -249,7 +263,7 @@ router.get('/password/reset/:token', function (req, res) {
         else
             data.email = user.email;
 
-        res.render('reset', data);
+        res.json(data);
     });
 });
 
@@ -258,7 +272,7 @@ router.get('/', function (req, res) {
     if (req.isAuthenticated())
         res.redirect('/configuration/clusters');
     else
-        res.render('index');
+        res.render('login');
 });
 
 module.exports = router;

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/routes/sql.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/sql.js b/modules/control-center-web/src/main/js/routes/sql.js
index 6925eed..ba23eef 100644
--- a/modules/control-center-web/src/main/js/routes/sql.js
+++ b/modules/control-center-web/src/main/js/routes/sql.js
@@ -19,19 +19,19 @@ var router = require('express').Router();
 var db = require('../db');
 
 router.get('/rate', function (req, res) {
-    res.render('sql/paragraph-rate', {});
+    res.render('sql/paragraph-rate');
 });
 
 router.get('/chart-settings', function (req, res) {
-    res.render('sql/chart-settings', {});
+    res.render('sql/chart-settings');
 });
 
 router.get('/cache-metadata', function (req, res) {
-    res.render('sql/cache-metadata', {});
+    res.render('sql/cache-metadata');
 });
 
-router.get('/:noteId', function (req, res) {
-    res.render('sql/sql', {noteId: req.params.noteId});
+router.get('/', function (req, res) {
+    res.render('sql/sql');
 });
 
 module.exports = router;

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/views/includes/header.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/header.jade b/modules/control-center-web/src/main/js/views/includes/header.jade
index 1d15318..18d161a 100644
--- a/modules/control-center-web/src/main/js/views/includes/header.jade
+++ b/modules/control-center-web/src/main/js/views/includes/header.jade
@@ -18,15 +18,15 @@ mixin header-item(active, ref, txt)
         a(ng-class='{active: isActive("#{active}")}' href='#{ref}') #{txt}
 
 header#header.header
-    .viewedUser(ng-show='becomeUsed') Currently assuming "
-        strong {{user.username}}
+    .viewedUser(ng-show='$root.user.becomeUsed') Currently assuming "
+        strong {{$root.user.username}}
         | ",&nbsp;&nbsp;
         a(href='/admin/become') revert to your identity.
     .container(ng-controller='auth')
         h1.navbar-brand
             a(href='/') Apache Ignite Web Console
         .navbar-collapse.collapse(ng-controller='activeLink')
-            ul.nav.navbar-nav(ng-show='user')
+            ul.nav.navbar-nav(ng-show='$root.user')
                 li
                     a.dropdown-toggle(ng-class='{active: isActive("/configuration")}' data-toggle='dropdown'
bs-dropdown='configurationDropdown' data-placement='bottom-right') Configuration
                         span.caret
@@ -37,6 +37,6 @@ header#header.header
                     a(ng-hide='$root.notebooks.length > 0' ng-click='inputNotebookName()')
SQL
                 //+header-item('/deploy', '/deploy', 'Deploy')
             ul.nav.navbar-nav.pull-right
-                li(ng-if='user')
+                li(ng-if='$root.user')
                     a.dropdown-toggle(data-toggle='dropdown' ng-class='{active: isActive("/profile")
|| isActive("/admin")}' bs-dropdown='userDropdown' data-placement='bottom-right') {{user.username}}
                         span.caret

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/views/index.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/index.jade b/modules/control-center-web/src/main/js/views/index.jade
deleted file mode 100644
index 119ffb8..0000000
--- a/modules/control-center-web/src/main/js/views/index.jade
+++ /dev/null
@@ -1,141 +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.
-
-extends templates/layout
-
-append scripts
-    script(src='//cdn.rawgit.com/twbs/bootstrap/master/js/carousel.js')
-
-mixin lbl(txt)
-    label.col-xs-3.col-md-3.required #{txt}
-
-block body
-    header#header.header
-        .container
-            h1.navbar-brand
-                a(href='/') Apache Ignite Web Configurator
-            p.navbar-text(style='font-size: 18px;') Apache Ignite Web Console
-
-    .container.body-container
-        .main-content(ng-controller='auth')
-            .row.greedy.home
-                .col-xs-12.col-md-6
-                    form(name='loginForm')
-                        .modal-body.row(style='padding: 0; margin: 0')
-                            .settings-row(ng-if='action == "register"')
-                                h3.login-header Sign Up
-                            .settings-row(ng-if='action == "login"')
-                                h3.login-header Sign In
-                            .settings-row(ng-if='action == "password/forgot"')
-                                h3.login-header Forgot password?
-                            .settings-row
-                                p.col-xs-12.col-md-11(ng-show='action == "password/forgot"')
-                                    | That's ok! Simply enter your email below and a reset
password link will be sent to you via email. You can then follow that link and select a new
password.
-                            .settings-row(ng-show='action == "register"')
-                                +lbl('Full Name:')
-                                .col-xs-9.col-md-8
-                                    input#user_name.form-control(enter-focus-next='user_email'
type='text' ng-model='user_info.username' placeholder='John Smith' ng-required='action=="register"')
-                            .settings-row
-                                +lbl('Email:')
-                                .col-xs-9.col-md-8
-                                    input#user_email.form-control(enter-focus-next='user_password'
type='email' ng-model='user_info.email' placeholder='you@domain.com' required on-enter='action
== "password/forgot" && loginForm.$valid && auth(action, user_info)')
-                            .settings-row(ng-show='action != "password/forgot"')
-                                +lbl('Password:')
-                                .col-xs-9.col-md-8
-                                    input#user_password.form-control(enter-focus-next='user_confirm'
type='password' ng-model='user_info.password' placeholder='Password' ng-required='action !=
"password/forgot"' on-enter='action == "login" && loginForm.$valid && auth(action,
user_info)')
-                            .settings-row(ng-if='action == "register"')
-                                +lbl('Confirm:')
-                                .col-xs-9.col-md-8
-                                    input#user_confirm.form-control(type='password' ng-model='user_info.confirm'
match='user_info.password' placeholder='Confirm password' ng-required='action == "register"'
on-enter='loginForm.$valid && auth(action, user_info)')
-                        .col-xs-12.col-md-11
-                            .login-footer(ng-show='action == "register"')
-                                a.labelField(ng-click='action = "password/forgot"' on-click-focus='user_email')
Forgot password?
-                                a.labelLogin(ng-click='action = "login"' on-click-focus='user_email')
Sign In
-                                button#signup.btn.btn-primary(ng-click='auth(action, user_info)'
ng-disabled='loginForm.$invalid') Sign Up
-                        .col-xs-12.col-md-11
-                            .login-footer(ng-show='action == "password/forgot"')
-                                a.labelField(ng-click='action = "login"' on-click-focus='user_email')
Sign In
-                                button#forgot.btn.btn-primary(ng-click='auth(action, user_info)'
ng-disabled='loginForm.$invalid') Send it to me
-                        .col-xs-12.col-md-11
-                            .login-footer(ng-show='action == "login"')
-                                a.labelField(ng-click='action = "password/forgot"' on-click-focus='user_email')
Forgot password?
-                                a.labelLogin(ng-click='action = "register"' on-click-focus='user_name')
Sign Up
-                                button#login.btn.btn-primary(ng-click='auth(action, user_info)'
ng-disabled='loginForm.$invalid') Sign In
-
-                    .col-xs-12.col-md-11.home-panel
-                        p Apache Ignite Web Console is an interactive web management tool
which allows users to:
-                        ul
-                            li Create and download various configurations for Apache Ignite
-                            li Automatically load SQL metadata from any RDBMS
-                            li Connect to Ignite cluster and run SQL analytics on it
-                .col-xs-12.col-md-6
-                    #carousel.carousel.slide(data-ride='carousel')
-                        // Indicators
-                        ol.carousel-indicators
-                            li.active(data-target='#carousel', data-slide-to='0')
-                            li(data-target='#carousel', data-slide-to='1')
-                            li(data-target='#carousel', data-slide-to='2')
-                            li(data-target='#carousel', data-slide-to='3')
-                            li(data-target='#carousel', data-slide-to='4')
-                            li(data-target='#carousel', data-slide-to='5')
-                            li(data-target='#carousel', data-slide-to='6')
-                        // Wrapper for slides
-                        .carousel-inner(role='listbox')
-                            .item.active
-                                img(src='/images/cluster.png', alt='Cluster screen')
-                                .carousel-caption
-                                    h3 Clusters screen
-                                    p Configure clusters, link clusters to caches
-                            .item
-                                img(src='/images/cache.png', alt='Caches screen')
-                                .carousel-caption
-                                    h3 Caches screen
-                                    p Configure caches, link metadata to caches, link caches
to clusters
-                            .item
-                                img(src='/images/metadata.png', alt='Metadatas screen')
-                                .carousel-caption
-                                    h3 Metadata screen
-                                    p Manually enter metadata or load from database
-                            .item
-                                img(src='/images/summary.png', alt='Summary screen')
-                                .carousel-caption
-                                    h3 Summary screen
-                                    p Download XML config, JAVA code, Docker file
-                            .item
-                                img(src='/images/query-table.png', alt='Query')
-                                .carousel-caption
-                                    h3 Query
-                                    p Explain SQL, execute, scan queries
-                            .item
-                                img(src='/images/query-metadata.png', alt='Cache metadata')
-                                .carousel-caption
-                                    h3 Cache metadata
-                                    p View cache type metadata
-                            .item
-                                img(src='/images/query-chart.png', alt='Query chart')
-                                .carousel-caption
-                                    h3 Query chart
-                                    p View data in tabular form and as charts
-                        // Controls
-                        a.left.carousel-control(href='#carousel', role='button', data-slide='prev')
-                            span.fa.fa-chevron-left(aria-hidden='true')
-                            span.sr-only Previous
-                        a.right.carousel-control(href='#carousel', role='button', data-slide='next')
-                            span.fa.fa-chevron-right(aria-hidden='true')
-                            span.sr-only Next
-    include includes/footer
-
-

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/views/login.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/login.jade b/modules/control-center-web/src/main/js/views/login.jade
new file mode 100644
index 0000000..119ffb8
--- /dev/null
+++ b/modules/control-center-web/src/main/js/views/login.jade
@@ -0,0 +1,141 @@
+//-
+    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.
+
+extends templates/layout
+
+append scripts
+    script(src='//cdn.rawgit.com/twbs/bootstrap/master/js/carousel.js')
+
+mixin lbl(txt)
+    label.col-xs-3.col-md-3.required #{txt}
+
+block body
+    header#header.header
+        .container
+            h1.navbar-brand
+                a(href='/') Apache Ignite Web Configurator
+            p.navbar-text(style='font-size: 18px;') Apache Ignite Web Console
+
+    .container.body-container
+        .main-content(ng-controller='auth')
+            .row.greedy.home
+                .col-xs-12.col-md-6
+                    form(name='loginForm')
+                        .modal-body.row(style='padding: 0; margin: 0')
+                            .settings-row(ng-if='action == "register"')
+                                h3.login-header Sign Up
+                            .settings-row(ng-if='action == "login"')
+                                h3.login-header Sign In
+                            .settings-row(ng-if='action == "password/forgot"')
+                                h3.login-header Forgot password?
+                            .settings-row
+                                p.col-xs-12.col-md-11(ng-show='action == "password/forgot"')
+                                    | That's ok! Simply enter your email below and a reset
password link will be sent to you via email. You can then follow that link and select a new
password.
+                            .settings-row(ng-show='action == "register"')
+                                +lbl('Full Name:')
+                                .col-xs-9.col-md-8
+                                    input#user_name.form-control(enter-focus-next='user_email'
type='text' ng-model='user_info.username' placeholder='John Smith' ng-required='action=="register"')
+                            .settings-row
+                                +lbl('Email:')
+                                .col-xs-9.col-md-8
+                                    input#user_email.form-control(enter-focus-next='user_password'
type='email' ng-model='user_info.email' placeholder='you@domain.com' required on-enter='action
== "password/forgot" && loginForm.$valid && auth(action, user_info)')
+                            .settings-row(ng-show='action != "password/forgot"')
+                                +lbl('Password:')
+                                .col-xs-9.col-md-8
+                                    input#user_password.form-control(enter-focus-next='user_confirm'
type='password' ng-model='user_info.password' placeholder='Password' ng-required='action !=
"password/forgot"' on-enter='action == "login" && loginForm.$valid && auth(action,
user_info)')
+                            .settings-row(ng-if='action == "register"')
+                                +lbl('Confirm:')
+                                .col-xs-9.col-md-8
+                                    input#user_confirm.form-control(type='password' ng-model='user_info.confirm'
match='user_info.password' placeholder='Confirm password' ng-required='action == "register"'
on-enter='loginForm.$valid && auth(action, user_info)')
+                        .col-xs-12.col-md-11
+                            .login-footer(ng-show='action == "register"')
+                                a.labelField(ng-click='action = "password/forgot"' on-click-focus='user_email')
Forgot password?
+                                a.labelLogin(ng-click='action = "login"' on-click-focus='user_email')
Sign In
+                                button#signup.btn.btn-primary(ng-click='auth(action, user_info)'
ng-disabled='loginForm.$invalid') Sign Up
+                        .col-xs-12.col-md-11
+                            .login-footer(ng-show='action == "password/forgot"')
+                                a.labelField(ng-click='action = "login"' on-click-focus='user_email')
Sign In
+                                button#forgot.btn.btn-primary(ng-click='auth(action, user_info)'
ng-disabled='loginForm.$invalid') Send it to me
+                        .col-xs-12.col-md-11
+                            .login-footer(ng-show='action == "login"')
+                                a.labelField(ng-click='action = "password/forgot"' on-click-focus='user_email')
Forgot password?
+                                a.labelLogin(ng-click='action = "register"' on-click-focus='user_name')
Sign Up
+                                button#login.btn.btn-primary(ng-click='auth(action, user_info)'
ng-disabled='loginForm.$invalid') Sign In
+
+                    .col-xs-12.col-md-11.home-panel
+                        p Apache Ignite Web Console is an interactive web management tool
which allows users to:
+                        ul
+                            li Create and download various configurations for Apache Ignite
+                            li Automatically load SQL metadata from any RDBMS
+                            li Connect to Ignite cluster and run SQL analytics on it
+                .col-xs-12.col-md-6
+                    #carousel.carousel.slide(data-ride='carousel')
+                        // Indicators
+                        ol.carousel-indicators
+                            li.active(data-target='#carousel', data-slide-to='0')
+                            li(data-target='#carousel', data-slide-to='1')
+                            li(data-target='#carousel', data-slide-to='2')
+                            li(data-target='#carousel', data-slide-to='3')
+                            li(data-target='#carousel', data-slide-to='4')
+                            li(data-target='#carousel', data-slide-to='5')
+                            li(data-target='#carousel', data-slide-to='6')
+                        // Wrapper for slides
+                        .carousel-inner(role='listbox')
+                            .item.active
+                                img(src='/images/cluster.png', alt='Cluster screen')
+                                .carousel-caption
+                                    h3 Clusters screen
+                                    p Configure clusters, link clusters to caches
+                            .item
+                                img(src='/images/cache.png', alt='Caches screen')
+                                .carousel-caption
+                                    h3 Caches screen
+                                    p Configure caches, link metadata to caches, link caches
to clusters
+                            .item
+                                img(src='/images/metadata.png', alt='Metadatas screen')
+                                .carousel-caption
+                                    h3 Metadata screen
+                                    p Manually enter metadata or load from database
+                            .item
+                                img(src='/images/summary.png', alt='Summary screen')
+                                .carousel-caption
+                                    h3 Summary screen
+                                    p Download XML config, JAVA code, Docker file
+                            .item
+                                img(src='/images/query-table.png', alt='Query')
+                                .carousel-caption
+                                    h3 Query
+                                    p Explain SQL, execute, scan queries
+                            .item
+                                img(src='/images/query-metadata.png', alt='Cache metadata')
+                                .carousel-caption
+                                    h3 Cache metadata
+                                    p View cache type metadata
+                            .item
+                                img(src='/images/query-chart.png', alt='Query chart')
+                                .carousel-caption
+                                    h3 Query chart
+                                    p View data in tabular form and as charts
+                        // Controls
+                        a.left.carousel-control(href='#carousel', role='button', data-slide='prev')
+                            span.fa.fa-chevron-left(aria-hidden='true')
+                            span.sr-only Previous
+                        a.right.carousel-control(href='#carousel', role='button', data-slide='next')
+                            span.fa.fa-chevron-right(aria-hidden='true')
+                            span.sr-only Next
+    include includes/footer
+
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/views/reset.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/reset.jade b/modules/control-center-web/src/main/js/views/reset.jade
index 08bd521..eaee2af 100644
--- a/modules/control-center-web/src/main/js/views/reset.jade
+++ b/modules/control-center-web/src/main/js/views/reset.jade
@@ -17,12 +17,12 @@
 extends templates/layout
 
 block container
-    .row(ng-init='email = #{JSON.stringify(email)}; token = #{JSON.stringify(token)}; error=#{JSON.stringify(error)}')
+    .row(ng-controller='auth' ng-init='validateToken()')
         .text-center(ng-if='!token')
             p Further instructions for password reset have been sent to your e-mail address.
         .text-center(ng-if='error')
             p {{::error}}
-        div(ng-controller='auth' ng-if='token && !error')
+        div(ng-if='token && !error')
             form.form-horizontal(name='resetForm' ng-init='reset_info.token = token')
                 .settings-row
                     label.col-sm-1 E-mail:

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/views/sql/sql.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/sql.jade b/modules/control-center-web/src/main/js/views/sql/sql.jade
index be92dd9..803b87a 100644
--- a/modules/control-center-web/src/main/js/views/sql/sql.jade
+++ b/modules/control-center-web/src/main/js/views/sql/sql.jade
@@ -56,7 +56,7 @@ mixin chart-settings(mdl)
 
 block container
     .row
-        .col-sm-12(ng-init='noteId = "#{noteId}"')
+        .col-sm-12
             .docs-content(ng-controller='sqlController' dw-loading='loadingNotebookScreen'
dw-loading-options='{text: "Loading notebook screen...", className: "page-loading-overlay"}')
                 div(ng-if='!notebook' style='text-align: center')
                     h2 Failed to load notebook
@@ -101,7 +101,7 @@ block container
                                 .btn-group(style='margin-top: 2px')
                                     +btn-toolbar('fa-plus', 'addParagraph()', 'Add new query')
                 .docs-body.paragraphs
-                    .panel-group(bs-collapse ng-model='notebook.expandedParagraphs' data-allow-multiple='true'
data-start-collapsed='false')
+                    .panel-group(bs-collapse ng-model='expandedParagraphs' data-allow-multiple='true'
data-start-collapsed='false')
                         .panel.panel-default(ng-repeat='paragraph in notebook.paragraphs')
                             .panel-heading(id='paragraph-{{paragraph.id}}' bs-collapse-toggle)
                                 .row

http://git-wip-us.apache.org/repos/asf/ignite/blob/7348d273/modules/control-center-web/src/main/js/views/templates/layout.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/layout.jade b/modules/control-center-web/src/main/js/views/templates/layout.jade
index d2336a9..e765760 100644
--- a/modules/control-center-web/src/main/js/views/templates/layout.jade
+++ b/modules/control-center-web/src/main/js/views/templates/layout.jade
@@ -15,7 +15,7 @@
     limitations under the License.
 
 doctype html
-html(ng-app='ignite-web-console' ng-init='user = #{JSON.stringify(user)}; becomeUsed = #{becomeUsed}')
+html(ng-app='ignite-web-console')
     head
         title=title
 


Mime
View raw message