Skip to content

Commit 4c3d2a4

Browse files
committed
gh-57 Add logout button & show logged-in username
* Add favicon to root at `src/main/resources/public/favicon.ico` * Add logout-success page
1 parent e10e1d1 commit 4c3d2a4

File tree

7 files changed

+81
-6
lines changed

7 files changed

+81
-6
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ui/app/lib/
66
ui/app/styles/main.css
77
ui/app/styles/main.css.map
88
ui/.tmp
9-
src/
9+
src/main/resources/public/dashboard
1010
target/
1111
.classpath
1212
.project

src/main/resources/public/favicon.ico

127 KB
Binary file not shown.

ui/Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ module.exports = function (grunt) {
105105
context: [
106106
'/authenticate', '/batch', '/tasks', '/jobs', '/logout', '/meta', '/apps', '/streams',
107107
'/runtime', '/validation', '/management', '/dashboard', '/security', '/completions',
108-
'/metrics', '/features'],
108+
'/metrics', '/features', '/login'],
109109
host: 'localhost',
110110
port: 9393,
111111
changeOrigin: true

ui/app/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<li ng-if="user.authenticationEnabled"
6565
class="dropdown"><a data-target="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span><b class="caret"></b></a>
6666
<ul class="dropdown-menu">
67-
<li ng-if="user.isAuthenticated"><a ui-sref="logout">Logout</a></li>
67+
<li ng-if="user.isAuthenticated"><a href="/logout">Logout</a></li>
6868
<li ng-if="!user.isAuthenticated"><a ui-sref="login">Login</a></li>
6969
</ul>
7070
</li>

ui/app/logout-success.html

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!doctype html>
2+
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
3+
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
4+
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
5+
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
6+
<head>
7+
<meta charset="utf-8">
8+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
9+
<title>Spring Cloud Data Flow - Logout</title>
10+
<meta name="description" content="">
11+
<meta name="viewport" content="width=device-width">
12+
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
13+
<!-- build:css({.tmp,app}) styles/main.css -->
14+
<link rel="stylesheet" href="styles/main.css">
15+
<!-- endbuild -->
16+
</head>
17+
<body>
18+
19+
<!--[if lt IE 7]>
20+
<p>You are using an <strong>outdated</strong> browser. Please upgrade your browser to improve your experience.</p>
21+
<![endif]-->
22+
<nav class="navbar navbar-default" role="navigation">
23+
<div class="container">
24+
<div class="navbar-header">
25+
<a class="navbar-brand" href="/dashboard"><span></span></a>
26+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
27+
<span class="sr-only">Toggle navigation</span>
28+
<span class="icon-bar"></span>
29+
<span class="icon-bar"></span>
30+
<span class="icon-bar"></span>
31+
</button>
32+
</div>
33+
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
34+
<ul class="nav navbar-nav navbar-right">
35+
<li>
36+
<a href="/dashboard">Login</a>
37+
</li>
38+
</ul>
39+
</div>
40+
</div>
41+
</nav>
42+
<div class="container-fluid homepage-billboard">
43+
<div class="row">
44+
<div class="homepage-title--container">
45+
<div class="homepage-title">Spring Cloud Data Flow Dashboard</div>
46+
<div class="homepage-subtitle--container desktop-only">
47+
</div>
48+
</div>
49+
<div class="platform--wrapper">
50+
<div class="platform--title">Logged Out</div>
51+
<div class="platform--text">
52+
<div class="container-fluid">
53+
<div class="row">
54+
<div class="col-md-8 col-md-offset-2">
55+
<p class="inverted">
56+
You have successfully logged out from the Spring Cloud Data Flow Dashboard.
57+
</p>
58+
<p class="inverted">
59+
Please keep in mind that you are most likely still logged in with your oauth
60+
provider. Therefore, going to the main Dashboard URL will log you back in,
61+
unless you also log out from your oauth provider.
62+
</p>
63+
</div>
64+
</div>
65+
</div>
66+
</div>
67+
</div>
68+
</div>
69+
</div>
70+
</body>
71+
</html>

ui/app/scripts/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ define([
118118
'angular'
119119
], function (require, angular) {
120120
'use strict';
121-
121+
122122
function startApp() {
123123
require(['app', './routes'], function () {
124124
require(['domReady!'], function (document) {
@@ -138,14 +138,14 @@ define([
138138
var promiseFeature = $http.get('/features', {timeout: timeout});
139139

140140
promiseHttp.then(function(response) {
141+
console.log('Security info retrieved ...', response.data);
141142
app.constant('securityInfo', response.data);
142143

143144
promiseFeature.then(function(featuresResponse) {
144145
app.constant('featuresInfo', featuresResponse.data);
145146
startApp();
146147
}, function() {
147-
console.error('Cannot load enabled features info');
148-
startApp();
148+
console.error('Cannot load enabled features info. Application cannot be loaded.');
149149
});
150150
}, function(errorResponse) {
151151
var errorMessage = 'Error retrieving security info from ' + securityInfoUrl + ' (timeout: ' + timeout + 'ms)';

ui/app/styles/main.less

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
@import "header.less";
5959
@import "login-page.less";
6060

61+
p.inverted {
62+
color: @spring-light-grey;
63+
}
64+
6165
.table > thead > tr > th {
6266
background-color: lighten(@spring-brown, 3%);
6367
color: @spring-light-grey;

0 commit comments

Comments
 (0)