mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Get basic UI plumbing in place
This commit is contained in:
parent
bae4eaf02d
commit
bcd786e5d8
@ -9,6 +9,7 @@ import (
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"html/template"
|
||||
"strconv"
|
||||
"sync"
|
||||
"github.com/caddyserver/certmagic"
|
||||
@ -136,7 +137,18 @@ func (p *BoringProxy) handleAdminRequest(w http.ResponseWriter, r *http.Request)
|
||||
return
|
||||
}
|
||||
|
||||
io.WriteString(w, indexTemplate)
|
||||
tmpl, err := template.New("test").Parse(indexTemplate)
|
||||
if err != nil {
|
||||
w.WriteHeader(500)
|
||||
log.Println(err)
|
||||
io.WriteString(w, "Error compiling index.tmpl")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
tmpl.Execute(w, p.tunMan.tunnels)
|
||||
|
||||
//io.WriteString(w, indexTemplate)
|
||||
|
||||
case "/tunnels":
|
||||
|
||||
|
32
webui/index.tmpl
Normal file
32
webui/index.tmpl
Normal file
@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<title>boringproxy</title>
|
||||
|
||||
<link rel="icon" href="data:image/gif;base64,R0lGODlhEAAQAAAAACwAAAAAAQABAAACASgAOw==">
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: Helvetica;
|
||||
}
|
||||
.tunnel-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class='tunnel-list'>
|
||||
{{range $domain, $tunnel:= .}}
|
||||
<div class='tunnel'>
|
||||
{{$domain}} {{$tunnel.Port}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
20
webui/login.tmpl
Normal file
20
webui/login.tmpl
Normal file
@ -0,0 +1,20 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<title>boringproxy</title>
|
||||
|
||||
<link rel="icon" href="data:image/gif;base64,R0lGODlhEAAQAAAAACwAAAAAAQABAAACASgAOw==">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="/login" method="post">
|
||||
<label for="mail">E-mail:</label>
|
||||
<input type="email" id="mail" name="email">
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user