#91 -- Add markup page
This commit is contained in:
parent
d72cf99fa6
commit
9d5672cdcf
@ -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";
|
||||||
|
}
|
||||||
|
}
|
24
src/main/resources/templates/markup.html
Normal file
24
src/main/resources/templates/markup.html
Normal 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>
|
Loading…
Reference in New Issue
Block a user