Repository: incubator-ignite Updated Branches: refs/heads/ignite-843 ab94bd99e -> cbc752705
# IGNITE-843 Implement "viewedUser" functionality. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cbc75270 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cbc75270 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cbc75270 Branch: refs/heads/ignite-843 Commit: cbc752705b7a5d7f62f0479ef696eee30d9f93d9 Parents: ab94bd9 Author: sevdokimov <sevdoki...@gridgain.com> Authored: Wed Jul 8 18:46:08 2015 +0300 Committer: sevdokimov <sevdoki...@gridgain.com> Committed: Wed Jul 8 18:47:52 2015 +0300 ---------------------------------------------------------------------- modules/web-control-center/nodejs/app.js | 18 +++++++++++++ .../nodejs/public/stylesheets/style.css | 2 +- .../nodejs/public/stylesheets/style.less | 11 ++++++++ .../web-control-center/nodejs/routes/admin.js | 27 ++++++++++++++------ .../web-control-center/nodejs/routes/caches.js | 2 +- .../nodejs/routes/clusters.js | 2 +- .../nodejs/routes/persistences.js | 2 +- .../web-control-center/nodejs/routes/summary.js | 2 +- .../nodejs/views/admin/userList_content.html | 2 +- .../nodejs/views/includes/header.jade | 7 ++++- .../web-control-center/nodejs/views/layout.jade | 2 +- 11 files changed, 61 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/modules/web-control-center/nodejs/app.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/app.js b/modules/web-control-center/nodejs/app.js index b733d32..94df0cf 100644 --- a/modules/web-control-center/nodejs/app.js +++ b/modules/web-control-center/nodejs/app.js @@ -101,6 +101,24 @@ for (var p in uiUtils) { app.all('*', function(req, res, next) { res.locals.user = req.user; + res.locals.viewedUser = req.session.viewedUser; + + req.currentUserId = function() { + if (!req.user) + return null; + + if (req.session.viewedUser) { + if (req.user.admin) + return req.session.viewedUser._id; + + req.session.viewedUser = null; + } + + return req.user._id; + }; + + res.locals.currentUserId = req.currentUserId; + next() }); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/modules/web-control-center/nodejs/public/stylesheets/style.css ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/public/stylesheets/style.css b/modules/web-control-center/nodejs/public/stylesheets/style.css index 837103b..29199ba 100644 --- a/modules/web-control-center/nodejs/public/stylesheets/style.css +++ b/modules/web-control-center/nodejs/public/stylesheets/style.css @@ -1 +1 @@ -.main-header .logo{height:auto}.main-sidebar{padding-top:60px}.navbar-default .navbar-brand,.navbar-default .navbar-brand:hover{position:absolute;width:100%;left:0;text-align:center}.modal-backdrop.am-fade{opacity:.5;transition:opacity .15s linear}.modal-backdrop.am-fade.ng-enter{opacity:0}.modal-backdrop.am-fade.ng-enter.ng-enter-active{opacity:.5}.modal-backdrop.am-fade.ng-leave{opacity:.5}.modal-backdrop.am-fade.ng-leave.ng-leave-active{opacity:0}.modal.center .modal-dialog{position:fixed;top:40%;left:50%;min-width:320px;max-width:630px;width:50%;transform:translateX(-50%) translateY(-50%)}.border-left{box-shadow:1px 0 0 0 #eee inset}.border-right{box-shadow:1px 0 0 0 #eee}.theme-line{background-color:#f9f9f9}.theme-line header{background-color:#fff}.theme-line header a.btn{border:0 none;padding:10px 25px;background-color:rgba(0,0,0,0.15)}.theme-line header a.btn:hover{background-color:rgba(0,0,0,0.25)}.theme-line header a.btn.btn-link{background:transparent;color:rgba(255,255,25 5,0.8)}.theme-line header a.btn.btn-link:hover{color:#fff;text-decoration:none}.theme-line .navbar-nav a{background-color:transparent}.theme-line .navbar-nav a:hover,.theme-line .navbar-nav a:active,.theme-line .navbar-nav a:focus{background-color:transparent}.theme-line .main-links{padding-top:50px}.theme-line .main-links h3{margin-top:0;font-size:17px}.theme-line .main-links .links a{color:#888}.theme-line .main-links .links a:hover{text-decoration:none}.theme-line #category-columns,.theme-solid #category-columns{margin:50px 30px 0}.theme-line #category-columns h4{text-transform:uppercase;font-weight:300;color:#999;font-size:14px}.theme-line #category-columns ul{list-style:none;padding:0;margin-bottom:15px}.theme-line #category-columns ul li a{padding:4px 0;display:block;font-size:16px}.theme-line #category-columns ul .view-all{font-size:0.85em}.theme-line .docs-header{color:#999;overflow:hidden}.theme-line .docs-header h1{color:#444;margin-top:0;font-size:25px}.theme-line .btn-pr imary{border:0 none;background-color:#ec1c24}.theme-line .btn-primary:hover{background-color:#950d12}.theme-line .main-content .nav-horizontal a{box-shadow:0 0;border:0 none;background-color:#fff;border-radius:0;color:#aaa;padding:6px;margin:0 14px}.theme-line .main-content .nav-horizontal a:hover{color:#999;border-bottom:4px solid #ddd}.theme-line .main-content .nav-horizontal a.active{border-bottom:4px solid #888}.theme-line .sidebar-nav{color:#474a54;padding-bottom:30px}.theme-line .sidebar-nav ul{padding:0;list-style:none;font-size:13px;margin:3px 0 0}.theme-line .sidebar-nav ul li a{padding:3px 0;display:block;color:#666;position:relative;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.theme-line .sidebar-nav ul li a:before{top:0;content:" ";display:block;width:6px;height:100%;position:absolute;left:-30px}.theme-line .sidebar-nav ul li a:hover{text-decoration:none}.theme-line .select li a,.theme-line .typeahead li a{color:#666;background-col or:transparent}.theme-line .select li a:hover,.theme-line .typeahead li a:hover{color:#ec1c24;background-color:transparent}.theme-line .select .active,.theme-line .typeahead .active{background-color:#eee}.theme-line .sidebar-nav ul li .subcategory{padding-left:15px}.theme-line .sidebar-nav h4{margin-top:2em;font-weight:normal;text-transform:uppercase;font-size:11px;margin-bottom:10px;color:#bbb}.theme-line .sidebar-nav h4:first-child{margin-top:0}.theme-line .sidebar-nav .ask{width:100%;text-align:center;padding:10px}.theme-line .border-left .sidebar-nav{padding-left:15px}.theme-line .suggest{padding:4px;display:inline-block;font-size:12px}.header{padding:15px}.header .has-github{padding-right:136px}.header h1.navbar-brand{height:40px;width:200px;padding:0;margin:5px 15px 0 0}.header h1.navbar-brand a{text-indent:-99999px;background:no-repeat center center;display:block;width:100%;height:100%;background-size:contain}.header .nav.navbar-nav.pull-right{position:relative;right:-30px}.h eader .nav.navbar-nav .not-link{padding:15px;display:inline-block}.header .nav.navbar-nav .stable,.header .nav.navbar-nav .beta,.header .nav.navbar-nav .private{font-size:9px;padding:3px 5px;display:inline-block;line-height:8px;border-radius:3px;margin-left:6px;color:#fff;top:-2px;position:relative;opacity:0.6;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";filter:alpha(opacity=60)}.header .nav.navbar-nav a:hover>.stable,.header .nav.navbar-nav a:hover>.beta,.header .nav.navbar-nav a:hover>.private{opacity:1;-ms-filter:none;filter:none}.header .nav.navbar-nav .beta{background-color:#59c3d1}.header .nav.navbar-nav .stable{background-color:#41b841}.header .nav.navbar-nav .private{background-color:#333}.theme-line header{border-bottom:8px solid}.theme-line header h2{color:#aaa}.theme-line header p{color:#666}.theme-line header{border-bottom-color:#ec1c24}.theme-line .navbar-nav{color:#888}.theme-line .navbar-nav a{color:#bbb}.theme-line header a.btn{background-color:#e c1c24}.theme-line header a.btn:hover{background-color:#950d12}.theme-line header .navbar-nav .tt-cursor{background-color:#ec1c24}.theme-line header .navbar-nav a:hover,.theme-line header .navbar-nav .open>a{color:#ec1c24}.theme-line .navbar-nav .active a{color:#ec1c24}.theme-line .navbar-nav .active a:hover{color:#950d12}.theme-line .main-links .links a:hover{color:#ec1c24}.theme-line .main-content a{color:#666}.theme-line .main-content a:hover{color:#950d12}.theme-line .sidebar-nav ul li a.active:before{background-color:#ec1c24}.theme-line .sidebar-nav ul li a.active{color:#ec1c24}.theme-line .sidebar-nav ul li a:hover,.theme-line .sidebar-nav ul li a.active:hover{color:#950d12}.theme-line .main-content .nav-horizontal a.active{border-color:#ec1c24;color:#ec1c24}.theme-line .main-content .nav-horizontal a:hover{color:#950d12}.theme-line .main-content .nav-horizontal a.active:hover{border-color:#950d12}.theme-line header .navbar-nav a.active,.theme-line #versions-list li a:hover str ong,.theme-line #versions-list li a.active .current,.theme-line #versions-list li a:active .current{color:#ec1c24}.theme-line.body-threes .section-right .threes-nav .btn-default:hover,.theme-line.page-docs.body-threes .section-right .threes-nav .pull-right a:hover{color:#ec1c24;border-color:#ec1c24}.theme-line .section-right{padding-left:30px}.body-overlap .main-content{margin-top:30px}.body-box .main-content,.body-overlap .main-content{padding:30px;box-shadow:0 0 0 1px rgba(0,0,0,0.1);background-color:#fff}body{font-weight:400;font-family:Roboto Slab, serif}h1,h2,h3,h4,h5,h6{font-weight:700;font-family:Roboto Slab, serif}.submit-vote.submit-vote-parent.voted a.submit-vote-button,.submit-vote.submit-vote-parent a.submit-vote-button:hover{background-color:#ec1c24}div.submit-vote.submit-vote-parent.voted a.submit-vote-button:hover{background-color:#950d12}a,.link .title{color:#ec1c24}a:hover,.link:hover .title{color:#950d12}.header h1.navbar-brand a{background-image:url("https://www.f ilepicker.io/api/file/QagunjDGRFul2JgNCAli")}.header h1.navbar-brand{width:96px}.block-edit-parameters{text-align:right;padding-bottom:5px}.ng-table-pager{display:none}.container-footer{margin-top:20px}.vcenter{display:inline-block;vertical-align:middle;float:none}.vcenter2{position:relative;top:50%;transform:translateY(-50%)}.modal{display:block;overflow:hidden}.modal .close{position:absolute;top:0.65em;right:0.65em;float:none}.modal-header .close{margin-right:-2px}.modal .modal-dialog{width:610px}.modal .modal-content{border-radius:0;background-color:#f7f7f7}.modal .modal-content .modal-header{background-color:#fff;text-align:center;color:#555;padding:24px;font-family:"myriad-pro",sans-serif}.modal .modal-content .modal-header h4{font-family:"myriad-pro",sans-serif;font-size:22px}.modal .modal-content .modal-header h4 .fa{display:block;font-size:41px;color:#ddd;margin-bottom:5px}.modal .modal-content .modal-header p{color:#aaa;font-size:1em;margin:3px 0 0}.modal .modal-content .mo dal-spacer{padding:10px 10px 0 10px}.modal .modal-content .modal-footer{margin-top:0}.modal-body{padding-top:15px}h1.ignite-logo{background-image:url("https://www.filepicker.io/api/file/QagunjDGRFul2JgNCAli")}.st-sort-ascent:after{font-family:FontAwesome, serif;content:'\f077'}.st-sort-descent:after{font-family:FontAwesome, serif;content:'\f078'}.block-display-image img{max-width:100%;max-height:450px;margin:auto;display:block}.greedy{min-height:200px;height:calc(100vh - 230px)}@media (min-width:768px){.navbar-nav>li>a{padding-top:20px;padding-bottom:10px}}.details-row{padding:0 0.65em}.details-table-row{padding:0}.details-row,.settings-row{display:block;margin:0.65em 0;line-height:28px}.details-row [class*="col-"],.settings-row [class*="col-"]{display:inline-block;vertical-align:middle;float:none;padding-left:0 !important;padding-right:0 !important}.details-row input[type="checkbox"],.settings-row input[type="checkbox"]{line-height:20px;margin-right:4px}.details-row .checkbox label ,.settings-row .checkbox label{line-height:20px;vertical-align:middle}button{margin-right:4px}h1,h2,h3{user-select:none;font-weight:normal;line-height:1}h3{color:black;font-size:1.2em;margin-top:0;margin-bottom:1.5em}table tr:hover{cursor:pointer}.input-group{display:inline-block}.input-group .form-control{width:auto;margin-left:0;margin-right:0}.form-control{display:inline-block;text-align:left;padding:3px 3px;height:28px}.form-control button{text-align:left}.table-form-control{width:auto}button .caret{float:right;margin-left:0;margin-top:7px}.theme-line .panel-heading{padding:10px 10px;margin:0}.theme-line .panel-heading h3{margin-bottom:0}.theme-line .panel-heading h3>a{color:black;cursor:pointer}.theme-line .panel-title a{color:#ec1c24}.theme-line .panel-title h3{margin-bottom:1.3em}.theme-line .panel-body{padding:0.65em 1.3em}.theme-line .main-content a.customize{margin-left:5px;color:#ec1c24;cursor:pointer}.theme-line .panel-collapse{margin:0}.theme-line .links table,.theme-li ne table.links-edit,.theme-line table.links-edit-details,.theme-line table.links-edit-small-padding{display:table;table-layout:fixed;margin-bottom:10px}.theme-line .links table td,.theme-line table.links-edit td,.theme-line table.links-edit-details td,.theme-line table.links-edit-small-padding td{padding-left:18px}.theme-line .links table .active a,.theme-line table.links-edit .active a,.theme-line table.links-edit-details .active a,.theme-line table.links-edit-small-padding .active a{color:#ec1c24;font-weight:bold}.theme-line .links table a:hover,.theme-line table.links-edit a:hover,.theme-line table.links-edit-details a:hover,.theme-line table.links-edit-small-padding a:hover{color:#950d12}.theme-line .links table a,.theme-line table.links-edit a,.theme-line table.links-edit-details a,.theme-line table.links-edit-small-padding a{color:#666}.theme-line table.links-edit label{line-height:28px;color:#666}.theme-line table.links-edit-details label{line-height:28px;color:#666}.theme-li ne table.links-edit-details td{padding:0}.theme-line table.links-edit-details td .input-tip{padding:0}.btn{padding:3px 6px}.panel-title a{font-size:14px}.panel-details{margin-top:0.65em;padding:0;border-radius:4px;border:thin dotted lightgrey}.tooltip.right .tooltip-arrow{border-right-color:#ec1c24}.tooltip>.tooltip-inner{max-width:400px;text-align:left;background-color:#ec1c24}label{font-weight:normal;line-height:14px;margin-bottom:0}.form-horizontal .checkbox{padding-top:0}.input-tip{display:block;overflow:hidden}.labelField{float:left;margin-right:4px}.stackTipField{float:right;line-height:28px;margin-left:5px}.form-horizontal .form-group{margin:0}.form-horizontal .has-feedback .form-control-feedback{right:0}.tipField{float:right;line-height:28px;margin-left:5px}.tipLabel{font-size:14px;margin-left:5px}.fieldButton{float:right;margin-left:5px;margin-right:0}.table-nowrap{table-layout:fixed}.td-overflow{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fa- edit{cursor:pointer}.fa-remove{color:#ec1c24;cursor:pointer}label.required:after{color:#ec1c24;content:' *';display:inline}.blank{visibility:hidden}.alert{outline:0}.alert.bottom,.alert.bottom-left,.alert.bottom-right,.alert.top,.alert.top-left,.alert.top-right{position:fixed;z-index:1050;margin:20px}.alert.top,.alert.top-left,.alert.top-right{top:50px}.alert.top{right:0;left:0}.alert.top-right{right:0}.alert.top-right .close{padding-left:10px}.alert.top-left{left:0}.alert.top-left .close{padding-right:10px}.alert.bottom,.alert.bottom-left,.alert.bottom-right{bottom:0}.alert.bottom{right:0;left:0}.alert.bottom-right{right:0}.alert.bottom-right .close{padding-left:10px}.alert.bottom-left{left:0}.alert.bottom-left .close{padding-right:10px}#cfgResult textarea{font-family:monospace;font-size:12px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type="number"]{-moz-appearance:textfield}input.ng-dirty.n g-invalid{border-color:#ec1c24}input.ng-dirty.ng-invalid :focus{border-color:#ec1c24}.form-control-feedback{display:inline-block;color:#ec1c24;right:18px;line-height:28px;pointer-events:initial}.syntaxhighlighter{padding:10px 5px;border-radius:6px}.theme-line table.links-edit-small-padding{margin-top:10px}.theme-line table.links-edit-small-padding label{line-height:28px;color:#666}.theme-line table.links-edit-small-padding a{line-height:28px}.theme-line table.links-edit-small-padding input[type="checkbox"]{line-height:20px;margin-right:5px}.theme-line table.links-edit-small-padding .checkbox label{line-height:20px;vertical-align:middle}.theme-line table.links-edit-small-padding th{text-align:center}.theme-line table.links-edit-small-padding td{padding-left:10px}.configBox .nav>li>a{padding:5px 5px} \ No newline at end of file +.main-header .logo{height:auto}.main-sidebar{padding-top:60px}.navbar-default .navbar-brand,.navbar-default .navbar-brand:hover{position:absolute;width:100%;left:0;text-align:center}.modal-backdrop.am-fade{opacity:.5;transition:opacity .15s linear}.modal-backdrop.am-fade.ng-enter{opacity:0}.modal-backdrop.am-fade.ng-enter.ng-enter-active{opacity:.5}.modal-backdrop.am-fade.ng-leave{opacity:.5}.modal-backdrop.am-fade.ng-leave.ng-leave-active{opacity:0}.modal.center .modal-dialog{position:fixed;top:40%;left:50%;min-width:320px;max-width:630px;width:50%;transform:translateX(-50%) translateY(-50%)}.border-left{box-shadow:1px 0 0 0 #eee inset}.border-right{box-shadow:1px 0 0 0 #eee}.theme-line{background-color:#f9f9f9}.theme-line header{background-color:#fff}.theme-line header a.btn{border:0 none;padding:10px 25px;background-color:rgba(0,0,0,0.15)}.theme-line header a.btn:hover{background-color:rgba(0,0,0,0.25)}.theme-line header a.btn.btn-link{background:transparent;color:rgba(255,255,25 5,0.8)}.theme-line header a.btn.btn-link:hover{color:#fff;text-decoration:none}.theme-line .navbar-nav a{background-color:transparent}.theme-line .navbar-nav a:hover,.theme-line .navbar-nav a:active,.theme-line .navbar-nav a:focus{background-color:transparent}.theme-line .main-links{padding-top:50px}.theme-line .main-links h3{margin-top:0;font-size:17px}.theme-line .main-links .links a{color:#888}.theme-line .main-links .links a:hover{text-decoration:none}.theme-line #category-columns,.theme-solid #category-columns{margin:50px 30px 0}.theme-line #category-columns h4{text-transform:uppercase;font-weight:300;color:#999;font-size:14px}.theme-line #category-columns ul{list-style:none;padding:0;margin-bottom:15px}.theme-line #category-columns ul li a{padding:4px 0;display:block;font-size:16px}.theme-line #category-columns ul .view-all{font-size:0.85em}.theme-line .docs-header{color:#999;overflow:hidden}.theme-line .docs-header h1{color:#444;margin-top:0;font-size:25px}.theme-line .btn-pr imary{border:0 none;background-color:#ec1c24}.theme-line .btn-primary:hover{background-color:#950d12}.theme-line .main-content .nav-horizontal a{box-shadow:0 0;border:0 none;background-color:#fff;border-radius:0;color:#aaa;padding:6px;margin:0 14px}.theme-line .main-content .nav-horizontal a:hover{color:#999;border-bottom:4px solid #ddd}.theme-line .main-content .nav-horizontal a.active{border-bottom:4px solid #888}.theme-line .sidebar-nav{color:#474a54;padding-bottom:30px}.theme-line .sidebar-nav ul{padding:0;list-style:none;font-size:13px;margin:3px 0 0}.theme-line .sidebar-nav ul li a{padding:3px 0;display:block;color:#666;position:relative;white-space:nowrap;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis}.theme-line .sidebar-nav ul li a:before{top:0;content:" ";display:block;width:6px;height:100%;position:absolute;left:-30px}.theme-line .sidebar-nav ul li a:hover{text-decoration:none}.theme-line .select li a,.theme-line .typeahead li a{color:#666;background-col or:transparent}.theme-line .select li a:hover,.theme-line .typeahead li a:hover{color:#ec1c24;background-color:transparent}.theme-line .select .active,.theme-line .typeahead .active{background-color:#eee}.theme-line .sidebar-nav ul li .subcategory{padding-left:15px}.theme-line .sidebar-nav h4{margin-top:2em;font-weight:normal;text-transform:uppercase;font-size:11px;margin-bottom:10px;color:#bbb}.theme-line .sidebar-nav h4:first-child{margin-top:0}.theme-line .sidebar-nav .ask{width:100%;text-align:center;padding:10px}.theme-line .border-left .sidebar-nav{padding-left:15px}.theme-line .suggest{padding:4px;display:inline-block;font-size:12px}.header{padding:15px}.header .has-github{padding-right:136px}.header h1.navbar-brand{height:40px;width:200px;padding:0;margin:5px 15px 0 0}.header h1.navbar-brand a{text-indent:-99999px;background:no-repeat center center;display:block;width:100%;height:100%;background-size:contain}.header .nav.navbar-nav.pull-right{position:relative;right:-30px}.h eader .nav.navbar-nav .not-link{padding:15px;display:inline-block}.header .nav.navbar-nav .stable,.header .nav.navbar-nav .beta,.header .nav.navbar-nav .private{font-size:9px;padding:3px 5px;display:inline-block;line-height:8px;border-radius:3px;margin-left:6px;color:#fff;top:-2px;position:relative;opacity:0.6;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";filter:alpha(opacity=60)}.header .nav.navbar-nav a:hover>.stable,.header .nav.navbar-nav a:hover>.beta,.header .nav.navbar-nav a:hover>.private{opacity:1;-ms-filter:none;filter:none}.header .nav.navbar-nav .beta{background-color:#59c3d1}.header .nav.navbar-nav .stable{background-color:#41b841}.header .nav.navbar-nav .private{background-color:#333}.theme-line header{border-bottom:8px solid}.theme-line header h2{color:#aaa}.theme-line header p{color:#666}.theme-line header{border-bottom-color:#ec1c24}.theme-line .navbar-nav{color:#888}.theme-line .navbar-nav a{color:#bbb}.theme-line header a.btn{background-color:#e c1c24}.theme-line header a.btn:hover{background-color:#950d12}.theme-line header .navbar-nav .tt-cursor{background-color:#ec1c24}.theme-line header .navbar-nav a:hover,.theme-line header .navbar-nav .open>a{color:#ec1c24}.theme-line .navbar-nav .active a{color:#ec1c24}.theme-line .navbar-nav .active a:hover{color:#950d12}.theme-line .main-links .links a:hover{color:#ec1c24}.theme-line .main-content a{color:#666}.theme-line .main-content a:hover{color:#950d12}.theme-line .sidebar-nav ul li a.active:before{background-color:#ec1c24}.theme-line .sidebar-nav ul li a.active{color:#ec1c24}.theme-line .sidebar-nav ul li a:hover,.theme-line .sidebar-nav ul li a.active:hover{color:#950d12}.theme-line .main-content .nav-horizontal a.active{border-color:#ec1c24;color:#ec1c24}.theme-line .main-content .nav-horizontal a:hover{color:#950d12}.theme-line .main-content .nav-horizontal a.active:hover{border-color:#950d12}.theme-line header .navbar-nav a.active,.theme-line #versions-list li a:hover str ong,.theme-line #versions-list li a.active .current,.theme-line #versions-list li a:active .current{color:#ec1c24}.theme-line.body-threes .section-right .threes-nav .btn-default:hover,.theme-line.page-docs.body-threes .section-right .threes-nav .pull-right a:hover{color:#ec1c24;border-color:#ec1c24}.theme-line .section-right{padding-left:30px}.body-overlap .main-content{margin-top:30px}.body-box .main-content,.body-overlap .main-content{padding:30px;box-shadow:0 0 0 1px rgba(0,0,0,0.1);background-color:#fff}body{font-weight:400;font-family:Roboto Slab, serif}h1,h2,h3,h4,h5,h6{font-weight:700;font-family:Roboto Slab, serif}.submit-vote.submit-vote-parent.voted a.submit-vote-button,.submit-vote.submit-vote-parent a.submit-vote-button:hover{background-color:#ec1c24}div.submit-vote.submit-vote-parent.voted a.submit-vote-button:hover{background-color:#950d12}a,.link .title{color:#ec1c24}a:hover,.link:hover .title{color:#950d12}.header h1.navbar-brand a{background-image:url("https://www.f ilepicker.io/api/file/QagunjDGRFul2JgNCAli")}.header h1.navbar-brand{width:96px}.block-edit-parameters{text-align:right;padding-bottom:5px}.ng-table-pager{display:none}.container-footer{margin-top:20px}.vcenter{display:inline-block;vertical-align:middle;float:none}.vcenter2{position:relative;top:50%;transform:translateY(-50%)}.modal{display:block;overflow:hidden}.modal .close{position:absolute;top:0.65em;right:0.65em;float:none}.modal-header .close{margin-right:-2px}.modal .modal-dialog{width:610px}.modal .modal-content{border-radius:0;background-color:#f7f7f7}.modal .modal-content .modal-header{background-color:#fff;text-align:center;color:#555;padding:24px;font-family:"myriad-pro",sans-serif}.modal .modal-content .modal-header h4{font-family:"myriad-pro",sans-serif;font-size:22px}.modal .modal-content .modal-header h4 .fa{display:block;font-size:41px;color:#ddd;margin-bottom:5px}.modal .modal-content .modal-header p{color:#aaa;font-size:1em;margin:3px 0 0}.modal .modal-content .mo dal-spacer{padding:10px 10px 0 10px}.modal .modal-content .modal-footer{margin-top:0}.modal-body{padding-top:15px}h1.ignite-logo{background-image:url("https://www.filepicker.io/api/file/QagunjDGRFul2JgNCAli")}.st-sort-ascent:after{font-family:FontAwesome, serif;content:'\f077'}.st-sort-descent:after{font-family:FontAwesome, serif;content:'\f078'}.block-display-image img{max-width:100%;max-height:450px;margin:auto;display:block}.greedy{min-height:200px;height:calc(100vh - 230px)}@media (min-width:768px){.navbar-nav>li>a{padding-top:20px;padding-bottom:10px}}.details-row{padding:0 0.65em}.details-table-row{padding:0}.details-row,.settings-row{display:block;margin:0.65em 0;line-height:28px}.details-row [class*="col-"],.settings-row [class*="col-"]{display:inline-block;vertical-align:middle;float:none;padding-left:0 !important;padding-right:0 !important}.details-row input[type="checkbox"],.settings-row input[type="checkbox"]{line-height:20px;margin-right:4px}.details-row .checkbox label ,.settings-row .checkbox label{line-height:20px;vertical-align:middle}button{margin-right:4px}h1,h2,h3{user-select:none;font-weight:normal;line-height:1}h3{color:black;font-size:1.2em;margin-top:0;margin-bottom:1.5em}table tr:hover{cursor:pointer}.input-group{display:inline-block}.input-group .form-control{width:auto;margin-left:0;margin-right:0}.form-control{display:inline-block;text-align:left;padding:3px 3px;height:28px}.form-control button{text-align:left}.table-form-control{width:auto}button .caret{float:right;margin-left:0;margin-top:7px}.theme-line .panel-heading{padding:10px 10px;margin:0}.theme-line .panel-heading h3{margin-bottom:0}.theme-line .panel-heading h3>a{color:black;cursor:pointer}.theme-line .panel-title a{color:#ec1c24}.theme-line .panel-title h3{margin-bottom:1.3em}.theme-line .panel-body{padding:0.65em 1.3em}.theme-line .main-content a.customize{margin-left:5px;color:#ec1c24;cursor:pointer}.theme-line .panel-collapse{margin:0}.theme-line .links table,.theme-li ne table.links-edit,.theme-line table.links-edit-details,.theme-line table.links-edit-small-padding{display:table;table-layout:fixed;margin-bottom:10px}.theme-line .links table td,.theme-line table.links-edit td,.theme-line table.links-edit-details td,.theme-line table.links-edit-small-padding td{padding-left:18px}.theme-line .links table .active a,.theme-line table.links-edit .active a,.theme-line table.links-edit-details .active a,.theme-line table.links-edit-small-padding .active a{color:#ec1c24;font-weight:bold}.theme-line .links table a:hover,.theme-line table.links-edit a:hover,.theme-line table.links-edit-details a:hover,.theme-line table.links-edit-small-padding a:hover{color:#950d12}.theme-line .links table a,.theme-line table.links-edit a,.theme-line table.links-edit-details a,.theme-line table.links-edit-small-padding a{color:#666}.theme-line table.links-edit label{line-height:28px;color:#666}.theme-line table.links-edit-details label{line-height:28px;color:#666}.theme-li ne table.links-edit-details td{padding:0}.theme-line table.links-edit-details td .input-tip{padding:0}.btn{padding:3px 6px}.panel-title a{font-size:14px}.panel-details{margin-top:0.65em;padding:0;border-radius:4px;border:thin dotted lightgrey}.tooltip.right .tooltip-arrow{border-right-color:#ec1c24}.tooltip>.tooltip-inner{max-width:400px;text-align:left;background-color:#ec1c24}label{font-weight:normal;line-height:14px;margin-bottom:0}.form-horizontal .checkbox{padding-top:0}.input-tip{display:block;overflow:hidden}.labelField{float:left;margin-right:4px}.stackTipField{float:right;line-height:28px;margin-left:5px}.form-horizontal .form-group{margin:0}.form-horizontal .has-feedback .form-control-feedback{right:0}.tipField{float:right;line-height:28px;margin-left:5px}.tipLabel{font-size:14px;margin-left:5px}.fieldButton{float:right;margin-left:5px;margin-right:0}.table-nowrap{table-layout:fixed}.td-overflow{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fa- edit{cursor:pointer}.fa-remove{color:#ec1c24;cursor:pointer}label.required:after{color:#ec1c24;content:' *';display:inline}.blank{visibility:hidden}.alert{outline:0}.alert.bottom,.alert.bottom-left,.alert.bottom-right,.alert.top,.alert.top-left,.alert.top-right{position:fixed;z-index:1050;margin:20px}.alert.top,.alert.top-left,.alert.top-right{top:50px}.alert.top{right:0;left:0}.alert.top-right{right:0}.alert.top-right .close{padding-left:10px}.alert.top-left{left:0}.alert.top-left .close{padding-right:10px}.alert.bottom,.alert.bottom-left,.alert.bottom-right{bottom:0}.alert.bottom{right:0;left:0}.alert.bottom-right{right:0}.alert.bottom-right .close{padding-left:10px}.alert.bottom-left{left:0}.alert.bottom-left .close{padding-right:10px}#cfgResult textarea{font-family:monospace;font-size:12px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type="number"]{-moz-appearance:textfield}input.ng-dirty.n g-invalid{border-color:#ec1c24}input.ng-dirty.ng-invalid :focus{border-color:#ec1c24}.form-control-feedback{display:inline-block;color:#ec1c24;right:18px;line-height:28px;pointer-events:initial}.syntaxhighlighter{padding:10px 5px;border-radius:6px}.theme-line table.links-edit-small-padding{margin-top:10px}.theme-line table.links-edit-small-padding label{line-height:28px;color:#666}.theme-line table.links-edit-small-padding a{line-height:28px}.theme-line table.links-edit-small-padding input[type="checkbox"]{line-height:20px;margin-right:5px}.theme-line table.links-edit-small-padding .checkbox label{line-height:20px;vertical-align:middle}.theme-line table.links-edit-small-padding th{text-align:center}.theme-line table.links-edit-small-padding td{padding-left:10px}.configBox .nav>li>a{padding:5px 5px}.viewedUser{display:inline;padding:6px;margin:7px;border-radius:4px;background-color:#f8d5d8} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/modules/web-control-center/nodejs/public/stylesheets/style.less ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/public/stylesheets/style.less b/modules/web-control-center/nodejs/public/stylesheets/style.less index 729ebec..b249ea9 100644 --- a/modules/web-control-center/nodejs/public/stylesheets/style.less +++ b/modules/web-control-center/nodejs/public/stylesheets/style.less @@ -1029,3 +1029,14 @@ input.ng-dirty.ng-invalid { padding: 5px 5px; } +.viewedUser { + display: inline; + + padding: 6px; + margin: 7px; + + border-radius: 4px; + + background-color: #f8d5d8; + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/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 db6bd12..87719b2 100644 --- a/modules/web-control-center/nodejs/routes/admin.js +++ b/modules/web-control-center/nodejs/routes/admin.js @@ -65,14 +65,25 @@ router.get('/userList', function(req, res) { }); router.get('/become', function(req, res) { - var userId = req.query.userId; - - if (!userId) - userId = null; - - res.cookie('currentUserId', userId); - - res.redirect('/') + var viewedUserId = req.query.viewedUserId; + + if (!viewedUserId) { + req.session.viewedUser = null; + + res.redirect('/'); + + return + } + + db.Account.findById(viewedUserId, function(err, viewedUser) { + if (err) { + return res.sendStatus(404); + } + + req.session.viewedUser = {_id: viewedUser._id, username: viewedUser.username}; + + res.redirect('/'); + }) }); module.exports = router; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/modules/web-control-center/nodejs/routes/caches.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/routes/caches.js b/modules/web-control-center/nodejs/routes/caches.js index b681fd7..2545104 100644 --- a/modules/web-control-center/nodejs/routes/caches.js +++ b/modules/web-control-center/nodejs/routes/caches.js @@ -30,7 +30,7 @@ router.get('/', function(req, res) { * @param res Response. */ router.post('/list', function(req, res) { - var user_id = req.user._id; + var user_id = req.currentUserId(); // Get owned space and all accessed space. db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/modules/web-control-center/nodejs/routes/clusters.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/routes/clusters.js b/modules/web-control-center/nodejs/routes/clusters.js index b99b473..1e56ac7 100644 --- a/modules/web-control-center/nodejs/routes/clusters.js +++ b/modules/web-control-center/nodejs/routes/clusters.js @@ -30,7 +30,7 @@ router.get('/', function(req, res) { * @param res Response. */ router.post('/list', function(req, res) { - var user_id = req.user._id; + var user_id = req.currentUserId(); // Get owned space and all accessed space. db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/modules/web-control-center/nodejs/routes/persistences.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/routes/persistences.js b/modules/web-control-center/nodejs/routes/persistences.js index 7ab32a0..a3bb1d2 100644 --- a/modules/web-control-center/nodejs/routes/persistences.js +++ b/modules/web-control-center/nodejs/routes/persistences.js @@ -31,7 +31,7 @@ router.get('/', function(req, res) { * @param res Response. */ router.post('/list', function(req, res) { - var user_id = req.user._id; + var user_id = req.currentUserId(); // Get owned space and all accessed space. db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]}, function (err, spaces) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/modules/web-control-center/nodejs/routes/summary.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/routes/summary.js b/modules/web-control-center/nodejs/routes/summary.js index ee87dbb..7c3f9de 100644 --- a/modules/web-control-center/nodejs/routes/summary.js +++ b/modules/web-control-center/nodejs/routes/summary.js @@ -24,7 +24,7 @@ var generatorJava = require('./../generator/java'); /* GET summary page. */ router.get('/', function(req, res) { - res.render('summary', { user: req.user }); + res.render('summary'); }); router.post('/generator', function(req, res) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/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 47b203b..680b72c 100644 --- a/modules/web-control-center/nodejs/views/admin/userList_content.html +++ b/modules/web-control-center/nodejs/views/admin/userList_content.html @@ -41,7 +41,7 @@ </a> </td> <td width="1%"> - <a ng-href="become?userId={{user._id}}" ng-show="user._id != loggedInUser._id" + <a ng-href="become?viewedUserId={{user._id}}" ng-show="user._id != loggedInUser._id" title="View user's configurations"> <span class="glyphicon glyphicon-eye-open"></span> </a> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/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 d2046d3..aee9e46 100644 --- a/modules/web-control-center/nodejs/views/includes/header.jade +++ b/modules/web-control-center/nodejs/views/includes/header.jade @@ -35,4 +35,9 @@ header.header(id='header') li a(href='/logout') Log Out li.nav-login(ng-show='!loggedInUser') - a(ng-click='login()' href='#') Log In \ No newline at end of file + a(ng-click='login()' href='#') Log In + + div(class='viewedUser' ng-show='viewedUser') You're working as + strong {{viewedUser.username}} + a(href='/admin/become') + span(class="glyphicon glyphicon-remove" title='Unlogin') \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cbc75270/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 953daab..86d2bc7 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-control-center', ng-init='loggedInUser = #{JSON.stringify(filterUser(user))}') +html(ng-app='ignite-web-control-center', ng-init='loggedInUser = #{JSON.stringify(filterUser(user))}; viewedUser = #{JSON.stringify(viewedUser)}') head title= title