2024-03-28 00:55:22 -04:00
|
|
|
{{ define "content" }}
|
|
|
|
<table>
|
|
|
|
<tr>
|
2024-03-29 18:35:04 -04:00
|
|
|
<th>type.</th>
|
|
|
|
<th>name.</th>
|
|
|
|
<th>content.</th>
|
|
|
|
<th>ttl.</th>
|
|
|
|
<th>internal.</th>
|
|
|
|
<th>created.</th>
|
|
|
|
<th>delete.</th>
|
2024-03-28 00:55:22 -04:00
|
|
|
</tr>
|
|
|
|
{{ if (eq (len .DNSRecords) 0) }}
|
|
|
|
<tr>
|
2024-03-29 18:35:04 -04:00
|
|
|
<td colspan="7"><span class="blinky">no dns records found.</span></td>
|
2024-03-28 00:55:22 -04:00
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
{{ range $record := .DNSRecords }}
|
|
|
|
<tr>
|
|
|
|
<td>{{ $record.Type }}</td>
|
|
|
|
<td>{{ $record.Name }}</td>
|
|
|
|
<td>{{ $record.Content }}</td>
|
|
|
|
<td>{{ $record.TTL }}</td>
|
2024-03-28 17:25:34 -04:00
|
|
|
<td>{{ $record.Internal }}</td>
|
2024-03-29 18:35:04 -04:00
|
|
|
<td class="time">{{ $record.CreatedAt }}</td>
|
2024-03-28 12:57:35 -04:00
|
|
|
<td>
|
|
|
|
<form method="POST" action="/dns/delete">
|
|
|
|
<input type="hidden" name="id" value="{{ $record.ID }}" />
|
|
|
|
<input type="submit" value="Delete" />
|
|
|
|
</form>
|
|
|
|
</td>
|
2024-03-28 00:55:22 -04:00
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
</table>
|
|
|
|
<br>
|
2024-03-28 12:57:35 -04:00
|
|
|
<form method="POST" action="/dns" class="form">
|
2024-03-29 18:35:04 -04:00
|
|
|
<h2>add dns records.</h2>
|
2024-03-28 12:57:35 -04:00
|
|
|
<p>note that the name <em>must</em> be a subdomain of <em>{{ .User.Username }}</em></p>
|
2024-03-28 00:55:22 -04:00
|
|
|
<hr>
|
2024-03-29 18:35:04 -04:00
|
|
|
<label for="type">type.</label>
|
2024-03-28 12:57:35 -04:00
|
|
|
<input type="text" name="type" placeholder="CNAME"
|
|
|
|
{{ if not .RecordForm }}
|
|
|
|
placeholder="CNAME"
|
|
|
|
{{ else }}
|
|
|
|
value="{{ .RecordForm.Type }}"
|
|
|
|
{{ end }}
|
|
|
|
required />
|
2024-03-29 18:35:04 -04:00
|
|
|
<label for="name">name.</label>
|
2024-03-28 12:57:35 -04:00
|
|
|
<input type="text" name="name"
|
|
|
|
{{ if not .RecordForm }}
|
|
|
|
placeholder="{{ .User.Username }} || endpoint.{{ .User.Username }}..."
|
|
|
|
{{ else }}
|
|
|
|
value="{{ .RecordForm.Name }}"
|
|
|
|
{{ end }}
|
|
|
|
required/>
|
2024-03-29 18:35:04 -04:00
|
|
|
<label for="content">content.</label>
|
2024-03-28 12:57:35 -04:00
|
|
|
<input type="text" name="content"
|
|
|
|
{{ if not .RecordForm }}
|
|
|
|
placeholder="{{ .User.Username }}.dev"
|
|
|
|
{{ else }}
|
|
|
|
value="{{ .RecordForm.Content }}"
|
|
|
|
{{ end }}
|
|
|
|
required />
|
2024-03-29 18:35:04 -04:00
|
|
|
<label for="ttl">ttl.</label>
|
2024-03-28 12:57:35 -04:00
|
|
|
<input type="text" name="ttl"
|
|
|
|
{{ if not .RecordForm }}
|
|
|
|
placeholder="43200"
|
|
|
|
{{ else }}
|
|
|
|
value="{{ .RecordForm.TTL }}"
|
|
|
|
{{ end }}
|
|
|
|
required />
|
2024-03-28 16:58:07 -04:00
|
|
|
<label for="internal">
|
2024-03-29 18:35:04 -04:00
|
|
|
internal.
|
2024-03-28 16:58:07 -04:00
|
|
|
<input style='display:inline;width:auto;' type="checkbox" name="internal"
|
|
|
|
{{ if .RecordForm.Internal }}
|
|
|
|
checked
|
|
|
|
{{ end }}
|
|
|
|
/>
|
|
|
|
</label>
|
2024-04-09 18:29:52 -04:00
|
|
|
<input type="submit" value="add." />
|
2024-03-28 16:58:07 -04:00
|
|
|
</form>
|
2024-03-28 00:55:22 -04:00
|
|
|
{{ end }}
|