Web UI: setup wizard, auth pages, library browsing, player, admin, streaming, cover art
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
{{define "admin_users"}}{{template "header" .}}
|
||||
<div class="card mb-4" style="max-width: 500px;">
|
||||
<div class="card-body">
|
||||
<h2 class="h6">Add user</h2>
|
||||
<form method="post" action="/admin/users">
|
||||
{{template "csrf_field" .CSRFToken}}
|
||||
<div class="row g-2">
|
||||
<div class="col-6"><input type="text" name="username" class="form-control form-control-sm" placeholder="Username" required></div>
|
||||
<div class="col-6"><input type="password" name="password" class="form-control form-control-sm" placeholder="Password" minlength="8" required></div>
|
||||
</div>
|
||||
<div class="form-check mt-2">
|
||||
<input class="form-check-input" type="checkbox" name="is_admin" id="is_admin" value="1">
|
||||
<label class="form-check-label small" for="is_admin">Administrator</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-sm mt-2">Add user</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table vs-table table-sm">
|
||||
<thead><tr><th>Username</th><th>Email</th><th>Role</th><th>Status</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{{range .Data}}
|
||||
<tr>
|
||||
<td>{{.Username}}{{if .ExternalAuth}} <span class="badge text-bg-secondary">external</span>{{end}}</td>
|
||||
<td class="text-secondary">{{.Email}}</td>
|
||||
<td>{{if .IsAdmin}}Admin{{else}}User{{end}}</td>
|
||||
<td>{{if .Disabled}}<span class="text-danger">Disabled</span>{{else}}<span class="text-success">Active</span>{{end}}</td>
|
||||
<td class="text-end">
|
||||
<form method="post" action="/admin/users/{{.ID}}/toggle-disabled" class="d-inline">
|
||||
{{template "csrf_field" $.CSRFToken}}
|
||||
<button type="submit" class="btn btn-sm btn-outline-secondary">{{if .Disabled}}Enable{{else}}Disable{{end}}</button>
|
||||
</form>
|
||||
<form method="post" action="/admin/users/{{.ID}}/delete" class="d-inline" onsubmit="return confirm('Delete this user?');">
|
||||
{{template "csrf_field" $.CSRFToken}}
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{template "footer" .}}{{end}}
|
||||
Reference in New Issue
Block a user