Files
uncensored-send/web/templates/admin.html
T

79 lines
2.7 KiB
HTML

{{define "content"}}
<section class="card">
<h1>Administration</h1>
<dl class="stats">
<dt>Files</dt><dd>{{.Count}}{{if .Anonymous}} <em>({{.Anonymous}} anonymous)</em>{{end}}</dd>
<dt>Stored</dt><dd>{{.Total}}{{if .Quota}} of {{.Quota}} ({{.QuotaPct}}%){{end}}</dd>
{{if .FreeDisk}}<dt>Free disk</dt><dd>{{.FreeDisk}}</dd>{{end}}
</dl>
</section>
<section class="card">
<h2>Files</h2>
{{if not .Objects}}
<p class="hint">Nothing stored right now.</p>
{{else}}
<table class="admin files">
<thead>
<tr>
<th><a href="?sort=name">File</a></th>
<th class="num"><a href="?sort=size">Size</a></th>
<th><a href="?sort=owner">Owner</a></th>
<th><a href="?sort=created">Uploaded</a></th>
<th><a href="?sort=expires">Expires</a></th>
<th><span class="visually-hidden">Actions</span></th>
</tr>
</thead>
<tbody>
{{range .Objects}}
<tr>
<td data-label="File" class="filecell">
<a href="{{$.Base}}i/{{.ID}}">{{.Filename}}</a>
<span class="id mono">{{.ID}}{{if .Vanity}} <em title="custom name">★</em>{{end}}</span>
</td>
<td data-label="Size" class="num nowrap">{{.Size}}</td>
<td data-label="Owner">{{if .Owner}}{{.Owner}}{{else}}<em>anonymous</em>{{end}}</td>
<td data-label="Uploaded" class="nowrap" title="{{.Created}}">{{.CreatedAgo}}</td>
<td data-label="Expires" class="nowrap" title="{{.Expires}}">{{.ExpiresIn}}</td>
<td class="actions-cell">
<form method="post" action="{{$.Base}}api/d/{{.ID}}/delete">
<input type="hidden" name="from" value="admin">
<button type="submit" class="danger small"
data-confirm="Delete {{.Filename}}? This cannot be undone.">Delete</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
</section>
<section class="card">
<h2>Tokens</h2>
<p class="hint">
Tokens are minted, rotated and revoked with <code>./send token</code> on the
server. They are deliberately not manageable from here: nothing that hands
out credentials should be reachable over the network.
</p>
{{if .Tokens}}
<table class="admin">
<thead>
<tr><th>Name</th><th>Max size</th><th>Max lifetime</th><th>Vanity</th><th>Admin</th></tr>
</thead>
<tbody>
{{range .Tokens}}
<tr>
<td data-label="Name">{{.Name}}</td>
<td data-label="Max size" class="nowrap">{{.MaxSize}}</td>
<td data-label="Max lifetime" class="nowrap">{{.MaxExpiry}}</td>
<td data-label="Vanity">{{if .Vanity}}yes{{else}}no{{end}}</td>
<td data-label="Admin">{{if .Admin}}yes{{else}}no{{end}}</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
</section>
{{end}}