29 lines
1.3 KiB
HTML
29 lines
1.3 KiB
HTML
{{define "admin_scanner"}}{{template "header" .}}
|
|
<table class="table vs-table table-sm">
|
|
<thead><tr><th>Folder</th><th>Status</th><th>Seen</th><th>Added</th><th>Updated</th><th>Removed</th><th>Last full scan</th><th></th></tr></thead>
|
|
<tbody>
|
|
{{range .Data}}
|
|
<tr>
|
|
<td>{{.Folder.Name}}</td>
|
|
<td>
|
|
{{if eq .State.Status "scanning"}}<span class="text-primary"><i class="bi bi-arrow-repeat"></i> Scanning…</span>
|
|
{{else if eq .State.Status "error"}}<span class="text-danger" title="{{.State.ErrorMessage}}"><i class="bi bi-exclamation-triangle"></i> Error</span>
|
|
{{else}}<span class="text-success">Idle</span>{{end}}
|
|
</td>
|
|
<td>{{.State.FilesSeen}}</td>
|
|
<td>{{.State.FilesAdded}}</td>
|
|
<td>{{.State.FilesUpdated}}</td>
|
|
<td>{{.State.FilesRemoved}}</td>
|
|
<td class="text-secondary small">{{if .State.LastFullScanAt.Valid}}{{.State.LastFullScanAt.String}}{{else}}never{{end}}</td>
|
|
<td class="text-end">
|
|
<form method="post" action="/admin/folders/{{.Folder.ID}}/scan">
|
|
{{template "csrf_field" $.CSRFToken}}
|
|
<button type="submit" class="btn btn-sm btn-outline-primary" {{if eq .State.Status "scanning"}}disabled{{end}}>Scan now</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{template "footer" .}}{{end}}
|