Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
Anton Romanov 2023-02-22 15:49:18 +04:00
commit ba747cfed3
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,27 @@
package ru.ulstu.extractor.ts.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import ru.ulstu.extractor.ts.model.TimeSeries;
import ru.ulstu.extractor.ts.service.TimeSeriesService;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Controller
@ApiIgnore
public class TimeSeriesMarkupController {
private final TimeSeriesService timeSeriesService;
public TimeSeriesMarkupController(TimeSeriesService timeSeriesService) {
this.timeSeriesService = timeSeriesService;
}
@GetMapping("time-series-markup")
public String markupTs(Model model) {
List<TimeSeries> ts = timeSeriesService.getAllTimeSeries();
model.addAttribute("ts", ts);
return "markup";
}
}

View File

@ -0,0 +1,24 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}">
<head>
<title>Простая обработка формы на Spring MVC</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<div class="container" layout:fragment="content">
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th scope="col" colspan="10">Разметка временных рядов</th>
</tr>
</thead>
<tbody>
<tr th:each="t: ${ts}">
<td><span class="badge badge-success" th:text="${t.name}"></span></td>
<td><span class="badge badge-success" th:text="${#lists.size(t.values)}"></span></td>
</tr>
</tbody>
</table>
</div>
</html>