Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
44846dd4
Commit
44846dd4
authored
Jun 19, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show logged in username and hide logout when not logged in
closes #792
parent
5de849a4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
20 deletions
+37
-20
base.scss
...ot-admin-server-ui/src/main/frontend/assets/css/base.scss
+2
-7
index.html
spring-boot-admin-server-ui/src/main/frontend/index.html
+2
-1
fontawesome.js
...ot-admin-server-ui/src/main/frontend/utils/fontawesome.js
+4
-3
navbar.vue
...-admin-server-ui/src/main/frontend/views/shell/navbar.vue
+23
-9
UiController.java
...de/codecentric/boot/admin/server/ui/web/UiController.java
+6
-0
No files found.
spring-boot-admin-server-ui/src/main/frontend/assets/css/base.scss
View file @
44846dd4
...
...
@@ -53,13 +53,8 @@ body {
border-color
:
transparent
;
}
//navbar color fixes
.navbar-item
.button.is-icon
{
color
:
$navbar-item-color
;
&
:hover
{
color
:
$navbar-item-hover-color
;
}
.
navbar-link
:
:
after
{
border-color
:
currentColor
;
}
.navbar
.badge
{
...
...
spring-boot-admin-server-ui/src/main/frontend/index.html
View file @
44846dd4
...
...
@@ -32,7 +32,8 @@
<script
th:inline=
"javascript"
>
var
SBA
=
{
uiSettings
:
/*[[${uiSettings}]]*/
{}
uiSettings
:
/*[[${uiSettings}]]*/
{},
user
:
/*[[${user}]]*/
null
}
</script>
<script
lang=
"javascript"
src=
"assets/js/vendors.js"
defer
></script>
...
...
spring-boot-admin-server-ui/src/main/frontend/utils/fontawesome.js
View file @
44846dd4
...
...
@@ -20,6 +20,8 @@ import faGitter from '@fortawesome/fontawesome-free-brands/faGitter';
import
faStackOverflow
from
'@fortawesome/fontawesome-free-brands/faStackOverflow'
;
import
farTimesCircle
from
'@fortawesome/fontawesome-free-regular/faTimesCircle'
;
import
faBan
from
'@fortawesome/fontawesome-free-solid/faBan'
;
import
faBell
from
'@fortawesome/fontawesome-free-solid/faBell'
;
import
faBellSlash
from
'@fortawesome/fontawesome-free-solid/faBellSlash'
;
import
faBook
from
'@fortawesome/fontawesome-free-solid/faBook'
;
import
faCheck
from
'@fortawesome/fontawesome-free-solid/faCheck'
;
import
faDownload
from
'@fortawesome/fontawesome-free-solid/faDownload'
;
...
...
@@ -33,13 +35,12 @@ import faStepBackward from '@fortawesome/fontawesome-free-solid/faStepBackward';
import
faStepForward
from
'@fortawesome/fontawesome-free-solid/faStepForward'
;
import
faTimesCircle
from
'@fortawesome/fontawesome-free-solid/faTimesCircle'
;
import
faTrash
from
'@fortawesome/fontawesome-free-solid/faTrash'
;
import
faBell
from
'@fortawesome/fontawesome-free-solid/faBell'
;
import
faBellSlash
from
'@fortawesome/fontawesome-free-solid/faBellSlash'
;
import
faUserCircle
from
'@fortawesome/fontawesome-free-solid/faUserCircle'
;
import
FontAwesomeIcon
from
'@fortawesome/vue-fontawesome'
;
//solid
fontawesome
.
library
.
add
(
faTrash
,
faDownload
,
faStepForward
,
faStepBackward
,
faCheck
,
faQuestionCircle
,
faBan
,
faTimesCircle
,
faMinusCircle
,
faExclamation
,
faBook
,
faSignOutAlt
,
faExclamationTriangle
,
faPencilAlt
,
faBell
,
faBellSlash
);
faBook
,
faSignOutAlt
,
faExclamationTriangle
,
faPencilAlt
,
faBell
,
faBellSlash
,
faUserCircle
);
//regular
fontawesome
.
library
.
add
(
farTimesCircle
);
//brands
...
...
spring-boot-admin-server-ui/src/main/frontend/views/shell/navbar.vue
View file @
44846dd4
...
...
@@ -33,12 +33,19 @@
<component
:is=
"view.handle"
:applications=
"applications"
:error=
"error"
/>
</router-link>
<div
class=
"navbar-item"
>
<form
action=
"logout"
method=
"post"
>
<button
class=
"button is-icon"
type=
"submit"
value=
"logout"
>
Logout
<font-awesome-icon
icon=
"sign-out-alt"
size=
"lg"
/>
</button>
</form>
<div
class=
"navbar-item has-dropdown is-hoverable"
v-if=
"userName"
>
<a
class=
"navbar-link"
>
<font-awesome-icon
icon=
"user-circle"
size=
"lg"
/>
<span
v-text=
"userName"
/>
</a>
<div
class=
"navbar-dropdown"
>
<a
class=
"navbar-item"
>
<form
action=
"logout"
method=
"post"
>
<button
class=
"button is-icon"
type=
"submit"
value=
"logout"
>
<font-awesome-icon
icon=
"sign-out-alt"
/>
Log out
</button>
</form>
</a>
</div>
</div>
</div>
</div>
...
...
@@ -50,7 +57,8 @@
export
default
{
data
:
()
=>
({
showMenu
:
false
,
brand
:
'<img src="assets/img/icon-spring-boot-admin.svg"><span>Spring Boot Admin</span>'
brand
:
'<img src="assets/img/icon-spring-boot-admin.svg"><span>Spring Boot Admin</span>'
,
userName
:
null
}),
props
:
{
views
:
{
...
...
@@ -68,8 +76,14 @@
},
created
()
{
/* global SBA */
if
(
SBA
&&
SBA
.
uiSettings
)
{
this
.
brand
=
SBA
.
uiSettings
.
brand
||
this
.
brand
;
if
(
SBA
)
{
if
(
SBA
.
uiSettings
)
{
this
.
brand
=
SBA
.
uiSettings
.
brand
||
this
.
brand
;
}
if
(
SBA
.
user
)
{
this
.
userName
=
SBA
.
user
.
name
;
}
}
},
mounted
()
{
...
...
spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/web/UiController.java
View file @
44846dd4
...
...
@@ -18,6 +18,7 @@ package de.codecentric.boot.admin.server.ui.web;
import
de.codecentric.boot.admin.server.web.AdminController
;
import
java.security.Principal
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.springframework.http.MediaType
;
...
...
@@ -46,6 +47,11 @@ public class UiController {
return
uiSettings
;
}
@ModelAttribute
(
value
=
"user"
,
binding
=
false
)
public
Principal
getUiSettings
(
Principal
principal
)
{
return
principal
;
}
@GetMapping
(
path
=
"/"
,
produces
=
MediaType
.
TEXT_HTML_VALUE
)
public
String
index
()
{
return
"index"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment