diff options
| author | Paul-Christian Volkmer | 2024-01-18 14:13:15 +0100 |
|---|---|---|
| committer | Paul-Christian Volkmer | 2024-01-18 14:13:15 +0100 |
| commit | 30cf0fd22e492fd2b0052ddfd5b808da51b36052 (patch) | |
| tree | 5745f1a2be493e9149cc986833d904bd62e01bfc /src/main/resources/templates | |
| parent | 531a8589db2bf170e6272602ccb4a3c4457186d8 (diff) | |
feat #29: add initial support for mtbfile api tokens
Diffstat (limited to 'src/main/resources/templates')
| -rw-r--r-- | src/main/resources/templates/configs.html | 4 | ||||
| -rw-r--r-- | src/main/resources/templates/configs/tokens.html | 39 | ||||
| -rw-r--r-- | src/main/resources/templates/login.html | 2 |
3 files changed, 44 insertions, 1 deletions
diff --git a/src/main/resources/templates/configs.html b/src/main/resources/templates/configs.html index 3c3d744..ebef7ca 100644 --- a/src/main/resources/templates/configs.html +++ b/src/main/resources/templates/configs.html @@ -37,6 +37,9 @@ </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> @@ -86,6 +89,7 @@ </th:block> </section> </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> </body> diff --git a/src/main/resources/templates/configs/tokens.html b/src/main/resources/templates/configs/tokens.html new file mode 100644 index 0000000..e707fbf --- /dev/null +++ b/src/main/resources/templates/configs/tokens.html @@ -0,0 +1,39 @@ +<div th:if="${not tokensEnabled}"> + <h2><span>⛔</span> Tokens</h2> + <p>Die Verwendung von Tokens ist nicht aktiviert.</p> +</div> + +<div id="tokens" th:if="${tokensEnabled}"> + <h2><span>✅</span> Tokens</h2> + <div class="border"> + <div th:if="${tokens.isEmpty()}">Noch keine Tokens vorhanden.</div> + <table th:if="${not tokens.isEmpty()}"> + <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> + </tr> + </tbody> + </table> + <div th:if="${newTokenValue != null and success}" class="new-token"> + Verwendung über HTTP-Basic. Bitte notieren, wird nicht erneut angezeigt: <pre>[[ ${newTokenValue} ]]</pre> + </div> + <div th:if="${success != null and not success}" class="no-token"> + Das Token konnte nicht erzeugt werden. Versuchen Sie einen anderen Namen. + </div> + <div class="token-form"> + <form th:hx-post="@{/configs/tokens}" hx-target="#tokens"> + <input placeholder="Token-Name" name="name" required /> + <button>Token Erstellen</button> + </form> + </div> + </div> +</div>
\ No newline at end of file diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html index 018122d..9a63b46 100644 --- a/src/main/resources/templates/login.html +++ b/src/main/resources/templates/login.html @@ -15,7 +15,7 @@ <form method="post" th:action="@{/login}"> <input type="text" id="username" name="username" class="form-control" placeholder="Username" required="" autofocus=""> <input type="password" id="password" name="password" class="form-control" placeholder="Password" required=""> - <button class="" type="submit">Anmelden</button> + <button type="submit">Anmelden</button> </form> </div> </main> |
