Files
bryanpedini 440f78ce9e
Test / test (push) Successful in 26m44s
Build and publish image / image (push) Successful in 27m27s
feat(ui): improve the records table, view state and record dialog
Sortable record columns, filters and sort kept in the URL on the zones,
zone and audit pages, a Show action that filters the records table to a
problem's owner, Save and add another, a highlight of the saved row, an
Audit history link on the zone page, and dialogs that keep typed input
on a backdrop click.
2026-11-22 17:36:46 +01:00

101 lines
3.9 KiB
HTML

{{- /* SPDX-License-Identifier: GPL-2.0-or-later */ -}}
{{- /* Copyright (C) 2026 Bryan Joshua Pedini */ -}}
{{define "title"}}{{.Zone}}{{end}}
{{define "content"}}<p class="crumbs"><a href="/">Zones</a></p>
<div class="page-head">
<h1 id="zone-title">{{.Zone}}</h1>
<div class="actions">
<a class="btn" id="export-link" href="/">Export zone file</a>
<a class="btn" id="import-link" href="/">Import zone file</a>
<a class="btn" id="audit-link" href="/audit">Audit history</a>
</div>
</div>
<section class="card" aria-labelledby="soa-title">
<div class="section-head">
<h2 id="soa-title">SOA</h2>
<div class="actions">
<button type="button" class="btn btn-small" id="soa-managed" hidden>Use managed serial</button>
<button type="button" class="btn btn-small" id="soa-edit" disabled>Edit SOA</button>
</div>
</div>
<dl class="dl" id="soa-summary"></dl>
<p class="muted" id="soa-status" role="status">Loading...</p>
</section>
<section class="card" id="problems-panel" aria-labelledby="problems-title" hidden>
<h2 id="problems-title">Problems</h2>
<ul class="problems" id="problems-list"></ul>
</section>
<section class="card" aria-labelledby="records-title">
<div class="section-head">
<h2 id="records-title">Records</h2>
<div class="actions">
<button type="button" class="btn btn-danger btn-small" id="bulk-delete" disabled>Delete selected</button>
<button type="button" class="btn btn-primary btn-small" id="record-add">Add record</button>
</div>
</div>
<div class="toolbar">
<div class="field">
<label for="filter-type">Type</label>
<select id="filter-type"><option value="">All types</option></select>
</div>
<div class="field grow">
<label for="filter-text">Search records</label>
<input id="filter-text" type="search" autocomplete="off" spellcheck="false">
</div>
</div>
<div class="table-wrap">
<table class="table" id="records-table">
<thead>
<tr>
<th scope="col" class="check"><input type="checkbox" id="select-all" aria-label="Select all records on this page"></th>
<th scope="col" data-sort="name"><button type="button" class="th-sort">Name</button></th>
<th scope="col" data-sort="type"><button type="button" class="th-sort">Type</button></th>
<th scope="col" data-sort="ttl"><button type="button" class="th-sort">TTL</button></th>
<th scope="col" data-sort="value"><button type="button" class="th-sort">Value</button></th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody id="records-body"></tbody>
</table>
</div>
<p class="muted" id="records-status" role="status">Loading records...</p>
<div class="pager" id="pager" hidden>
<button type="button" class="btn btn-small" id="page-prev">Previous</button>
<span id="page-info"></span>
<button type="button" class="btn btn-small" id="page-next">Next</button>
</div>
</section>
{{if .IsAdmin}}
<section class="card" id="users-panel" aria-labelledby="users-title">
<h2 id="users-title">Users</h2>
<p class="muted">Users who can see and change this zone. Administrators always can.</p>
<ul class="list" id="zone-users"></ul>
<p class="muted" id="zone-users-status" role="status">Loading...</p>
<form class="inline-form" id="zone-user-form" novalidate>
<div class="field">
<label for="zone-user-pick">Delegate this zone to</label>
<select id="zone-user-pick" name="username"></select>
</div>
<button type="submit" class="btn btn-small" id="zone-user-add">Add user</button>
</form>
</section>
<section class="card danger-zone" id="danger" aria-labelledby="danger-title">
<h2 id="danger-title">Danger zone</h2>
<p>Deleting the zone removes every record and every delegation of this zone. This cannot be undone.</p>
<form class="inline-form" id="zone-delete-form" novalidate>
<div class="field">
<label for="zone-delete-confirm">Type the zone name to confirm</label>
<input id="zone-delete-confirm" name="confirm" type="text" autocomplete="off" autocapitalize="none" spellcheck="false">
</div>
<button type="submit" class="btn btn-danger" id="zone-delete" disabled>Delete zone</button>
</form>
</section>
{{end}}
{{template "soa_dialog" .}}
{{template "record_dialog" .}}{{end}}