1
0
mirror of https://github.com/pcvolkmer/etl-processor.git synced 2025-04-20 17:56:50 +00:00

feat: show information if no output is defined

This commit is contained in:
Paul-Christian Volkmer 2024-03-26 09:56:31 +01:00
parent 08540e3bd7
commit 8ae958b8c4
3 changed files with 29 additions and 24 deletions

View File

@ -21,7 +21,7 @@ package dev.dnpm.etl.processor.web
import dev.dnpm.etl.processor.config.AppConfiguration import dev.dnpm.etl.processor.config.AppConfiguration
import dev.dnpm.etl.processor.config.AppSecurityConfiguration import dev.dnpm.etl.processor.config.AppSecurityConfiguration
import dev.dnpm.etl.processor.monitoring.ConnectionCheckService import dev.dnpm.etl.processor.monitoring.GPasConnectionCheckService
import dev.dnpm.etl.processor.monitoring.RestConnectionCheckService import dev.dnpm.etl.processor.monitoring.RestConnectionCheckService
import dev.dnpm.etl.processor.output.MtbFileSender import dev.dnpm.etl.processor.output.MtbFileSender
import dev.dnpm.etl.processor.pseudonym.Generator import dev.dnpm.etl.processor.pseudonym.Generator
@ -69,10 +69,10 @@ abstract class MockSink : Sinks.Many<Boolean>
@MockBean( @MockBean(
Generator::class, Generator::class,
MtbFileSender::class, MtbFileSender::class,
ConnectionCheckService::class,
RequestProcessor::class, RequestProcessor::class,
TransformationService::class, TransformationService::class,
TokenRepository::class, TokenRepository::class,
GPasConnectionCheckService::class,
RestConnectionCheckService::class RestConnectionCheckService::class
) )
class ConfigControllerTest { class ConfigControllerTest {

View File

@ -56,7 +56,7 @@ class ConfigController(
@GetMapping @GetMapping
fun index(model: Model): String { fun index(model: Model): String {
val outputConnectionAvailable = val outputConnectionAvailable =
connectionCheckServices.filterIsInstance<OutputConnectionCheckService>().first().connectionAvailable() connectionCheckServices.filterIsInstance<OutputConnectionCheckService>().firstOrNull()?.connectionAvailable()
val gPasConnectionAvailable = val gPasConnectionAvailable =
connectionCheckServices.filterIsInstance<GPasConnectionCheckService>().firstOrNull()?.connectionAvailable() connectionCheckServices.filterIsInstance<GPasConnectionCheckService>().firstOrNull()?.connectionAvailable()

View File

@ -1,15 +1,19 @@
<h2><span th:if="${outputConnectionAvailable.available}"></span><span th:if="${not(outputConnectionAvailable.available)}"></span> MTB-File Verbindung</h2> <th:block th:if="${outputConnectionAvailable == null}">
<div> <h2><span>🟦</span> Keine Ausgabenkonfiguration</h2>
</th:block>
<th:block th:if="${outputConnectionAvailable != null}">
<h2><span th:if="${outputConnectionAvailable.available}"></span><span th:if="${not(outputConnectionAvailable.available)}"></span> MTB-File Verbindung</h2>
<div>
Stand: <time style="font-weight: bold" th:datetime="${#temporals.formatISO(outputConnectionAvailable.timestamp)}" th:text="${#temporals.formatISO(outputConnectionAvailable.timestamp)}"></time> Stand: <time style="font-weight: bold" th:datetime="${#temporals.formatISO(outputConnectionAvailable.timestamp)}" th:text="${#temporals.formatISO(outputConnectionAvailable.timestamp)}"></time>
&nbsp;|&nbsp; &nbsp;|&nbsp;
Letzte Änderung: <time style="font-weight: bold" th:datetime="${#temporals.formatISO(outputConnectionAvailable.lastChange)}" th:text="${#temporals.formatISO(outputConnectionAvailable.lastChange)}"></time> Letzte Änderung: <time style="font-weight: bold" th:datetime="${#temporals.formatISO(outputConnectionAvailable.lastChange)}" th:text="${#temporals.formatISO(outputConnectionAvailable.lastChange)}"></time>
</div> </div>
<div> <div>
Verbindung über <code>[[ ${mtbFileSender} ]]</code>. Die Verbindung ist aktuell Verbindung über <code>[[ ${mtbFileSender} ]]</code>. Die Verbindung ist aktuell
<strong th:if="${outputConnectionAvailable.available}" style="color: green">verfügbar.</strong> <strong th:if="${outputConnectionAvailable.available}" style="color: green">verfügbar.</strong>
<strong th:if="${not(outputConnectionAvailable.available)}" style="color: red">nicht verfügbar.</strong> <strong th:if="${not(outputConnectionAvailable.available)}" style="color: red">nicht verfügbar.</strong>
</div> </div>
<div class="connection-display border"> <div class="connection-display border">
<img th:src="@{/server.png}" alt="ETL-Processor" /> <img th:src="@{/server.png}" alt="ETL-Processor" />
<span class="connection" th:classappend="${outputConnectionAvailable.available ? 'available' : ''}"></span> <span class="connection" th:classappend="${outputConnectionAvailable.available ? 'available' : ''}"></span>
<img th:if="${mtbFileSender.startsWith('Rest')}" th:src="@{/server.png}" alt="bwHC-Backend" /> <img th:if="${mtbFileSender.startsWith('Rest')}" th:src="@{/server.png}" alt="bwHC-Backend" />
@ -18,4 +22,5 @@
<span></span> <span></span>
<span th:if="${mtbFileSender.startsWith('Rest')}">bwHC-Backend</span> <span th:if="${mtbFileSender.startsWith('Rest')}">bwHC-Backend</span>
<span th:if="${mtbFileSender.startsWith('Kafka')}">Kafka-Broker</span> <span th:if="${mtbFileSender.startsWith('Kafka')}">Kafka-Broker</span>
</div> </div>
</th:block>