add dependencies, fix html

This commit is contained in:
Anton Romanov 2019-04-26 14:42:44 +04:00
parent ae102d6466
commit ac88ef2704
11 changed files with 477 additions and 244 deletions

View File

@ -6,7 +6,6 @@ import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ModelAttribute;
import ru.ulstu.core.error.EntityIdIsNullException;
import ru.ulstu.core.model.ErrorConstants;
import ru.ulstu.core.model.response.Response;
@ -20,7 +19,6 @@ import ru.ulstu.user.error.UserNotActivatedException;
import ru.ulstu.user.error.UserNotFoundException;
import ru.ulstu.user.error.UserPasswordsNotValidOrNotMatchException;
import ru.ulstu.user.error.UserResetKeyError;
import ru.ulstu.user.service.UserService;
import java.util.Set;
import java.util.stream.Collectors;
@ -28,21 +26,6 @@ import java.util.stream.Collectors;
@ControllerAdvice
public class AdviceController {
private final Logger log = LoggerFactory.getLogger(AdviceController.class);
private final UserService userService;
public AdviceController(UserService userService) {
this.userService = userService;
}
@ModelAttribute("currentUser")
public String getCurrentUser() {
return userService.getCurrentUser().getUserAbbreviate();
}
@ModelAttribute("flashMessage")
public String getFlashMessage() {
return null;
}
private Response<Void> handleException(ErrorConstants error) {
log.warn(error.toString());

View File

@ -1,23 +0,0 @@
package ru.ulstu.index.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import ru.ulstu.core.controller.AdviceController;
import ru.ulstu.user.service.UserService;
import springfox.documentation.annotations.ApiIgnore;
@Controller()
@RequestMapping(value = "/index")
@ApiIgnore
public class IndexController extends AdviceController {
public IndexController(UserService userService) {
super(userService);
}
@GetMapping
public void currentUser(ModelMap modelMap) {
//нужен здесь для добавления параметров на стартовой странице
}
}

View File

@ -0,0 +1,42 @@
<template>
<div class="alert" role="alert"
:class="'alert-' + type">
{{ text }}
</div>
</template>
<script>
module.exports = {
props: {
id: {
type: Number,
required: true,
validator: function (value) {
return value >= 0
}
},
text: {
type: String,
required: true
},
type: {
type: String
}
},
data: function () {
return {
removeMessageAfter: 1000 * 10
}
},
methods: {
removeMessage: function () {
this.$store.dispatch("removeMessage", this.id);
}
},
mounted: function () {
this.$nextTick(function () {
setTimeout(this.removeMessage, this.removeMessageAfter);
});
}
}
</script>

View File

@ -0,0 +1,26 @@
<template>
<div class="container container-with-padding">
<div class="feedback-panel">
<slot></slot>
<app-messages-item v-for="message in messages"
:key="message.id"
:id="message.id"
:text="message.text"
:type="message.type">
</app-messages-item>
</div>
</div>
</template>
<script>
module.exports = {
components: {
"app-messages-item": httpVueLoaderEx("/cmp/app-messages-item.vue")
},
computed: {
messages: function () {
return this.$store.state.messages;
}
}
}
</script>

View File

@ -0,0 +1,226 @@
<template>
<div>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top navbar-shrink" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="/">NG-Tracker</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
aria-label="Toggle navigation">
Menu
<i class="fa fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav text-uppercase ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="#landing">НИО-17</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="http://is.ulstu.ru">Сайт
кафедры</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank"
th:href="@{'http://timetable.athene.tech?filter='+${currentUser}}">Расписание</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="https://kias.rfbr.ru/">КИАС
РФФИ</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="/logout">Выход</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="container">
<ul id="messages" class="feedback-panel">
</ul>
</div>
<section class="bg-light" id="portfolio">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./papers/papers">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/papers.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Статьи</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./grants/dashboard">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/grants.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Гранты</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./projects/dashboard">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/projects.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Проекты</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./conferences/conferences">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/conf.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Конференции</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="/team">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/team.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Команда</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./students/tasks">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/students.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Работа со студентами</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./timeline">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/tasks.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Задачи</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="./career.html">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/career.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Карьера</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="/other">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/templates.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Прочее</h4>
<p class="text-muted"></p>
</div>
</div>
</div>
</div>
</section>
<section class="bg-light">
<div class="container">
<div class="row">
<div id="app">
{{ getMessage() }}
</div>
</div>
</div>
</section>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<span class="copyright">Copyright © НИО17 2018</span>
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
<ul class="list-inline quicklinks">
<li class="list-inline-item">
<a href="/swagger-ui.html">Разработчикам</a>
</li>
</ul>
</div>
</div>
</div>
</footer>
</div>
</template>
<script>
module.exports = {
components: {
"app-messages": httpVueLoaderEx("/core-components/app-messages.vue")
},
methods: {
getVersion: function () {
return appConfig.version;
},
getMessage: function () {
return "hell, Vue!";
}
},
mounted: function () {
this.$nextTick(function () {
var self = this;
window.onerror = function myErrorHandler(errorMsg, url, lineNumber) {
self.$store.dispatch("addDangerMessage", lineNumber + ": " + errorMsg + " (" + url + ")");
};
});
}
}
</script>

View File

@ -0,0 +1,10 @@
<template>
<div class="page-not-found-container">
<h1><i class="fas fa-user-secret"></i> 404</h1>
<div class="page-not-found-link">
<a href="/">
<b>На главную</b>
</a>
</div>
</div>
</template>

View File

@ -0,0 +1,57 @@
/* global axios */
(function umd(root, factory) {
if (typeof module === 'object' && typeof exports === 'object')
module.exports = factory();
else if (typeof define === 'function' && define.amd)
define([], factory);
else
root.axiosEx = factory();
})(this, function factory() {
'use strict';
var axiosConfig = {
headers: {
'Content-Type': 'application/json;charset=UTF-8',
"Access-Control-Allow-Origin": "*"
}
};
function errorHandler(result, callback) {
var data = result.data;
if (callback) {
callback(data);
}
}
function axiosGet(url, resolv, reject) {
axios.get(url)
.then(function (result) {
errorHandler(result, resolv, reject);
})
.catch(function (error) {
setTimeout(function () {
throw Error(error);
}
);
});
}
function axiosPost(url, data, resolv, reject) {
axios.post(url, JSON.stringify(data), axiosConfig)
.then(function (result) {
errorHandler(result, resolv, reject);
})
.catch(function (error) {
setTimeout(function () {
throw Error(error);
}
);
});
}
return {
get: axiosGet,
post: axiosPost
};
});

View File

@ -0,0 +1,29 @@
(function umd(root, factory) {
if (typeof module === 'object' && typeof exports === 'object')
module.exports = factory();
else if (typeof define === 'function' && define.amd)
define([], factory);
else
root.appConfig = factory();
})(this, function factory() {
'use strict';
var contextPath = "";
var apiVersion = "";
var basePath = contextPath + apiVersion;
var appVersion = "@@version";
var resourcesTimestamp = "?v=@@timestamp";
var getOwl = basePath + "/get-owl";
var getTables = basePath + "/get-tables";
var makeIntegration = basePath + "/make-integration";
return {
version: appVersion,
timestamp: resourcesTimestamp,
owl: getOwl,
tables: getTables,
integration: makeIntegration
};
});

View File

@ -0,0 +1,18 @@
/* global httpVueLoader, appConfig */
(function umd(root, factory) {
if (typeof module === 'object' && typeof exports === 'object')
module.exports = factory();
else if (typeof define === 'function' && define.amd)
define([], factory);
else
root.httpVueLoaderEx = factory();
})(this, function factory() {
'use strict';
function httpVueLoaderEx(url, name) {
return httpVueLoader(url + appConfig.timestamp, name);
}
return httpVueLoaderEx;
});

View File

@ -0,0 +1,62 @@
/* global Vue, VueRouter, Vuex, httpVueLoaderEx */
var router = new VueRouter({
linkActiveClass: "active",
linkExactActiveClass: "",
mode: "history",
routes: [
{
path: "/", component: httpVueLoaderEx("/core-components/integration-main.vue", "Integration")
},
{
path: "/*", component: httpVueLoaderEx("/core-components/page-not-found.vue", "PageNotFound")
}
]
});
var store = new Vuex.Store({
state: {
messages: []
},
mutations: {
addMessage: function (state, message) {
state.messages.push({
id: state.messages.length === 0 ? 0 : state.messages[state.messages.length - 1],
text: message.text,
type: message.type || "info"
});
},
removeMessage: function (state, messageId) {
if (messageId < 0 || messageId >= state.messages.length) {
return;
}
state.messages.splice(messageId, 1);
}
},
actions: {
addInfoMessage: function (context, message) {
context.commit("addMessage", message);
},
addSuccessMessage: function (context, message) {
context.commit("addMessage", {text: message, type: "success"});
},
addWarningMessage: function (context, message) {
context.commit("addMessage", {text: message, type: "warning"});
},
addDangerMessage: function (context, message) {
context.commit("addMessage", {text: message, type: "danger"});
},
removeMessage: function (context, messageId) {
context.commit("removeMessage", messageId);
}
}
});
new Vue({
el: "#integration-app",
router: router,
store: store,
components: {
"app": httpVueLoaderEx("/core-components/app.vue")
}
});

View File

@ -14,215 +14,18 @@
</head>
<body id="page-top">
<nav class="navbar navbar-expand-lg navbar-dark fixed-top navbar-shrink" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="/">NG-Tracker</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
aria-label="Toggle navigation">
Menu
<i class="fa fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav text-uppercase ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="#landing">НИО-17</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="http://is.ulstu.ru">Сайт кафедры</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank"
th:href="@{'http://timetable.athene.tech?filter='+${currentUser}}">Расписание</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" target="_blank" href="https://kias.rfbr.ru/">КИАС РФФИ</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="/logout">Выход</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="container">
<ul id="messages" class="feedback-panel">
</ul>
</div>
<section class="bg-light" id="portfolio">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./papers/papers">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/papers.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Статьи</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./grants/dashboard">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/grants.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Гранты</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./projects/dashboard">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/projects.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Проекты</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./conferences/conferences">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/conf.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Конференции</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="/team">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/team.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Команда</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./students/tasks">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/students.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Работа со студентами</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" href="./timeline">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/tasks.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Задачи</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="./career.html">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/career.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Карьера</h4>
<p class="text-muted"></p>
</div>
</div>
<div class="col-md-4 col-sm-6 portfolio-item">
<a class="portfolio-link" data-toggle="modal" href="/other">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-arrow-right fa-3x"></i>
</div>
</div>
<img class="img-fluid" src="img/main/templates.jpg" alt=""/>
</a>
<div class="portfolio-caption">
<h4>Прочее</h4>
<p class="text-muted"></p>
</div>
</div>
</div>
</div>
</section>
<section class="bg-light">
<div class="container">
<div class="row">
<div id="app">
{{ message }}
</div>
</div>
</div>
</section>
<div id="integration-app">
<app></app>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<span class="copyright">Copyright © НИО17 2018</span>
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
<ul class="list-inline quicklinks">
<li class="list-inline-item">
<a href="/swagger-ui.html">Разработчикам</a>
</li>
</ul>
</div>
</div>
</div>
</footer>
<script type="application/javascript" src="/webjars/vue/2.6.9/dist/vue.js"></script>
<script type="application/javascript" src="/webjars/vuex/3.1.0/dist/vuex.min.js"></script>
<script type="application/javascript" src="/webjars/vue-router/3.0.2/dist/vue-router.min.js"></script>
<script type="application/javascript" src="/webjars/http-vue-loader/1.3.5/src/httpVueLoader.js"></script>
<script type="application/javascript" src="/webjars/axios/0.18.0/dist/axios.min.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
message: 'Привет, Vue!'
}
})
</script>
<script type="application/javascript" src="/js/app-config.js?v=@@timestamp"></script>
<script type="application/javascript" src="/js/app-vue-loader.js?v=@@timestamp"></script>
<script type="application/javascript" src="/js/app-axios.js?v=@@timestamp"></script>
<script type="application/javascript" src="/js/app.js?v=@@timestamp"></script>
</body>
</html>