57 lines
2.6 KiB
HTML
57 lines
2.6 KiB
HTML
{{define "page_admin_configs"}}
|
|
{{template "admin_shell_open" dict "Active" .Active "Admin" .Admin "Title" "Конфигурации"}}
|
|
{{template "admin_flash" .}}
|
|
|
|
<div class="card">
|
|
<div class="card-header"><h2><i class="fa-solid fa-filter"></i> Фильтр</h2></div>
|
|
<form method="get" action="{{appURL "admin/configs"}}" class="d-flex flex-wrap gap-2 align-items-end">
|
|
<div>
|
|
<label class="form-label">ID ссылки</label>
|
|
<input class="form-control input-inline" type="number" name="link_id" value="{{if .LinkIDFilter}}{{.LinkIDFilter}}{{end}}">
|
|
</div>
|
|
<div>
|
|
<label class="form-label">ID сервера</label>
|
|
<input class="form-control input-inline" type="number" name="server_id" value="{{if .ServerIDFilter}}{{.ServerIDFilter}}{{end}}">
|
|
</div>
|
|
<button type="submit" class="btn btn-ghost"><i class="fa-solid fa-magnifying-glass"></i> Показать</button>
|
|
<a class="btn btn-ghost" href="{{appURL "admin/configs"}}">Сбросить</a>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header"><h2><i class="fa-solid fa-key"></i> Конфигурации ({{len .Rows}}{{if .Truncated}}+{{end}})</h2></div>
|
|
{{if .Truncated}}<p class="hint">Показаны не все записи — сузьте фильтр по ссылке или серверу.</p>{{end}}
|
|
{{if not .Rows}}
|
|
<p class="hint">Ничего не найдено.</p>
|
|
{{else}}
|
|
<div class="tbl-wrap">
|
|
<table class="table table-sm mb-0">
|
|
<thead><tr><th>ID</th><th>Ссылка</th><th>Сервер</th><th>Протокол</th><th>Имя</th><th>Создана</th><th></th></tr></thead>
|
|
<tbody>
|
|
{{range .Rows}}
|
|
<tr>
|
|
<td>#{{.ID}}</td>
|
|
<td><a href="{{appURL "admin/links"}}?id={{.LinkID}}" class="mono">#{{.LinkID}}</a></td>
|
|
<td>{{.ServerID}}</td>
|
|
<td>{{.Protocol}}</td>
|
|
<td class="mono">{{.ConnectionName}}</td>
|
|
<td class="sl-muted">{{.CreatedAt.Format "2006-01-02 15:04"}}</td>
|
|
<td>
|
|
<form method="post" action="{{appURL "admin/configs"}}" onsubmit="return confirm('Удалить конфигурацию #{{.ID}}?');">
|
|
{{template "admin_csrf_field"}}
|
|
<input type="hidden" name="action" value="delete_creation">
|
|
<input type="hidden" name="link_id" value="{{.LinkID}}">
|
|
<input type="hidden" name="creation_id" value="{{.ID}}">
|
|
<button type="submit" class="btn btn-sm btn-danger"><i class="fa-solid fa-trash"></i></button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{template "admin_shell_close" .}}
|
|
{{end}}
|