Files
cloud-ip-validator/internal/dashboard/templates/sites.html
T

47 lines
1.4 KiB
HTML
Raw Normal View History

2026-08-23 20:39:22 +03:00
{{define "sites_page"}}
<!doctype html>
<html lang="ru">
<head>{{template "html_head" .}}</head>
<body>
{{template "page_header" .}}
<main>
<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"}}
<table role="grid">
<thead><tr><th>Слот</th><th>site_id</th><th>Действия</th></tr></thead>
<tbody>
{{range .Items}}
<tr>
<td>{{.Index}}</td>
<td>
<form hx-put="/sites/{{.Index}}" hx-target="#sites-table-wrap" hx-swap="innerHTML" style="display:flex;gap:.5rem;margin:0">
<input type="text" name="site_id" value="{{.SiteID}}" style="margin:0" required>
<button type="submit" class="secondary" style="margin:0">Сохранить</button>
</form>
</td>
<td class="actions-cell">
{{if .SiteID}}
<button class="contrast" hx-delete="/sites/{{.Index}}" hx-target="#sites-table-wrap" hx-swap="innerHTML" hx-confirm="Освободить слот {{.Index}}?">Очистить</button>
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}