50 lines
1.5 KiB
HTML
50 lines
1.5 KiB
HTML
{{define "sites_page"}}
|
|
<!doctype html>
|
|
<html lang="ru">
|
|
<head>{{template "html_head" .}}</head>
|
|
<body>
|
|
{{template "page_header" .}}
|
|
<main class="container-fluid py-3">
|
|
<div id="error-banner">{{template "banner_inner" .Banner}}</div>
|
|
{{template "sites_content" .}}
|
|
</main>
|
|
</body>
|
|
</html>
|
|
{{end}}
|
|
|
|
{{define "sites_content"}}
|
|
<h1>Площадки</h1>
|
|
<p class="muted">Ровно три слота (1, 2, 3) — жёсткое ограничение схемы БД control-api.
|
|
Пустой слот — площадка не используется, входящие проверки для неё не ожидаются.</p>
|
|
|
|
<div id="sites-table-wrap">
|
|
{{template "sites_table" .}}
|
|
</div>
|
|
{{end}}
|
|
|
|
{{define "sites_table"}}
|
|
<div class="table-responsive">
|
|
<table class="table table-sm table-striped align-middle">
|
|
<thead><tr><th>Слот</th><th>site_id</th><th>Действия</th></tr></thead>
|
|
<tbody>
|
|
{{range .Items}}
|
|
<tr>
|
|
<td>{{.Index}}</td>
|
|
<td>
|
|
<form class="inline-form" hx-put="/sites/{{.Index}}" hx-target="#sites-table-wrap" hx-swap="innerHTML">
|
|
<input type="text" name="site_id" value="{{.SiteID}}" class="form-control form-control-sm" required>
|
|
<button type="submit" class="btn btn-sm btn-outline-secondary">Сохранить</button>
|
|
</form>
|
|
</td>
|
|
<td class="actions-cell">
|
|
{{if .SiteID}}
|
|
<button class="btn btn-sm btn-outline-danger" hx-delete="/sites/{{.Index}}" hx-target="#sites-table-wrap" hx-swap="innerHTML" hx-confirm="Освободить слот {{.Index}}?">Очистить</button>
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{end}}
|