diff options
| author | Paul-Christian Volkmer | 2024-01-15 10:15:36 +0100 |
|---|---|---|
| committer | GitHub | 2024-01-15 10:15:36 +0100 |
| commit | 4bc69a353c5bc758de4979120f611875eb0051de (patch) | |
| tree | 13c3edeaad9608b7fc2da2a8796a2873867cd396 /src/main/resources | |
| parent | a1a252d5a95dc161523d1a6740f8439858789a59 (diff) | |
| parent | 9d30f750f722ae460cd1fe5ee8376c8dc44714bb (diff) | |
Merge pull request #26 from CCC-MF/issue_23
feat #23: add reload button to display on new request
Diffstat (limited to 'src/main/resources')
| -rw-r--r-- | src/main/resources/static/style.css | 15 | ||||
| -rw-r--r-- | src/main/resources/templates/index.html | 8 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index fee5d4c..e2bf65a 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -520,4 +520,19 @@ input.inline:focus-visible { .notification.error { color: var(--bg-red); +} + +a.reload { + display: none; + position: absolute; + height: 1.2em; + width: 1.2em; + background: var(--bg-red); + border-radius: 50%; + + color: white; + text-decoration: none; + font-size: .6em; + align-content: center; + justify-content: center; }
\ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index b1c3142..c039b33 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -9,7 +9,7 @@ <div th:replace="~{fragments.html :: nav}"></div> <main> - <h1>Letzte Anfragen</h1> + <h1>Letzte Anfragen<a id="reload-notify" class="reload" title="Neue Anfragen" th:href="@{/}">⟳</a></h1> <div class="border"> <div class="page-control"> @@ -68,6 +68,12 @@ } }; }); + + const eventSource = new EventSource('statistics/events'); + eventSource.addEventListener('newrequest', event => { + console.log(event); + document.getElementById('reload-notify').style.display = 'inline-flex'; + }); </script> </body> </html>
\ No newline at end of file |
