diff options
| author | Paul-Christian Volkmer | 2024-03-05 10:27:27 +0100 |
|---|---|---|
| committer | GitHub | 2024-03-05 10:27:27 +0100 |
| commit | 69d796dab46cf17069057ed2177174200039135e (patch) | |
| tree | 60369bf8c4cd718fc127a1aa31e7edfffb7a3ab9 /src | |
| parent | b1a83510a67496b1d3a6874e345f292815995468 (diff) | |
| parent | 4bfe7dc69861c47b752f1f6d415f504d5518a03d (diff) | |
Merge pull request #52 from CCC-MF/issue_51
Darstellung und Aufteilung der Konfigurationsseite verbessern
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/resources/static/style.css | 39 | ||||
| -rw-r--r-- | src/main/resources/templates/configs.html | 165 | ||||
| -rw-r--r-- | src/main/resources/templates/configs/tokens.html | 9 | ||||
| -rw-r--r-- | src/main/resources/templates/configs/userroles.html | 5 |
4 files changed, 138 insertions, 80 deletions
diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index 82b4d19..1dd68ed 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -257,6 +257,10 @@ form.samplecode-input input:focus-visible { display: block; } +.userrole-form { + display: inline-block; +} + .userrole-form form { margin: 0; padding: 0; @@ -321,6 +325,15 @@ table { font-family: sans-serif; } +table.config-table td:first-child { + width: 24em; + min-width: fit-content; +} + +table.config-table td > button:last-of-type { + float: right; +} + .border > table { padding: 0; border: none; @@ -618,6 +631,32 @@ input.inline:focus-visible { color: var(--bg-red); } +.tab { + padding: 1em; + border: none; + border-radius: 3px 3px 0 0; + cursor: pointer; + transition: all 0.2s; + + font-weight: bold; +} + +.tab:hover, +.tab.active { + background: var(--table-border); +} + +.tabcontent { + border: 1px solid var(--table-border); + border-radius: 0 .5em .5em .5em; + display: none; + padding: 1em; +} + +.tabcontent.active { + display: block; +} + a.reload { display: none; position: absolute; diff --git a/src/main/resources/templates/configs.html b/src/main/resources/templates/configs.html index 2103b0b..1ac4a26 100644 --- a/src/main/resources/templates/configs.html +++ b/src/main/resources/templates/configs.html @@ -10,90 +10,111 @@ <main> <h1>Konfiguration</h1> - <section> - <h2>🔧 Allgemeine Konfiguration</h2> - <table> - <thead> - <tr> - <th>Name</th> - <th>Wert</th> - </tr> - </thead> - <tbody> - <tr> - <td>Pseudonym erzeugt über</td> - <td>[[ ${pseudonymGenerator} ]]</td> - </tr> - <tr> - <td>MTBFile-Sender</td> - <td>[[ ${mtbFileSender} ]]</td> - </tr> + <div class="tabs"> + <button class="tab active" onclick="selectTab(this, 'common');">Allgemeine Informationen</button> + <button class="tab" onclick="selectTab(this, 'security');">Sicherheit</button> + <button class="tab" onclick="selectTab(this, 'transformation');">Transformationen</button> + </div> + + <div id="common" class="tabcontent active"> + <section> + <h2>🔧 Allgemeine Konfiguration</h2> + <table class="config-table"> + <thead> <tr> - <td th:if="${mtbFileSender.startsWith('Rest')}">REST-Endpunkt</td> - <td th:if="${mtbFileSender.startsWith('Kafka')}">Kafka-Broker und Topics</td> - <td>[[ ${mtbFileEndpoint} ]]</td> + <th>Name</th> + <th>Wert</th> </tr> - </tbody> - </table> - </section> + </thead> + <tbody> + <tr> + <td>Pseudonym erzeugt über</td> + <td>[[ ${pseudonymGenerator} ]]</td> + </tr> + <tr> + <td>MTBFile-Sender</td> + <td>[[ ${mtbFileSender} ]]</td> + </tr> + <tr> + <td th:if="${mtbFileSender.startsWith('Rest')}">REST-Endpunkt</td> + <td th:if="${mtbFileSender.startsWith('Kafka')}">Kafka-Broker und Topics</td> + <td>[[ ${mtbFileEndpoint} ]]</td> + </tr> + </tbody> + </table> + </section> - <section th:insert="~{configs/tokens.html}"> - </section> + <section hx-ext="sse" th:sse-connect="@{/configs/events}"> + <div th:insert="~{configs/connectionAvailable.html}" th:hx-get="@{/configs?connectionAvailable}" hx-trigger="sse:connection-available"> + </div> + </section> + </div> - <section th:insert="~{configs/userroles.html}"> - </section> + <div id="security" class="tabcontent"> + <section th:insert="~{configs/tokens.html}"> + </section> - <section hx-ext="sse" th:sse-connect="@{/configs/events}"> - <div th:insert="~{configs/connectionAvailable.html}" th:hx-get="@{/configs?connectionAvailable}" hx-trigger="sse:connection-available"> - </div> - </section> + <section th:insert="~{configs/userroles.html}"> + </section> + </div> - <section> - <h2><span th:if="${not transformations.isEmpty()}">✅</span><span th:if="${transformations.isEmpty()}">⛔</span> Transformationen</h2> + <div id="transformation" class="tabcontent"> + <section> + <h2><span th:if="${not transformations.isEmpty()}">✅</span><span th:if="${transformations.isEmpty()}">⛔</span> Transformationen</h2> - <h3>Syntax</h3> - Hier einige Beispiele zum Syntax des JSON-Path - <ul> - <li style="padding: 0.6rem 0;"><span class="bg-path">diagnoses[*].icdO3T.version</span>: Ersetze die ICD-O3T-Version in allen Diagnosen, z.B. zur Version der deutschen Übersetzung</li> - <li style="padding: 0.6rem 0;"><span class="bg-path">patient.gender</span>: Ersetze das Geschlecht des Patienten, z.B. in das von bwHC verlangte Format</li> - </ul> + <h3>Syntax</h3> + Hier einige Beispiele zum Syntax des JSON-Path + <ul> + <li style="padding: 0.6rem 0;"><span class="bg-path">diagnoses[*].icdO3T.version</span>: Ersetze die ICD-O3T-Version in allen Diagnosen, z.B. zur Version der deutschen Übersetzung</li> + <li style="padding: 0.6rem 0;"><span class="bg-path">patient.gender</span>: Ersetze das Geschlecht des Patienten, z.B. in das von bwHC verlangte Format</li> + </ul> - <h3>Konfigurierte Transformationen</h3> - <th:block th:if="${transformations.isEmpty()}"> - <p> - Keine konfigurierten Transformationen. - </p> - </th:block> - <th:block th:if="${not transformations.isEmpty()}"> - <p> - Hier sehen Sie eine Übersicht der konfigurierten Transformationen. - </p> + <h3>Konfigurierte Transformationen</h3> + <th:block th:if="${transformations.isEmpty()}"> + <p> + Keine konfigurierten Transformationen. + </p> + </th:block> + <th:block th:if="${not transformations.isEmpty()}"> + <p> + Hier sehen Sie eine Übersicht der konfigurierten Transformationen. + </p> - <table> - <thead> - <tr> - <th>JSON-Path</th> - <th>Transformation von ⇒ nach</th> - </tr> - </thead> - <tbody> - <tr th:each="transformation : ${transformations}"> - <td> - <span class="bg-path" title="Ersetze Wert(e) an dieser Stelle im MTB-File">[[ ${transformation.path} ]]</span> - </td> - <td> - <span class="bg-from" title="Ersetze immer dann, wenn dieser Wert enthalten ist">[[ ${transformation.existingValue} ]]</span> - <strong>⇒</strong> - <span class="bg-to" title="Ersetze durch diesen Wert">[[ ${transformation.newValue} ]]</span> - </td> - </tr> - </tbody> - </table> - </th:block> - </section> + <table class="config-table"> + <thead> + <tr> + <th>JSON-Path</th> + <th>Transformation von ⇒ nach</th> + </tr> + </thead> + <tbody> + <tr th:each="transformation : ${transformations}"> + <td> + <span class="bg-path" title="Ersetze Wert(e) an dieser Stelle im MTB-File">[[ ${transformation.path} ]]</span> + </td> + <td> + <span class="bg-from" title="Ersetze immer dann, wenn dieser Wert enthalten ist">[[ ${transformation.existingValue} ]]</span> + <strong>⇒</strong> + <span class="bg-to" title="Ersetze durch diesen Wert">[[ ${transformation.newValue} ]]</span> + </td> + </tr> + </tbody> + </table> + </th:block> + </section> + </div> </main> <script th:src="@{/scripts.js}"></script> <script th:src="@{/webjars/htmx.org/dist/htmx.min.js}"></script> <script th:src="@{/webjars/htmx.org/dist/ext/sse.js}"></script> + <script> + function selectTab(self, elem) { + Array.from(document.getElementsByClassName('tab')).forEach(e => e.className = 'tab'); + self.className = 'tab active'; + + Array.from(document.getElementsByClassName('tabcontent')).forEach(e => e.className = 'tabcontent'); + document.getElementById(elem).className = 'tabcontent active'; + } + </script> </body> </html>
\ No newline at end of file diff --git a/src/main/resources/templates/configs/tokens.html b/src/main/resources/templates/configs/tokens.html index 15c70f0..0e245b0 100644 --- a/src/main/resources/templates/configs/tokens.html +++ b/src/main/resources/templates/configs/tokens.html @@ -7,19 +7,20 @@ <h2><span>✅</span> Tokens</h2> <div class="border"> <div th:if="${tokens.isEmpty()}">Noch keine Tokens vorhanden.</div> - <table th:if="${not tokens.isEmpty()}"> + <table th:if="${not tokens.isEmpty()}" class="config-table"> <thead> <tr> <th>Name</th> <th>Erstellt</th> - <th></th> </tr> </thead> <tbody> <tr th:each="token : ${tokens}"> <td>[[ ${token.name} ]]</td> - <td><time th:datetime="${token.createdAt}">[[ ${token.createdAt} ]]</time></td> - <td><button class="btn btn-red" th:hx-delete="@{/configs/tokens/{id}(id=${token.id})}" hx-target="#tokens">Löschen</button></td> + <td> + <time th:datetime="${token.createdAt}">[[ ${token.createdAt} ]]</time> + <button class="btn btn-red" th:hx-delete="@{/configs/tokens/{id}(id=${token.id})}" hx-target="#tokens">Löschen</button> + </td> </tr> </tbody> </table> diff --git a/src/main/resources/templates/configs/userroles.html b/src/main/resources/templates/configs/userroles.html index f5e4586..e5b9c6d 100644 --- a/src/main/resources/templates/configs/userroles.html +++ b/src/main/resources/templates/configs/userroles.html @@ -7,12 +7,11 @@ <h2><span>✅</span> Benutzerberechtigungen</h2> <div class="border"> <div th:if="${userRoles.isEmpty()}">Noch keine Benutzerberechtigungen vorhanden.</div> - <table th:if="${not userRoles.isEmpty()}"> + <table th:if="${not userRoles.isEmpty()}" class="config-table"> <thead> <tr> <th>Benutzername</th> <th>Rolle</th> - <th></th> </tr> </thead> <tbody> @@ -29,8 +28,6 @@ <button class="btn btn-blue" th:disabled="${#authorization.authentication.getName() == userRole.username}">Übernehmen</button> </form> </div> - </td> - <td> <button class="btn btn-red" th:hx-delete="@{/configs/userroles/{id}(id=${userRole.id})}" hx-target="#userroles" th:disabled="${#authorization.authentication.getName() == userRole.username}">Löschen</button> </td> </tr> |
