diff --git a/build.gradle b/build.gradle index 8a3c78a..a3229f4 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,11 @@ jar { } repositories { + mavenLocal() mavenCentral() + maven { + url "https://repository.primefaces.org/" + } } sourceCompatibility = 11 @@ -23,11 +27,15 @@ dependencies { versionSwagger = '2.5.0' } - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jetty' implementation group: 'org.slf4j', name: 'slf4j-api', version: versionSLF4J + implementation group: 'org.primefaces', name: 'primefaces', version: '7.0' + implementation group: 'net.bootsfaces', name: 'bootsfaces', version: '1.4.2' + implementation group: 'org.joinfaces', name: 'jsf-spring-boot-starter', version: '4.0.8' + implementation group: 'org.javassist', name: 'javassist', version: '3.25.0-GA' + implementation group: 'org.primefaces.themes', name: 'all-themes', version: '1.0.10' implementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: versionJetty diff --git a/src/main/java/ru/ulstu/configurations/MvcConfiguration.java b/src/main/java/ru/ulstu/configurations/MvcConfiguration.java new file mode 100644 index 0000000..11f7910 --- /dev/null +++ b/src/main/java/ru/ulstu/configurations/MvcConfiguration.java @@ -0,0 +1,14 @@ +package ru.ulstu.configuration; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class MvcConfiguration implements WebMvcConfigurer { + @Override + public void addViewControllers(ViewControllerRegistry registry) { + registry.addRedirectViewController("/", "/index.xhtml"); + registry.addRedirectViewController("/default", "/index.xhtml"); + } +} diff --git a/src/main/java/ru/ulstu/pages/IndexView.java b/src/main/java/ru/ulstu/pages/IndexView.java new file mode 100644 index 0000000..9e288c2 --- /dev/null +++ b/src/main/java/ru/ulstu/pages/IndexView.java @@ -0,0 +1,73 @@ +package ru.ulstu.pages; + +import org.primefaces.model.chart.Axis; +import org.primefaces.model.chart.AxisType; +import org.primefaces.model.chart.LineChartModel; +import org.primefaces.model.chart.LineChartSeries; + +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Named; +import java.io.Serializable; + +@Named +@ViewScoped +public class IndexView implements Serializable { + private LineChartModel lineModel1; + + public LineChartModel getLineModel1() { + return lineModel1; + } + + @PostConstruct + public void init() { + createChart(); + } + + private LineChartModel initLinearModel() { + LineChartModel model = new LineChartModel(); + + LineChartSeries series1 = new LineChartSeries(); + series1.setLabel("Временной ряд"); + + series1.set(1, 2); + series1.set(2, 1); + series1.set(3, 3); + series1.set(4, 6); + series1.set(5, 8); + + LineChartSeries series2 = new LineChartSeries(); + series2.setLabel("Сглаженный ряд"); + + series2.set(1, 6); + series2.set(2, 3); + series2.set(3, 2); + series2.set(4, 7); + series2.set(5, 9); + + LineChartSeries series3 = new LineChartSeries(); + series3.setLabel("Прогноз"); + + series3.set(1, 6); + series3.set(2, 3); + series3.set(3, 2); + series3.set(4, 7); + series3.set(6, 9); + series3.set(7, 9); + + model.addSeries(series1); + model.addSeries(series2); + model.addSeries(series3); + + return model; + } + + public void createChart() { + lineModel1 = initLinearModel(); + lineModel1.setTitle("Сглаживание временного ряда"); + lineModel1.setLegendPosition("e"); + Axis yAxis = lineModel1.getAxis(AxisType.Y); + yAxis.setMin(0); + yAxis.setMax(10); + } +} diff --git a/src/main/resources/META-INF/resources/basicTemplate.xhtml b/src/main/resources/META-INF/resources/basicTemplate.xhtml new file mode 100644 index 0000000..25646b8 --- /dev/null +++ b/src/main/resources/META-INF/resources/basicTemplate.xhtml @@ -0,0 +1,44 @@ + + + + + + Time series smoothing + + + + + +
+
+ + + + + + +
+
+
+
+ Content +
+
+
+
+ +
+
Ulyanovsk State Technical University
+
ulstu.ru
+
2020
+
+
+
+
+
+ diff --git a/src/main/resources/META-INF/resources/css/style.css b/src/main/resources/META-INF/resources/css/style.css new file mode 100644 index 0000000..8020cf6 --- /dev/null +++ b/src/main/resources/META-INF/resources/css/style.css @@ -0,0 +1,7 @@ +.ui-picklist-list-wrapper { + width: 50% !important; +} + +.ui-picklist-list { + width: 100% !important; +} diff --git a/src/main/resources/META-INF/resources/img/logo.jpg b/src/main/resources/META-INF/resources/img/logo.jpg new file mode 100644 index 0000000..70e19f3 Binary files /dev/null and b/src/main/resources/META-INF/resources/img/logo.jpg differ diff --git a/src/main/resources/META-INF/resources/img/logo.png b/src/main/resources/META-INF/resources/img/logo.png new file mode 100644 index 0000000..e786fc5 Binary files /dev/null and b/src/main/resources/META-INF/resources/img/logo.png differ diff --git a/src/main/resources/META-INF/resources/index.xhtml b/src/main/resources/META-INF/resources/index.xhtml new file mode 100644 index 0000000..2e74ffd --- /dev/null +++ b/src/main/resources/META-INF/resources/index.xhtml @@ -0,0 +1,19 @@ + + + + + +
+
+ +
+
+ +
+
+
+
+ \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 94ea0dd..8d0c45f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,6 @@ spring.main.banner-mode=off logging.level.tech.athene=DEBUG server.port=8080 - -spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS = false +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false +joinfaces.primefaces.theme=afterwork +joinfaces.primefaces.font-awesome=true \ No newline at end of file