ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [4/4] incubator-ignite git commit: # IGNITE-843 Add ability to see user's configuration by admin.
Date Tue, 07 Jul 2015 20:34:06 GMT
# IGNITE-843 Add ability to see user's configuration by admin.


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

Branch: refs/heads/ignite-843
Commit: 2dc46778412f6bf94c581fa58cf1e82162c10109
Parents: 116f682
Author: sevdokimov <sergey.evdokimov@jetbrains.com>
Authored: Tue Jul 7 23:33:56 2015 +0300
Committer: sevdokimov <sergey.evdokimov@jetbrains.com>
Committed: Tue Jul 7 23:33:56 2015 +0300

----------------------------------------------------------------------
 modules/web-control-center/nodejs/routes/admin.js       | 10 ++++++++++
 .../nodejs/views/admin/userList_content.html            |  2 +-
 .../nodejs/views/includes/header.jade                   | 12 ++++++------
 modules/web-control-center/nodejs/views/layout.jade     |  2 +-
 4 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2dc46778/modules/web-control-center/nodejs/routes/admin.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/routes/admin.js b/modules/web-control-center/nodejs/routes/admin.js
index 6ec2ac7..87049e0 100644
--- a/modules/web-control-center/nodejs/routes/admin.js
+++ b/modules/web-control-center/nodejs/routes/admin.js
@@ -57,5 +57,15 @@ router.get('/userList', function(req, res) {
     res.render('admin/userList', { user: req.user });
 });
 
+router.get('/become', function(req, res) {
+    var userId = req.query.userId;
+    
+    if (!userId)
+        userId = null;
+    
+    res.cookie('currentUserId', userId);
+    
+    res.redirect('/')
+});
 
 module.exports = router;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2dc46778/modules/web-control-center/nodejs/views/admin/userList_content.html
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/views/admin/userList_content.html b/modules/web-control-center/nodejs/views/admin/userList_content.html
index 595891c..e8a81f2 100644
--- a/modules/web-control-center/nodejs/views/admin/userList_content.html
+++ b/modules/web-control-center/nodejs/views/admin/userList_content.html
@@ -40,7 +40,7 @@
                             <span class="glyphicon glyphicon-remove" style="color: red"></span>
                         </a>
                         
-                        <a ng-href="../clusters" title="View user's configurations">
+                        <a ng-href="become?userId={{user._id}}" title="View user's configurations">
                             <span class="glyphicon glyphicon-eye-open"></span>
                         </a>
                     </td>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2dc46778/modules/web-control-center/nodejs/views/includes/header.jade
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/views/includes/header.jade b/modules/web-control-center/nodejs/views/includes/header.jade
index f2e2d38..53e46a9 100644
--- a/modules/web-control-center/nodejs/views/includes/header.jade
+++ b/modules/web-control-center/nodejs/views/includes/header.jade
@@ -18,21 +18,21 @@ header.header(id='header')
     .container
         h1.navbar-brand
             a(href='/') Apache Ignite Web Configurator
-        .navbar-collapse.collapse(ng-controller='auth' ng-init='user = #{JSON.stringify(user)}')
-            ul.nav.navbar-nav(ng-controller='activeLink' ng-show='user')
+        .navbar-collapse.collapse(ng-controller='auth')
+            ul.nav.navbar-nav(ng-controller='activeLink' ng-show='loggedInUser')
                 li
                     a(ng-class="{active: isActive('/configuration')}" href='/configuration/clusters')
Configuration
-                li(ng-show='user && user.admin')
+                li(ng-show='loggedInUser && loggedInUser.admin')
                     a(ng-class="{active: isActive('/admin')}" href='/admin/userList') Administration
                 //li
                 //    a(ng-class="{active: isActive('/sql')}" href='/sql') SQL
             ul.nav.navbar-nav.pull-right
-                li(ng-show='user')
-                    a.dropdown-toggle(data-toggle='dropdown' aria-expanded='true' bs-dropdown
data-template='user-dropdown' data-placement='bottom-right') {{user.username}}
+                li(ng-show='loggedInUser')
+                    a.dropdown-toggle(data-toggle='dropdown' aria-expanded='true' bs-dropdown
data-template='user-dropdown' data-placement='bottom-right') {{loggedInUser.username}}
                         span.caret
                     script#user-dropdown(type='text/ng-template')
                         ul.dropdown-menu
                             li
                                 a(href='/logout') Log Out
-                li.nav-login(ng-show='!user')
+                li.nav-login(ng-show='!loggedInUser')
                     a(ng-click='login()' href='#') Log In
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2dc46778/modules/web-control-center/nodejs/views/layout.jade
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/views/layout.jade b/modules/web-control-center/nodejs/views/layout.jade
index d7a48be..ba6d67e 100644
--- a/modules/web-control-center/nodejs/views/layout.jade
+++ b/modules/web-control-center/nodejs/views/layout.jade
@@ -15,7 +15,7 @@
     limitations under the License.
 
 doctype html
-html(ng-app='ignite-web-configurator')
+html(ng-app='ignite-web-configurator', ng-init='loggedInUser = #{JSON.stringify(user)}')
     head
         title= title
 


Mime
View raw message