#84 -- change page content

This commit is contained in:
Anton Romanov 2023-02-01 22:50:04 +04:00
parent f76976899d
commit 13ff304369
3 changed files with 18 additions and 7 deletions

View File

@ -26,7 +26,7 @@ public class RecommendationController {
} }
@GetMapping(ASSESSMENTS) @GetMapping(ASSESSMENTS)
public String getRecommendations(Model model, @RequestParam Optional<Integer> branchId) { public String getAssessments(Model model, @RequestParam Optional<Integer> branchId) {
model.addAttribute("branches", branchService.findAll()); model.addAttribute("branches", branchService.findAll());
if (branchId.isPresent()) { if (branchId.isPresent()) {
model.addAttribute("assessments", fuzzyInferenceService.getAssessments(branchId.get())); model.addAttribute("assessments", fuzzyInferenceService.getAssessments(branchId.get()));

View File

@ -7,7 +7,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head> </head>
<div class="container" layout:fragment="content"> <div class="container" layout:fragment="content">
<form action="#" th:action="${@route.RECOMMENDATIONS}" th:object="${filterBranchForm}" method="get"> <form action="#" th:action="${@route.ASSESSMENTS}" th:object="${filterBranchForm}" method="get">
<div class="row"> <div class="row">
<div class="col-md-2 col-sm-12"> <div class="col-md-2 col-sm-12">
Репозиторий-ветка Репозиторий-ветка
@ -26,17 +26,28 @@
]) ])
; ;
$('#select-branch').selectpicker('refresh'); $('#select-branch').selectpicker('refresh');
</script> </script>
</div> </div>
<input type="submit" class="btn btn-outline-success w-100" value="Применить фильтр"/> <input type="submit" class="btn btn-outline-success w-100" value="Применить фильтр"/>
</div> </div>
<div th:if="*{branchId == null}">Выбрерите ветку для получения рекомендаций</div> <div th:if="*{branchId == null}">Выбрерите ветку для получения оценки репозитория</div>
<input type="hidden" th:field="*{branchId}"> <input type="hidden" th:field="*{branchId}">
</form> </form>
<div th:each="recommendation: ${recommendations}"> <div th:if="${assessments != null}">
<div th:text="${recommendation}"></div> <h3>Состояние репозитория описывается следующими выражениями:</h3>
<div th:each="assessment: ${assessments}">
<div th:text="${assessment.consequent}"></div>
вследствие тенденции
<div th:text="${assessment.firstAntecedentTendency}"></div>
показателя
<div th:text="${assessment.firstAntecedent}"></div>
и тенденции
<div th:text="${assessment.secondAntecedentTendency}"></div>
показателя
<div th:text="${assessment.secondAntecedent}"></div>
и
</div>
</div> </div>
</div> </div>
</html> </html>

View File

@ -41,7 +41,7 @@
<a class="nav-link" href="/listRules" th:text="Правила">Link</a> <a class="nav-link" href="/listRules" th:text="Правила">Link</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/recommendations" th:text="Рекомендации">Link</a> <a class="nav-link" href="/assessments" th:text="Рекомендации">Link</a>
</li> </li>
</ul> </ul>
</div> </div>