mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Simplify tunnel editor page
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<form action="/tunnels" method="POST">
|
||||
<div class='input'>
|
||||
<label for="domain">Domain:</label>
|
||||
<input type="text" id="domain" name="domain" required>
|
||||
<input type="text" id="domain" name="domain" value="{{$.Domain}}" required>
|
||||
<input type="hidden" id="tunnel-owner" name="owner" value="{{$.UserId}}">
|
||||
</div>
|
||||
<div class='input'>
|
||||
@@ -29,6 +29,14 @@
|
||||
<label for="client-port">Client Port:</label>
|
||||
<input type="text" id="client-port" name="client-port">
|
||||
</div>
|
||||
<div class='input'>
|
||||
<label for="tls-termination">TLS Termination:</label>
|
||||
<select id="tls-termination" name="tls-termination">
|
||||
<option value="client">Client</option>
|
||||
<option value="server">Server</option>
|
||||
<option value="passthrough">Passthrough</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class='input'>
|
||||
<label for="allow-external-tcp">Allow External TCP:</label>
|
||||
<input type="checkbox" id="allow-external-tcp" name="allow-external-tcp">
|
||||
@@ -44,15 +52,9 @@
|
||||
<input type="password" id="password" name="password">
|
||||
</div>
|
||||
</div>
|
||||
<div class='input'>
|
||||
<label for="tls-termination">TLS Termination:</label>
|
||||
<select id="tls-termination" name="tls-termination">
|
||||
<option value="server">Server</option>
|
||||
<option value="client">Client</option>
|
||||
<option value="passthrough">Passthrough</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button class='button' type="submit">Submit</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
{{ template "footer.tmpl" . }}
|
||||
|
||||
@@ -191,12 +191,6 @@ main {
|
||||
margin: .2em;
|
||||
}
|
||||
|
||||
.tunnel-adder form {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.ssh-key-adder form {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
@@ -204,16 +198,13 @@ main {
|
||||
}
|
||||
|
||||
.input {
|
||||
padding: .7em;
|
||||
margin: .2em;
|
||||
border: 1px solid var(--main-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.input label {
|
||||
padding: .2em;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#login-inputs {
|
||||
|
||||
@@ -149,6 +149,8 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request
|
||||
case "/edit-tunnel":
|
||||
r.ParseForm()
|
||||
|
||||
domain := r.Form.Get("domain")
|
||||
|
||||
var users map[string]User
|
||||
|
||||
// TODO: handle security checks in api
|
||||
@@ -160,10 +162,12 @@ func (h *WebUiHandler) handleWebUiRequest(w http.ResponseWriter, r *http.Request
|
||||
}
|
||||
|
||||
templateData := struct {
|
||||
Domain string
|
||||
UserId string
|
||||
User User
|
||||
Users map[string]User
|
||||
}{
|
||||
Domain: domain,
|
||||
UserId: tokenData.Owner,
|
||||
User: user,
|
||||
Users: users,
|
||||
|
||||
Reference in New Issue
Block a user