use bootstrap 5 for UI, compact UI
This commit is contained in:
1 parent
37910e410b
commit
ee2a29cb36
18 files changed
+284
-161
No files matched your search
@@ -4,7 +4,7 @@
|
||||
<head>{{template "html_head" .}}</head>
|
||||
<body>
|
||||
{{template "page_header" .}}
|
||||
<main>
|
||||
<main class="container-fluid py-3">
|
||||
<div id="error-banner">{{template "banner_inner" .Banner}}</div>
|
||||
{{template "targets_content" .}}
|
||||
</main>
|
||||
@@ -16,12 +16,20 @@
|
||||
<h1>Цели проверки</h1>
|
||||
<p class="muted">Группа целей — именованный список URL/адресов, на который затем ссылаются типы проверок.</p>
|
||||
|
||||
<form hx-post="/targets" hx-target="#targets-table-wrap" hx-swap="innerHTML" hx-on::after-request="this.reset()">
|
||||
<label for="target-name">Имя новой группы</label>
|
||||
<input id="target-name" type="text" name="name" placeholder="web" required>
|
||||
<label for="target-list">Цели (по одной на строку или через запятую)</label>
|
||||
<textarea id="target-list" name="targets" rows="2" placeholder="https://hub.docker.com https://github.com" required></textarea>
|
||||
<button type="submit">Создать группу</button>
|
||||
<form class="card card-body mb-3 py-2" hx-post="/targets" hx-target="#targets-table-wrap" hx-swap="innerHTML" hx-on::after-request="this.reset()">
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-12 col-md-3">
|
||||
<label class="form-label mb-1">Имя новой группы</label>
|
||||
<input type="text" name="name" class="form-control form-control-sm" placeholder="web" required>
|
||||
</div>
|
||||
<div class="col-12 col-md-7">
|
||||
<label class="form-label mb-1">Цели (по одной на строку или через запятую)</label>
|
||||
<textarea name="targets" class="form-control form-control-sm" rows="2" placeholder="https://hub.docker.com https://github.com" required></textarea>
|
||||
</div>
|
||||
<div class="col-12 col-md-2">
|
||||
<button type="submit" class="btn btn-sm btn-primary w-100">Создать</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="targets-table-wrap">
|
||||
@@ -30,24 +38,26 @@
|
||||
{{end}}
|
||||
|
||||
{{define "targets_table"}}
|
||||
<table role="grid">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-striped align-middle">
|
||||
<thead><tr><th>Группа</th><th>Цели</th><th>Действия</th></tr></thead>
|
||||
<tbody>
|
||||
{{range .Items}}
|
||||
<tr>
|
||||
<td>{{.Name}}</td>
|
||||
<td class="text-nowrap">{{.Name}}</td>
|
||||
<td>
|
||||
<form hx-put="/targets/{{.Name}}" hx-target="#targets-table-wrap" hx-swap="innerHTML" style="display:flex;gap:.5rem;margin:0">
|
||||
<textarea name="targets" rows="2" style="margin:0">{{join .Targets "\n"}}</textarea>
|
||||
<button type="submit" class="secondary" style="margin:0">Сохранить</button>
|
||||
<form class="inline-form" hx-put="/targets/{{.Name}}" hx-target="#targets-table-wrap" hx-swap="innerHTML">
|
||||
<textarea name="targets" class="form-control form-control-sm" rows="2">{{join .Targets "\n"}}</textarea>
|
||||
<button type="submit" class="btn btn-sm btn-outline-secondary text-nowrap">Сохранить</button>
|
||||
</form>
|
||||
</td>
|
||||
<td class="actions-cell">
|
||||
<button class="contrast" hx-delete="/targets/{{.Name}}" hx-target="#targets-table-wrap" hx-swap="innerHTML" hx-confirm="Удалить группу {{.Name}}?">Удалить</button>
|
||||
<button class="btn btn-sm btn-outline-danger" hx-delete="/targets/{{.Name}}" hx-target="#targets-table-wrap" hx-swap="innerHTML" hx-confirm="Удалить группу {{.Name}}?">Удалить</button>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{if not .Items}}<p class="muted">Групп целей нет.</p>{{end}}
|
||||
{{end}}
|
||||
Reference in new issue
Block a user