init
This commit is contained in:
61
internal/app/web/templates/access.html
Normal file
61
internal/app/web/templates/access.html
Normal file
@@ -0,0 +1,61 @@
|
||||
{{define "access.html"}}
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
{{template "partials_head" .}}
|
||||
<body>
|
||||
{{template "partials_nav" .}}
|
||||
<main class="page">
|
||||
<h1>Access</h1>
|
||||
{{template "partials_flash" .}}
|
||||
|
||||
<section class="card">
|
||||
<h2>Grant</h2>
|
||||
<form method="post" action="{{abs "/access"}}">
|
||||
<input type="hidden" name="csrf" value="{{.CSRF}}">
|
||||
<input type="hidden" name="action" value="grant">
|
||||
<div class="grid">
|
||||
<div>
|
||||
<label>User</label>
|
||||
<select name="username" required>
|
||||
{{range .Users}}<option value="{{.Username}}">{{.Username}}</option>{{end}}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label>Topic / Pattern</label>
|
||||
<input name="topic" placeholder="alerts_* oder mytopic" required>
|
||||
</div>
|
||||
<div>
|
||||
<label>Permission</label>
|
||||
<select name="perm" required>
|
||||
<option value="read-write">read-write</option>
|
||||
<option value="read-only">read-only</option>
|
||||
<option value="write-only">write-only</option>
|
||||
<option value="deny">deny</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn" type="submit">Setzen</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Reset</h2>
|
||||
<form method="post" action="{{abs "/access"}}" onsubmit="return confirm('Access wirklich resetten?')">
|
||||
<input type="hidden" name="csrf" value="{{.CSRF}}">
|
||||
<input type="hidden" name="action" value="reset">
|
||||
<label>User</label>
|
||||
<select name="username" required>
|
||||
{{range .Users}}<option value="{{.Username}}">{{.Username}}</option>{{end}}
|
||||
</select>
|
||||
<button class="btn btn-danger" type="submit">Reset</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<div class="hint">
|
||||
Hinweis: Access-Kontrolle basiert auf <code>ntfy access</code> und benötigt eine korrekt konfigurierte <code>auth-file</code> im <code>server.yml</code>.
|
||||
</div>
|
||||
</main>
|
||||
{{template "partials_footer" .}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user