UI fix
This commit is contained in:
1 parent
ee2a29cb36
commit
4f597505cc
30 files changed
+830
-305
No files matched your search
@@ -3,33 +3,41 @@
|
||||
<html lang="ru">
|
||||
<head>{{template "html_head" .}}</head>
|
||||
<body>
|
||||
{{template "page_header" .}}
|
||||
<main class="container-fluid py-3">
|
||||
<input type="checkbox" id="nav-toggle" class="nav-toggle">
|
||||
<div class="shell">
|
||||
{{template "sidebar_nav" .}}
|
||||
<div>
|
||||
{{template "topbar_mobile" .}}
|
||||
<main class="main">
|
||||
<div id="error-banner">{{template "banner_inner" .Banner}}</div>
|
||||
{{template "validators_content" .}}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
||||
{{define "validators_content"}}
|
||||
<h1>Валидаторы</h1>
|
||||
<div class="topbar"><h1>Валидаторы</h1></div>
|
||||
|
||||
<form class="card card-body mb-3 py-2" hx-post="/validators" hx-target="#validators-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-4">
|
||||
<label class="form-label mb-1">validator_id</label>
|
||||
<input type="text" name="validator_id" class="form-control form-control-sm" required>
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
<form hx-post="/validators" hx-target="#validators-table-wrap" hx-swap="innerHTML" hx-on::after-request="this.reset()">
|
||||
<div class="field-row">
|
||||
<div class="field">
|
||||
<label>validator_id</label>
|
||||
<input type="text" name="validator_id" required>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label class="form-label mb-1">os_port_id</label>
|
||||
<input type="text" name="os_port_id" class="form-control form-control-sm" placeholder="Neutron port ID">
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<button type="submit" class="btn btn-sm btn-primary w-100">Добавить</button>
|
||||
<div class="field">
|
||||
<label>os_port_id</label>
|
||||
<input type="text" name="os_port_id" placeholder="Neutron port ID">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Добавить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="validators-table-wrap">
|
||||
{{template "validators_table" .}}
|
||||
@@ -37,28 +45,32 @@
|
||||
{{end}}
|
||||
|
||||
{{define "validators_table"}}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-striped align-middle">
|
||||
<thead><tr><th>ID</th><th>OS Port ID</th><th>Состояние</th><th>Действия</th></tr></thead>
|
||||
<div class="panel">
|
||||
<div class="table-scroll">
|
||||
<table>
|
||||
<thead><tr><th>ID</th><th>OS Port ID</th><th>Состояние</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{{range .Items}}
|
||||
{{$b := validatorBadge .State}}
|
||||
<tr>
|
||||
<td>{{.ValidatorID}}</td>
|
||||
<td>
|
||||
<td class="mono" data-label="ID">{{.ValidatorID}}</td>
|
||||
<td data-label="OS Port ID">
|
||||
<form class="inline-form" hx-put="/validators/{{.ValidatorID}}" hx-target="#validators-table-wrap" hx-swap="innerHTML">
|
||||
<input type="text" name="os_port_id" value="{{.OSPortID}}" class="form-control form-control-sm">
|
||||
<button type="submit" class="btn btn-sm btn-outline-secondary">Сохранить</button>
|
||||
<input type="text" name="os_port_id" value="{{.OSPortID}}">
|
||||
<button type="submit" class="btn btn-ghost btn-sm">Сохранить</button>
|
||||
</form>
|
||||
</td>
|
||||
<td><span class="{{$b.Class}}">{{$b.Label}}</span></td>
|
||||
<td class="actions-cell">
|
||||
<button class="btn btn-sm btn-outline-danger" hx-delete="/validators/{{.ValidatorID}}" hx-target="#validators-table-wrap" hx-swap="innerHTML" hx-confirm="Удалить валидатор {{.ValidatorID}}?">Удалить</button>
|
||||
<td data-label="Состояние"><span class="pill {{$b.Class}}">{{$b.Label}}</span></td>
|
||||
<td data-label="">
|
||||
<div class="actions">
|
||||
<button class="btn btn-danger-ghost btn-sm" hx-delete="/validators/{{.ValidatorID}}" hx-target="#validators-table-wrap" hx-swap="innerHTML" hx-confirm="Удалить валидатор {{.ValidatorID}}?">Удалить</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{{if not .Items}}<p class="muted">Валидаторов нет.</p>{{end}}
|
||||
{{end}}
|
||||
Reference in new issue
Block a user