Files
kanhole/server/admin/templates/proxy_new.html
T

62 lines
2.4 KiB
HTML

<div class="toolbar">
<h1>New Proxy</h1>
</div>
{{if .Error}}
<div style="margin-bottom:16px;padding:12px;border:1px solid var(--border);font-size:13px">{{.Error}}</div>
{{end}}
<form hx-post="/admin/proxies/new" hx-target="body" hx-push-url="true" style="max-width:500px">
<div style="margin-bottom:16px">
<label style="display:block;font-size:12px;color:var(--fg2);margin-bottom:4px">Client</label>
<select name="client_id" required>
<option value="">— Select Client —</option>
{{range .Clients}}
<option value="{{.ID}}"{{if eq .ID $.SelectedClient}} selected{{end}}>{{.Name}}</option>
{{end}}
</select>
</div>
<div style="margin-bottom:16px">
<label style="display:block;font-size:12px;color:var(--fg2);margin-bottom:4px">Proxy Type</label>
<select name="proxy_type">
<option value="tcp">TCP</option>
<option value="udp">UDP</option>
<option value="http">HTTP</option>
<option value="https">HTTPS</option>
</select>
</div>
<div style="margin-bottom:16px">
<label style="display:block;font-size:12px;color:var(--fg2);margin-bottom:4px">Name</label>
<input type="text" name="name" required autofocus placeholder="ssh-proxy">
</div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:16px">
<div>
<label style="display:block;font-size:12px;color:var(--fg2);margin-bottom:4px">Local IP</label>
<input type="text" name="local_ip" value="127.0.0.1" required>
</div>
<div>
<label style="display:block;font-size:12px;color:var(--fg2);margin-bottom:4px">Local Port</label>
<input type="number" name="local_port" required>
</div>
</div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:16px">
<div>
<label style="display:block;font-size:12px;color:var(--fg2);margin-bottom:4px">Remote Port</label>
<input type="number" name="remote_port" placeholder="0 = auto">
</div>
<div>
<label style="display:block;font-size:12px;color:var(--fg2);margin-bottom:4px">Custom Domains</label>
<input type="text" name="custom_domains" placeholder="example.com">
</div>
</div>
<div class="toolbar" style="margin-top:24px">
<button type="submit">Create Proxy</button>
<a href="/admin/proxies" class="btn btn-outline" hx-get="/admin/proxies" hx-target="#main-content" hx-push-url="true">Cancel</a>
</div>
</form>