Self-contained HTTP/HTTPS/TCP/UDP reverse proxy manager written in Go, with SQLite storage, a Bootstrap 5 admin UI (Go templates, no JS framework), and a REST API under /api/v1. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QTXFrNP1imCW7jtfL5SZrw
46 lines
2.5 KiB
HTML
46 lines
2.5 KiB
HTML
{{define "proxy_hosts"}}{{template "header" .}}
|
|
{{$d := .Data}}
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<input type="text" class="form-control w-auto" placeholder="Search proxy hosts…" data-search-target="hostsTable">
|
|
<a href="/proxy-hosts/new" class="btn btn-primary"><i class="bi bi-plus-lg"></i> Add Proxy Host</a>
|
|
</div>
|
|
<div class="card">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover align-middle mb-0" id="hostsTable">
|
|
<thead class="table-light">
|
|
<tr><th>Name</th><th>Domains</th><th>Type</th><th>Destination</th><th>SSL</th><th>Status</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range $d.Hosts}}
|
|
<tr>
|
|
<td><a href="/proxy-hosts/{{.ID}}/edit">{{.Name}}</a>{{if .Comments}}<div class="small text-secondary">{{.Comments}}</div>{{end}}</td>
|
|
<td>{{join .Domains ", "}}</td>
|
|
<td><span class="badge text-bg-{{if eq .Type "redirect"}}warning{{else}}info{{end}}">{{.Type}}</span></td>
|
|
<td>
|
|
{{if eq .Type "redirect"}}{{.RedirectTargetURL}}
|
|
{{else}}{{range .Backends}}{{.Host}}:{{.Port}} {{end}}{{end}}
|
|
</td>
|
|
<td>{{if .CertificateID}}<i class="bi bi-shield-check text-success"></i>{{else}}<i class="bi bi-shield-slash text-secondary"></i>{{end}}</td>
|
|
<td>{{if .Enabled}}<span class="badge text-bg-success">enabled</span>{{else}}<span class="badge text-bg-secondary">disabled</span>{{end}}</td>
|
|
<td class="text-end">
|
|
<form method="post" action="/proxy-hosts/{{.ID}}/toggle" class="d-inline">
|
|
{{template "csrf_field" $.CSRFToken}}
|
|
<button class="btn btn-sm btn-outline-secondary" title="Enable/disable"><i class="bi bi-power"></i></button>
|
|
</form>
|
|
<a href="/proxy-hosts/{{.ID}}/edit" class="btn btn-sm btn-outline-primary"><i class="bi bi-pencil"></i></a>
|
|
<form method="post" action="/proxy-hosts/{{.ID}}/delete" id="del-host-{{.ID}}" class="d-inline">
|
|
{{template "csrf_field" $.CSRFToken}}
|
|
</form>
|
|
<button type="button" class="btn btn-sm btn-outline-danger" data-confirm-delete-form="del-host-{{.ID}}" data-confirm-message="Delete proxy host "{{.Name}}"?"><i class="bi bi-trash"></i></button>
|
|
</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr><td colspan="7" class="text-center text-secondary py-4">No proxy hosts yet.</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{{template "confirm_delete_modal" .}}
|
|
{{template "footer" .}}{{end}}
|