1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
<!DOCTYPE html>
<html lang="de" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>ETL-Prozessor</title>
<link rel="stylesheet" th:href="@{/main.css}"/>
</head>
<body>
<div th:replace="~{fragments.html :: nav}"></div>
<main>
<div class="search-form" sec:authorize="hasRole('USER') or hasRole('ADMIN')">
<form th:action="@{/}" method="get">
<input id="search-input" type="text" name="q" maxlength="64" placeholder="Suche nach Patienten-Pseudonym oder TAN" th:value="${query}"/>
<a th:href="@{/}">🞫</a>
</form>
</div>
<h1>
Alle Anfragen
<a id="reload-notify" class="btn btn-red reload" title="Neue Anfragen laden" th:href="@{/}">
<span>Neue Anfragen laden</span>
</a>
</h1>
<div>
<h2 th:if="${patientPseudonym != null}">
Betreffend Patienten-Pseudonym <span class="monospace" th:text="${patientPseudonym}">***</span>
<a class="btn btn-blue" th:href="@{/}">Alle anzeigen</a>
</h2>
<h2 th:if="not ${null == query || query.isBlank()}">
Für die Suche nach „<span class="monospace" th:text="${query}">***</span>“
<a class="btn btn-blue" th:href="@{/}">Alle anzeigen</a>
</h2>
</div>
<div class="border" th:if="${requests.totalElements == 0}">
<div class="notification info">Noch keine Anfragen eingegangen</div>
</div>
<div th:if="${requests.totalElements > 0}">
<div class="paged">
<div class="card" th:each="request : ${requests}">
<div th:if="${request.status.value.contains('success')}" class="card-header bg-green">Erfolgreiche Übertragung</div>
<div th:if="${request.status.value.contains('warning')}" class="card-header bg-yellow">Übertragung mit Warnungen</div>
<div th:if="${request.status.value.contains('error')}" class="card-header bg-red">Übertragung mit Fehlern</div>
<div th:if="${request.status.value == 'unknown' and not request.isPendingUnknown()}" class="card-header bg-gray">Unbekannter Status</div>
<div th:if="${request.status.value == 'unknown' and request.isPendingUnknown()}" class="card-header bg-gray">⏰ Unbekannter Status ⏰</div>
<div th:if="${request.status.value == 'duplication'}" class="card-header bg-gray">Gestoppt: Duplikation</div>
<div th:if="${request.status.value == 'no-consent'}" class="card-header bg-blue">Gestoppt: Kein Consent</div>
<div th:if="${request.status.value == 'blocked-initial'}" class="card-header bg-blue">Gestoppt: Noch keine Meldebestätigung für vorhergehende Meldung</div>
<div class="card-sub-header" th:classappend="${request.type.value == 'delete' ? 'delete' : ''}">
<div th:if="${request.type.value != 'delete'}">
<span th:if="${request.submissionType.value == 'initial'}"><span>📨 Übertragung vom </span><time th:datetime="${request.processedAt}">[[ ${request.processedAt} ]]</time></span>
<span th:if="${request.submissionType.value == 'addition'}"><span>🔄 Übertragung vom </span><time th:datetime="${request.processedAt}">[[ ${request.processedAt} ]]</time></span>
<span th:if="${request.submissionType.value == 'unknown'}"><span>❓ Übertragung vom </span><time th:datetime="${request.processedAt}">[[ ${request.processedAt} ]]</time></span>
</div>
<div th:if="${request.type.value == 'delete'}">
<span>🗑 Löschanfrage vom </span><time th:datetime="${request.processedAt}">[[ ${request.processedAt} ]]</time>
</div>
<div th:insert="~{fragments :: accept-initial}" sec:authorize="hasRole('USER') or hasRole('ADMIN')" th:if="${postInitialSubmissionBlock}"></div>
</div>
<div class="card-content">
<div>Request-ID</div>
<div th:if="not ${request.report}"><span>[[ ${request.uuid} ]]</span></div>
<div th:if="${request.report}">
<a th:href="@{/report/{id}(id=${request.uuid})}" sec:authorize="hasRole('USER') or hasRole('ADMIN')">[[ ${request.uuid} ]]</a>
<th:block sec:authorize="not (hasRole('USER') or hasRole('ADMIN'))">[[ ${request.uuid} ]]</th:block>
</div>
<div>Typ</div>
<div th:style="${request.type.value == 'delete'} ? 'color: red;'">
<span>
[[ ${request.type} ]]
<th:block th:if="${request.submissionType.value != 'unknown'}">([[ ${request.submissionType} ]])</th:block>
</span>
</div>
<div sec:authorize="hasRole('USER') or hasRole('ADMIN')">Letzte Aktualisierung</div>
<div sec:authorize="hasRole('USER') or hasRole('ADMIN')">
<time th:if="${request.updatedAt}" th:datetime="${request.updatedAt}">[[ ${request.updatedAt} ]]</time>
<span th:if="${request.updatedBy}"> durch [[ ${request.updatedBy} ]]</span>
</div>
<div sec:authorize="hasRole('USER') or hasRole('ADMIN')">Patienten-Pseudonym</div>
<div class="patient-id" th:if="${patientPseudonym != null}" sec:authorize="hasRole('USER') or hasRole('ADMIN')">
[[ ${request.patientPseudonym} ]]
</div>
<div class="patient-id" th:if="${patientPseudonym == null}" sec:authorize="hasRole('USER') or hasRole('ADMIN')">
<a th:href="@{/patient/{pid}(pid=${request.patientPseudonym})}">[[ ${request.patientPseudonym} ]]</a>
</div>
<div sec:authorize="hasRole('USER') or hasRole('ADMIN')">TAN</div>
<div class="patient-id" sec:authorize="hasRole('USER') or hasRole('ADMIN')">
[[ ${request.tan} ]]
</div>
</div>
</div>
</div>
<div th:if="${patientPseudonym == null && query == null}" class="page-control">
<a id="first-page-link" th:href="@{/(page=${0})}" title="Zum Anfang: Taste W" th:if="${not requests.isFirst()}">⇤</a><a th:if="${requests.isFirst()}">⇤</a>
<a id="prev-page-link" th:href="@{/(page=${requests.getNumber() - 1})}" title="Seite zurück: Taste A" th:if="${not requests.isFirst()}">←</a><a th:if="${requests.isFirst()}">←</a>
<span>Seite [[ ${requests.getNumber() + 1} ]] von [[ ${requests.getTotalPages()} ]]</span>
<a id="next-page-link" th:href="@{/(page=${requests.getNumber() + 1})}" title="Seite vor: Taste D" th:if="${not requests.isLast()}">→</a><a th:if="${requests.isLast()}">→</a>
<a id="last-page-link" th:href="@{/(page=${requests.getTotalPages() - 1})}" title="Zum Ende: Taste S" th:if="${not requests.isLast()}">⇥</a><a th:if="${requests.isLast()}">⇥</a>
</div>
<div th:if="${patientPseudonym == null && query != null}" class="page-control">
<a id="first-page-link" th:href="@{/(q=${query},page=${0})}" title="Zum Anfang: Taste W" th:if="${not requests.isFirst()}">⇤</a><a th:if="${requests.isFirst()}">⇤</a>
<a id="prev-page-link" th:href="@{/(q=${query},page=${requests.getNumber() - 1})}" title="Seite zurück: Taste A" th:if="${not requests.isFirst()}">←</a><a th:if="${requests.isFirst()}">←</a>
<span>Seite [[ ${requests.getNumber() + 1} ]] von [[ ${requests.getTotalPages()} ]]</span>
<a id="next-page-link" th:href="@{/(q=${query},page=${requests.getNumber() + 1})}" title="Seite vor: Taste D" th:if="${not requests.isLast()}">→</a><a th:if="${requests.isLast()}">→</a>
<a id="last-page-link" th:href="@{/(q=${query},page=${requests.getTotalPages() - 1})}" title="Zum Ende: Taste S" th:if="${not requests.isLast()}">⇥</a><a th:if="${requests.isLast()}">⇥</a>
</div>
<div th:if="${patientPseudonym != null}" class="page-control">
<a id="first-page-link" th:href="@{/patient/{patientPseudonym}(patientPseudonym=${patientPseudonym},page=${0})}" title="Zum Anfang: Taste W" th:if="${not requests.isFirst()}">⇤</a><a th:if="${requests.isFirst()}">⇤</a>
<a id="prev-page-link" th:href="@{/patient/{patientPseudonym}(patientPseudonym=${patientPseudonym},page=${requests.getNumber() - 1})}" title="Seite zurück: Taste A" th:if="${not requests.isFirst()}">←</a><a th:if="${requests.isFirst()}">←</a>
<span>Seite [[ ${requests.getNumber() + 1} ]] von [[ ${requests.getTotalPages()} ]]</span>
<a id="next-page-link" th:href="@{/patient/{patientPseudonym}(patientPseudonym=${patientPseudonym},page=${requests.getNumber() + 1})}" title="Seite vor: Taste D" th:if="${not requests.isLast()}">→</a><a th:if="${requests.isLast()}">→</a>
<a id="last-page-link" th:href="@{/patient/{patientPseudonym}(patientPseudonym=${patientPseudonym},page=${requests.getTotalPages() - 1})}" title="Zum Ende: Taste S" th:if="${not requests.isLast()}">⇥</a><a th:if="${requests.isLast()}">⇥</a>
</div>
</div>
</main>
<footer th:replace="~{fragments.html :: footer}"></footer>
<script th:src="@{/main.js}"></script>
<script>
window.addEventListener('load', () => {
let keyBindings = {
'w': 'first-page-link',
'a': 'prev-page-link',
'd': 'next-page-link',
's': 'last-page-link'
};
window.onkeydown = (event) => {
if (document.activeElement.id !== 'search-input') {
for (const [key, elemId] of Object.entries(keyBindings)) {
if (event.key === key && document.getElementById(elemId)) {
document.getElementById(elemId).style.background = 'yellow';
document.getElementById(elemId).click();
}
}
}
};
});
window.onload = () => {
const eventSource = new EventSource('statistics/events');
eventSource.addEventListener('newrequest', event => {
console.log(event);
document.getElementById('reload-notify').style.display = 'inline';
});
}
</script>
</body>
</html>
|