hatecomputers.club/templates/dns.html

38 lines
1.1 KiB
HTML
Raw Normal View History

2024-03-28 00:55:22 -04:00
{{ define "content" }}
<table>
<tr>
<th>Type</th>
<th>Name</th>
<th>Content</th>
<th>TTL</th>
</tr>
{{ if (eq (len .DNSRecords) 0) }}
<tr>
<td colspan="4"><span class="blinky">No DNS records found</span></td>
</tr>
{{ end }}
{{ range $record := .DNSRecords }}
<tr>
<td>{{ $record.Type }}</td>
<td>{{ $record.Name }}</td>
<td>{{ $record.Content }}</td>
<td>{{ $record.TTL }}</td>
</tr>
{{ end }}
</table>
<br>
<form method="POST" action="/dns">
<h2>Add DNS Records</h2>
<hr>
<label for="type">Type</label>
<input type="text" name="type" placeholder="CNAME" required />
<label for="name">Name</label>
<input type="text" name="name" placeholder="{{ .User.Username }}" required />
<label for="content">Content</label>
<input type="text" name="content" placeholder="{{ .User.Username }}.dev" required />
<label for="ttl">TTL</label>
<input type="text" name="ttl" placeholder="43200" required />
<input type="submit" value="Add" />
</form>
{{ end }}