From 211a8b004c8d1cf47cd63ba30904e12cc75838fa Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Fri, 3 Mar 2023 11:10:35 +0400 Subject: [PATCH] #91 -- Add get markups form --- .../ulstu/extractor/GitExtractorApplication.java | 1 - .../controller/TimeSeriesMarkupController.java | 2 +- .../ulstu/extractor/markup/model/MarkupForm.java | 6 +++++- .../ru/ulstu/extractor/markup/model/MarkupRow.java | 3 +++ src/main/resources/templates/markup.html | 14 ++++++++------ 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/main/java/ru/ulstu/extractor/GitExtractorApplication.java b/src/main/java/ru/ulstu/extractor/GitExtractorApplication.java index 1cf7928..8491e6c 100644 --- a/src/main/java/ru/ulstu/extractor/GitExtractorApplication.java +++ b/src/main/java/ru/ulstu/extractor/GitExtractorApplication.java @@ -26,5 +26,4 @@ public class GitExtractorApplication { public void doSomethingAfterStartup() { indexService.indexFailedBranchesOnStart(); } - } diff --git a/src/main/java/ru/ulstu/extractor/markup/controller/TimeSeriesMarkupController.java b/src/main/java/ru/ulstu/extractor/markup/controller/TimeSeriesMarkupController.java index 9eeab36..0c1600c 100644 --- a/src/main/java/ru/ulstu/extractor/markup/controller/TimeSeriesMarkupController.java +++ b/src/main/java/ru/ulstu/extractor/markup/controller/TimeSeriesMarkupController.java @@ -31,7 +31,7 @@ public class TimeSeriesMarkupController { @GetMapping("time-series-markup") public String markupTs(Model model) { List tss = timeSeriesService.getAllTimeSeries(); - model.addAttribute("markupForm", new MarkupForm(tss.stream().map(MarkupRow::new).collect(Collectors.toList()))); + model.addAttribute("markupForm", new MarkupForm(tss.stream().map(MarkupRow::new).limit(200).collect(Collectors.toList()))); return "markup"; } diff --git a/src/main/java/ru/ulstu/extractor/markup/model/MarkupForm.java b/src/main/java/ru/ulstu/extractor/markup/model/MarkupForm.java index e197b6b..b81a110 100644 --- a/src/main/java/ru/ulstu/extractor/markup/model/MarkupForm.java +++ b/src/main/java/ru/ulstu/extractor/markup/model/MarkupForm.java @@ -1,9 +1,13 @@ package ru.ulstu.extractor.markup.model; +import java.util.ArrayList; import java.util.List; public class MarkupForm { - private List markupRows; + private List markupRows = new ArrayList<>(); + + public MarkupForm() { + } public MarkupForm(List markupRows) { this.markupRows = markupRows; diff --git a/src/main/java/ru/ulstu/extractor/markup/model/MarkupRow.java b/src/main/java/ru/ulstu/extractor/markup/model/MarkupRow.java index f62640e..3989a6f 100644 --- a/src/main/java/ru/ulstu/extractor/markup/model/MarkupRow.java +++ b/src/main/java/ru/ulstu/extractor/markup/model/MarkupRow.java @@ -6,6 +6,9 @@ public class MarkupRow { private TimeSeries timeSeries; private String markup; + public MarkupRow() { + } + public MarkupRow(TimeSeries ts) { this.timeSeries = ts; } diff --git a/src/main/resources/templates/markup.html b/src/main/resources/templates/markup.html index 6417ba2..b2b1d4e 100644 --- a/src/main/resources/templates/markup.html +++ b/src/main/resources/templates/markup.html @@ -7,21 +7,23 @@
-
+ - + - - - + + + +
Разметка временных рядовРазметка временных рядов
- +