Commit dce53990 by Johannes Edmeier

Add login-page and logout button.

parent 73911fba
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014-2017 the original author or authors.
~ Copyright 2014-2018 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
......@@ -30,7 +30,8 @@
<description>Spring Boot Admin Samples</description>
<url>https://github.com/codecentric/spring-boot-admin/</url>
<modules>
<module>spring-boot-admin-sample</module>
<module>spring-boot-admin-sample-servlet</module>
<module>spring-boot-admin-sample-reactive</module>
<module>spring-boot-admin-sample-war</module>
<module>spring-boot-admin-sample-eureka</module>
<module>spring-boot-admin-sample-consul</module>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014-2017 the original author or authors.
~
~ Licensed 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.
-->
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014-2017 the original author or authors.
~
~ Licensed 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.
-->
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>
\ No newline at end of file
......@@ -24,7 +24,7 @@
<version>2.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>spring-boot-admin-sample</artifactId>
<artifactId>spring-boot-admin-sample-reactive</artifactId>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
......
/*
* Copyright 2014-2017 the original author or authors.
* Copyright 2014-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -27,6 +27,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
......@@ -40,12 +41,30 @@ public class SpringBootAdminApplication {
}
@Bean
public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
@Profile("insecure")
public SecurityWebFilterChain securityWebFilterChainPermitAll(ServerHttpSecurity http) {
return http.authorizeExchange().anyExchange().permitAll()//
.and().csrf().disable()//
.build();
}
@Bean
@Profile("secure")
public SecurityWebFilterChain securityWebFilterChainSecure(ServerHttpSecurity http) {
// @formatter:off
return http.authorizeExchange()
.pathMatchers("/assets/**").permitAll()
.pathMatchers("/login").permitAll()
.anyExchange().authenticated()
.and()
.formLogin().loginPage("/login").and()
.logout().and()
.httpBasic().and()
.csrf().disable()
.build();
// @formatter:on
}
@Configuration
public static class NotifierConfig {
private final InstanceRepository repository;
......
......@@ -4,7 +4,7 @@ info:
build-url: "http://travis-ci.org/@env.TRAVIS_REPO_SLUG@/builds/@env.TRAVIS_BUILD_ID@"
logging:
file: "target/boot-admin-sample.log"
file: "target/boot-admin-sample-reactive.log"
management:
endpoints:
......@@ -16,7 +16,7 @@ management:
spring:
application:
name: spring-boot-admin-sample
name: spring-boot-admin-sample-reactive
boot:
admin:
client:
......@@ -44,14 +44,18 @@ spring:
---
spring:
profiles: secure
security:
user:
name: "user"
password: "password"
boot:
admin:
client:
username: "user" #These two are needed so that the client
password: "pass" #can register at the protected server api
password: "password" #can register at the protected server api
instance:
metadata:
user.name: "user" #These two are needed so that the server
user.password: "pass" #can access the proteceted client endpoints
user.password: "password" #can access the protected client endpoints
/*
* Copyright 2014-2018 the original author or authors.
*
* Licensed 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.
*/
package de.codecentric.boot.admin;
import org.junit.Test;
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014-2018 the original author or authors.
~
~ Licensed 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-samples</artifactId>
<version>2.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>spring-boot-admin-sample-servlet</artifactId>
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
<goal>build-info</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>de.codecentric.boot.admin.SpringBootAdminApplication</mainClass>
<addResources>false</addResources>
</configuration>
</plugin>
</plugins>
</build>
</project>
/*
* Copyright 2014-2018 the original author or authors.
*
* Licensed 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.
*/
package de.codecentric.boot.admin;
import de.codecentric.boot.admin.server.config.EnableAdminServer;
import de.codecentric.boot.admin.server.domain.entities.InstanceRepository;
import de.codecentric.boot.admin.server.notify.LoggingNotifier;
import de.codecentric.boot.admin.server.notify.RemindingNotifier;
import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier;
import java.util.concurrent.TimeUnit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public class SpringBootAdminApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootAdminApplication.class, args);
}
@Configuration
@Profile("insecure")
public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().permitAll()//
.and().csrf().disable();
}
}
@Configuration
@Profile("secure")
public static class SecuritySecureConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
// @formatter:off
http.authorizeRequests()
.antMatchers("/assets/**").permitAll()
.antMatchers("/login").permitAll()
.anyRequest().authenticated()
.and()
.formLogin().loginPage("/login").and()
.logout().and()
.httpBasic().and()
.csrf().disable();
// @formatter:on
}
}
@Configuration
public static class NotifierConfig {
private final InstanceRepository repository;
public NotifierConfig(InstanceRepository repository) {
this.repository = repository;
}
@Bean
@Primary
public RemindingNotifier remindingNotifier() {
RemindingNotifier notifier = new RemindingNotifier(filteringNotifier(), repository);
notifier.setReminderPeriod(TimeUnit.SECONDS.toMillis(10));
return notifier;
}
@Scheduled(fixedRate = 1_000L)
public void remind() {
remindingNotifier().sendReminders();
}
@Bean
public FilteringNotifier filteringNotifier() {
return new FilteringNotifier(loggerNotifier(), repository);
}
@Bean
public LoggingNotifier loggerNotifier() {
return new LoggingNotifier(repository);
}
}
}
---
info:
scm-url: "@scm.url@"
build-url: "http://travis-ci.org/@env.TRAVIS_REPO_SLUG@/builds/@env.TRAVIS_BUILD_ID@"
logging:
file: "target/boot-admin-sample-servlet.log"
management:
endpoints:
web:
expose: "*"
endpoint:
health:
show-details: true
spring:
application:
name: spring-boot-admin-sample-servlet
boot:
admin:
client:
url: http://localhost:8080
profiles:
active:
- insecure
---
spring:
profiles: dev
boot:
admin:
ui:
cache:
no-cache: true
template-location: file://@project.basedir@/../../spring-boot-admin-server-ui/target/dist/
resource-locations: file://@project.basedir@/../../spring-boot-admin-server-ui/target/dist/
cache-templates: false
---
spring:
profiles: insecure
---
spring:
profiles: secure
security:
user:
name: "user"
password: "password"
boot:
admin:
client:
username: "user" #These two are needed so that the client
password: "password" #can register at the protected server api
instance:
metadata:
user.name: "user" #These two are needed so that the server
user.password: "password" #can access the protected client endpoints
/*
* Copyright 2014-2018 the original author or authors.
*
* Licensed 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.
*/
package de.codecentric.boot.admin;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {SpringBootAdminApplication.class})
public class SpringBootAdminApplicationTest {
@Test
public void contextLoads() {
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014-2018 the original author or authors.
~
~ Licensed 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
......@@ -13,6 +29,11 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
......
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014-2017 the original author or authors.
~
~ Licensed 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.
-->
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>
\ No newline at end of file
......@@ -10,9 +10,9 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@fortawesome/fontawesome": "^1.1.0",
"@fortawesome/fontawesome-free-brands": "^5.0.2",
"@fortawesome/fontawesome-free-solid": "^5.0.2",
"@fortawesome/fontawesome": "^1.1.1",
"@fortawesome/fontawesome-free-brands": "^5.0.3",
"@fortawesome/fontawesome-free-solid": "^5.0.3",
"@fortawesome/vue-fontawesome": "0.0.22",
"axios": "^0.17.1",
"bulma": "^0.6.1",
......@@ -38,7 +38,7 @@
"devDependencies": {
"autoprefixer": "^7.2.4",
"babel-core": "^6.25.0",
"babel-eslint": "^8.1.2",
"babel-eslint": "^8.2.1",
"babel-jest": "^22.0.4",
"babel-loader": "^7.1.1",
"babel-plugin-lodash": "^3.3.2",
......@@ -59,7 +59,7 @@
"html-loader": "^0.5.4",
"html-webpack-plugin": "^2.30.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^22.0.4",
"jest": "^22.0.5",
"jest-vue": "^0.8.2",
"lodash-webpack-plugin": "^0.11.4",
"node-sass": "^4.7.2",
......@@ -68,13 +68,13 @@
"sass-loader": "^6.0.6",
"style-loader": "^0.19.1",
"url-loader": "^0.6.2",
"vue-loader": "^13.6.2",
"vue-loader": "^13.7.0",
"vue-svg-loader": "^0.4.0",
"vue-template-compiler": "^2.5.13",
"vue-test-utils": "^1.0.0-beta.9",
"webpack": "^3.10.0",
"webpack-bundle-analyzer": "^2.9.1",
"webpack-dev-server": "^2.10.0"
"webpack-bundle-analyzer": "^2.9.2",
"webpack-dev-server": "^2.10.1"
},
"browserslist": [
"> 2%",
......
......@@ -29,6 +29,18 @@
cursor: pointer;
}
.button.is-icon {
background: transparent;
border-color: transparent;
}
.navbar-item .button.is-icon {
color: $navbar-item-color;
&:hover {
color: $navbar-item-hover-color;
}
}
.section.is-loading {
&::after {
@include loader;
......@@ -40,17 +52,6 @@
}
}
.data-table {
& td:last-child {
width: 100%;
text-align: right;
}
& td:not(:last-child) {
white-space: nowrap;
}
}
//D3 Charts
.tick {
& line {
......
......@@ -23,7 +23,7 @@
<meta name="format-detection" content="telephone=no,email=no">
<link rel="shortcut icon" href="assets/img/favicon.png" th:href="@{assets/img/favicon.png}" type="image/png">
<link href="assets/css/sba-core.css" th:href="@{assets/css/sba-core.css}" rel="stylesheet">
<title>Spring Boot Admin - Applications</title>
<title>Spring Boot Admin</title>
</head>
<body>
......
......@@ -14,28 +14,13 @@
* limitations under the License.
*/
import fontawesome from '@fortawesome/fontawesome';
import faGithub from '@fortawesome/fontawesome-free-brands/faGithub';
import faGitter from '@fortawesome/fontawesome-free-brands/faGitter';
import faStackOverflow from '@fortawesome/fontawesome-free-brands/faStackOverflow';
import faBan from '@fortawesome/fontawesome-free-solid/faBan';
import faBook from '@fortawesome/fontawesome-free-solid/faBook';
import faCheck from '@fortawesome/fontawesome-free-solid/faCheck';
import faDownload from '@fortawesome/fontawesome-free-solid/faDownload';
import faExclamation from '@fortawesome/fontawesome-free-solid/faExclamation';
import faMinusCircle from '@fortawesome/fontawesome-free-solid/faMinusCircle';
import faQuestionCircle from '@fortawesome/fontawesome-free-solid/faQuestionCircle';
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 FontAwesomeIcon from '@fortawesome/vue-fontawesome';
import moment from 'moment';
import Vue from 'vue';
import VueRouter from 'vue-router';
import './assets/css/base.scss';
import './assets/img/favicon.png';
import sbaComponents from './components'
import FontAwesomeIcon from './utils/fontawesome';
import sbaAbout from './views/about';
import sbaApplications from './views/applications';
import sbaInstancesDetails from './views/instances/details';
......@@ -48,10 +33,7 @@ import sbaInstancesShell from './views/instances/shell';
import sbaInstancesThreaddump from './views/instances/threaddump';
import sbaInstancesTrace from './views/instances/trace';
import sbaJournal from './views/journal';
import sbaShell from './views/shell'
fontawesome.library.add(faGithub, faStackOverflow, faGitter, faTrash, faDownload, faStepForward, faStepBackward, faCheck, faQuestionCircle, faBan, faTimesCircle, faMinusCircle, faExclamation,
faBook);
import sbaShell from './views/shell';
moment.locale(window.navigator.language);
......@@ -64,7 +46,7 @@ const router = new VueRouter({
});
const views = [];
views.register = (view) => {
views.register = view => {
if (view.template) {
views.push(view);
}
......@@ -81,8 +63,6 @@ views.register = (view) => {
}
};
router.addRoutes([{path: '/', redirect: {name: 'applications'}}]);
views.register({
path: '/applications',
name: 'applications',
......@@ -148,7 +128,7 @@ views.register({
});
views.register({
name: 'instance/heapdump',
href: (params) => `instances/${params.instanceId}/actuator/heapdump`,
href: params => `instances/${params.instanceId}/actuator/heapdump`,
template: 'Heapdump',
order: 600,
isActive: ({instance}) => instance.hasEndpoint('heapdump')
......@@ -166,6 +146,8 @@ views.register({
isActive: ({instance}) => instance.hasEndpoint('flyway')
});
router.addRoutes([{path: '/', redirect: {name: 'applications'}}]);
//Fire root Vue up
new Vue({
router,
......
<!DOCTYPE html>
<!--
~ Copyright 2014-2018 the original author or authors.
~
~ Licensed 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.
-->
<html>
<head>
<base th:href="@{/}" href="/">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="format-detection" content="telephone=no,email=no">
<link rel="shortcut icon" href="assets/img/favicon.png" th:href="@{assets/img/favicon.png}" type="image/png">
<link href="assets/css/sba-core.css" th:href="@{assets/css/sba-core.css}" rel="stylesheet">
<title>Spring Boot Admin - Login</title>
</head>
<body>
<section class="hero is-fullheight">
<div class="hero-body">
<div class="container has-text-centered">
<div class="column is-4 is-offset-4">
<div class="box">
<h1 class="title">Spring Boot Admin</h1>
<form method="post" action="login">
<div class="field">
<p class="is-medium has-text-danger" th:unless="${param.error == null}">
Invalid username or password!
</p>
<p class="is-medium has-text-success" th:unless="${param.logout == null}">
Logout successful!
</p>
</div>
<div class="field">
<div class="control">
<input class="input is-medium" type="input" name="username" placeholder="Username"
autofocus th:classappend="${param.error != null} ? is-danger">
</div>
</div>
<div class="field">
<div class="control">
<input class="input is-medium" type="password" name="password"
placeholder="Password" th:classappend="${param.error != null} ? is-danger">
</div>
</div>
<div class="field">
<div class="control">
<input type="submit" class="button is-block is-primary is-medium is-fullwidth"
value="Login">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</body>
</html>
\ No newline at end of file
/*
* Copyright 2014-2018 the original author or authors.
*
* Licensed 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.
*/
import fontawesome from '@fortawesome/fontawesome';
import faGithub from '@fortawesome/fontawesome-free-brands/faGithub';
import faGitter from '@fortawesome/fontawesome-free-brands/faGitter';
import faStackOverflow from '@fortawesome/fontawesome-free-brands/faStackOverflow';
import faBan from '@fortawesome/fontawesome-free-solid/faBan';
import faBook from '@fortawesome/fontawesome-free-solid/faBook';
import faCheck from '@fortawesome/fontawesome-free-solid/faCheck';
import faDownload from '@fortawesome/fontawesome-free-solid/faDownload';
import faExclamation from '@fortawesome/fontawesome-free-solid/faExclamation';
import faMinusCircle from '@fortawesome/fontawesome-free-solid/faMinusCircle';
import faQuestionCircle from '@fortawesome/fontawesome-free-solid/faQuestionCircle';
import faSignOutAlt from '@fortawesome/fontawesome-free-solid/faSignOutAlt';
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 FontAwesomeIcon from '@fortawesome/vue-fontawesome';
fontawesome.library.add(faGithub, faStackOverflow, faGitter, faTrash, faDownload, faStepForward, faStepBackward, faCheck, faQuestionCircle, faBan, faTimesCircle, faMinusCircle, faExclamation,
faBook, faSignOutAlt);
export default FontAwesomeIcon;
\ No newline at end of file
......@@ -66,7 +66,6 @@
window.addEventListener('scroll', this.onScroll);
},
beforeDestroy() {
this.stop();
window.removeEventListener('scroll', this.onScroll);
},
methods: {
......
......@@ -35,8 +35,10 @@
<td v-text="trace.timestamp.format('L HH:mm:ss.SSS')"></td>
<td v-text="trace.method"></td>
<td v-text="trace.path"></td>
<td v-text="trace.status"
:class="{ 'has-text-warning' : trace.isClientError(), 'has-text-danger' : trace.isServerError() }"></td>
<td>
<span v-text="trace.status" class="tag"
:class="{ 'is-success' : trace.isSuccess(), 'is-warning' : trace.isClientError(), 'is-danger' : trace.isServerError() }"></span>
</td>
<td v-text="trace.contentType"></td>
<td v-text="trace.contentLength ? prettyBytes(trace.contentLength) : ''"></td>
<td v-text="trace.timeTaken !== null && typeof trace.timeTaken !== 'undefined' ? `${trace.timeTaken} ms` : ''"></td>
......
......@@ -35,6 +35,14 @@
<router-link class="navbar-item" v-for="view in views" :to="{name: view.name}" :key="view.name"
v-html="view.template">
</router-link>
<div class="navbar-item">
<form action="logout" method="post">
<button class="button is-icon" type="submit" value="logout">
Logout&nbsp;<font-awesome-icon icon="sign-out-alt" size="lg"></font-awesome-icon>
</button>
</form>
</div>
</div>
</div>
</div>
......
......@@ -29,4 +29,9 @@ public class UiController {
return "index";
}
@GetMapping(path = "/login", produces = MediaType.TEXT_HTML_VALUE)
public String login() {
return "login";
}
}
......@@ -157,6 +157,12 @@ const config = {
inject: false,
hash: process.env.NODE_ENV === 'production',
}),
new HtmlWebpackPlugin({
filename: 'login.html',
template: './src/main/frontend/login.html',
inject: false,
hash: process.env.NODE_ENV === 'production',
}),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment