chore(ui): add module file and main stub

- chore(ui): add module file and main stub
- feat(ui): add layout, pages and partials
- feat(ui): add stylesheet and scripts
- feat(ui): add page renderer and static file handler
- test(ui): cover rendering, escaping and static serving
This commit is contained in:
bryanpedini committed 2026-11-19 15:46:12 +01:00
1 parent 7089a6f408
commit 5ac8f98f10
26 files changed
+3921

No files matched your search

@@ -0,0 +1,35 @@
{{- /* SPDX-License-Identifier: GPL-2.0-or-later */ -}}
{{- /* Copyright (C) 2026 Bryan Joshua Pedini */ -}}
{{define "record_dialog"}}<dialog id="record-dialog" class="dialog" aria-labelledby="record-dialog-title">
<form id="record-form" class="form" novalidate>
<div class="dialog-head">
<h2 id="record-dialog-title">Add record</h2>
<button type="button" class="btn btn-icon" data-close aria-label="Close">&times;</button>
</div>
<div class="dialog-body">
<div class="alert alert-warn" id="record-broken" hidden>
<p>The stored row cannot be served correctly. Saving replaces it with the values below.</p>
<p>Stored content: <code class="mono" id="record-raw"></code></p>
</div>
<div class="field">
<label for="rec-name">Name</label>
<input id="rec-name" name="name" type="text" autocomplete="off" autocapitalize="none" spellcheck="false" placeholder="@" aria-describedby="rec-fqdn">
<p class="hint" id="rec-fqdn" aria-live="polite"></p>
</div>
<div class="field">
<label for="rec-type">Type</label>
<select id="rec-type" name="type"></select>
</div>
<div class="field">
<label for="rec-ttl">TTL (seconds)</label>
<input id="rec-ttl" name="ttl" type="text" inputmode="numeric" value="3600">
<p class="hint">0 means default (360 s).</p>
</div>
<div id="rec-fields"></div>
</div>
<div class="dialog-actions">
<button type="button" class="btn" data-close>Cancel</button>
<button type="submit" class="btn btn-primary" id="rec-submit">Save record</button>
</div>
</form>
</dialog>{{end}}
+49
View File
@@ -0,0 +1,49 @@
{{- /* SPDX-License-Identifier: GPL-2.0-or-later */ -}}
{{- /* Copyright (C) 2026 Bryan Joshua Pedini */ -}}
{{define "soa_dialog"}}<dialog id="soa-dialog" class="dialog" aria-labelledby="soa-dialog-title">
<form id="soa-form" class="form" novalidate>
<div class="dialog-head">
<h2 id="soa-dialog-title">Edit SOA</h2>
<button type="button" class="btn btn-icon" data-close aria-label="Close">&times;</button>
</div>
<div class="dialog-body">
<p class="alert alert-warn" id="soa-broken" hidden>The stored SOA cannot be read. Saving replaces it with the values below.</p>
<div class="field">
<label for="soa-ns">Primary name server</label>
<input id="soa-ns" name="ns" type="text" autocomplete="off" autocapitalize="none" spellcheck="false" required>
</div>
<div class="field">
<label for="soa-mbox">Hostmaster mailbox</label>
<input id="soa-mbox" name="mbox" type="text" autocomplete="off" autocapitalize="none" spellcheck="false" required>
</div>
<div class="grid-2">
<div class="field">
<label for="soa-refresh">Refresh</label>
<input id="soa-refresh" name="refresh" type="text" inputmode="numeric">
</div>
<div class="field">
<label for="soa-retry">Retry</label>
<input id="soa-retry" name="retry" type="text" inputmode="numeric">
</div>
<div class="field">
<label for="soa-expire">Expire</label>
<input id="soa-expire" name="expire" type="text" inputmode="numeric">
</div>
<div class="field">
<label for="soa-minttl">Minimum TTL</label>
<input id="soa-minttl" name="minttl" type="text" inputmode="numeric">
</div>
</div>
<div class="field">
<label for="soa-ttl">TTL of the SOA record</label>
<input id="soa-ttl" name="ttl" type="text" inputmode="numeric">
<p class="hint">0 means default (360 s).</p>
</div>
<p class="hint">The serial is managed by the application and increases with every change.</p>
</div>
<div class="dialog-actions">
<button type="button" class="btn" data-close>Cancel</button>
<button type="submit" class="btn btn-primary">Save SOA</button>
</div>
</form>
</dialog>{{end}}
@@ -0,0 +1,54 @@
{{- /* SPDX-License-Identifier: GPL-2.0-or-later */ -}}
{{- /* Copyright (C) 2026 Bryan Joshua Pedini */ -}}
{{define "zone_create_dialog"}}<dialog id="zone-dialog" class="dialog" aria-labelledby="zone-dialog-title">
<form id="zone-form" class="form" novalidate>
<div class="dialog-head">
<h2 id="zone-dialog-title">New zone</h2>
<button type="button" class="btn btn-icon" data-close aria-label="Close">&times;</button>
</div>
<div class="dialog-body">
<div class="field">
<label for="nz-name">Zone name</label>
<input id="nz-name" name="name" type="text" autocomplete="off" autocapitalize="none" spellcheck="false" placeholder="example.org" required>
</div>
<div class="field">
<label for="nz-ns">Primary name server</label>
<input id="nz-ns" name="ns" type="text" autocomplete="off" autocapitalize="none" spellcheck="false" placeholder="ns1.example.org" required>
</div>
<div class="field">
<label for="nz-mbox">Hostmaster mailbox</label>
<input id="nz-mbox" name="mbox" type="text" autocomplete="off" autocapitalize="none" spellcheck="false" placeholder="hostmaster@example.org" required>
</div>
<div class="field">
<label for="nz-extra">Additional name servers, one per line</label>
<textarea id="nz-extra" name="extra_ns" rows="3" autocomplete="off" autocapitalize="none" spellcheck="false"></textarea>
</div>
<div class="grid-2">
<div class="field">
<label for="nz-refresh">SOA refresh</label>
<input id="nz-refresh" name="refresh" type="text" inputmode="numeric" value="3600">
</div>
<div class="field">
<label for="nz-retry">SOA retry</label>
<input id="nz-retry" name="retry" type="text" inputmode="numeric" value="600">
</div>
<div class="field">
<label for="nz-expire">SOA expire</label>
<input id="nz-expire" name="expire" type="text" inputmode="numeric" value="604800">
</div>
<div class="field">
<label for="nz-minttl">SOA minimum TTL</label>
<input id="nz-minttl" name="minttl" type="text" inputmode="numeric" value="300">
</div>
</div>
<div class="field">
<label for="nz-ttl">TTL of the SOA and NS records</label>
<input id="nz-ttl" name="ttl" type="text" inputmode="numeric" value="3600">
</div>
</div>
<div class="dialog-actions">
<button type="button" class="btn" data-close>Cancel</button>
<button type="submit" class="btn btn-primary">Create zone</button>
</div>
</form>
</dialog>{{end}}