wip
This commit is contained in:
		
							
								
								
									
										20
									
								
								hub/templates/admin-config-edit.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								hub/templates/admin-config-edit.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Config</h2> | ||||
|  | ||||
| <form method="POST"> | ||||
|   <input type="hidden" name="CSRF" value="{{.Session.CSRF}}"> | ||||
|   <p> | ||||
|     <label>Hub Address</label><br> | ||||
|     <input type="url" name="HubAddress" value="{{.Config.HubAddress}}"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>VPN Network</label><br> | ||||
|     <input type="text" name="VPNNetwork" value="{{ipToString .Config.VPNNetwork}}"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <button type="submit">Save</button> | ||||
|     <a href="/admin/config/">Cancel</a> | ||||
|   </p> | ||||
| </form> | ||||
|  | ||||
| {{- end}} | ||||
							
								
								
									
										19
									
								
								hub/templates/admin-config.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								hub/templates/admin-config.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Config</h2> | ||||
|  | ||||
| <p> | ||||
|   <a href="/admin/config/edit/">Edit</a> / | ||||
|   <a href="/admin/password/edit/">Change Password</a> | ||||
| </p> | ||||
|  | ||||
| <table class="def-list"> | ||||
|   <tr> | ||||
|     <td>Hub Address</td> | ||||
|     <td>{{.Config.HubAddress}}</td> | ||||
|   </tr> | ||||
|   <tr> | ||||
|     <td>VPN Network</td> | ||||
|     <td>{{ipToString .Config.VPNNetwork}}</td> | ||||
|   </tr> | ||||
| </table> | ||||
| {{- end}} | ||||
							
								
								
									
										23
									
								
								hub/templates/admin-password-edit.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								hub/templates/admin-password-edit.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Change Password</h2> | ||||
|  | ||||
| <form method="POST"> | ||||
|   <input type="hidden" name="CSRF" value="{{.Session.CSRF}}"> | ||||
|   <p> | ||||
|     <label>Current Password</label><br> | ||||
|     <input type="password" name="CurrentPassword"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>New Password</label><br> | ||||
|     <input type="password" name="NewPassword"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>Repeat New Password</label><br> | ||||
|     <input type="password" name="NewPassword2"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <button type="submit">Save</button> | ||||
|     <a href="/admin/config/">Cancel</a> | ||||
|   </p> | ||||
| </form> | ||||
| {{- end}} | ||||
							
								
								
									
										30
									
								
								hub/templates/admin-peer-create.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								hub/templates/admin-peer-create.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| {{define "body" -}} | ||||
| <h2>New Peer</h2> | ||||
|  | ||||
| <form method="POST"> | ||||
|   <input type="hidden" name="CSRF" value="{{.Session.CSRF}}"> | ||||
|   <p> | ||||
|     <label>Name</label><br> | ||||
|     <input type="text" name="Name"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>IP</label><br> | ||||
|     <input type="text" name="IP"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>Port</label><br> | ||||
|     <input type="number" name="Port" value="515"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label> | ||||
|       <input type="checkbox" name="Mediator"> | ||||
|       Mediator | ||||
|     </label> | ||||
|   </p> | ||||
|   <p> | ||||
|     <button type="submit">Save</button> | ||||
|     <a href="/admin/config/">Cancel</a> | ||||
|   </p> | ||||
| </form> | ||||
|  | ||||
| {{- end}} | ||||
							
								
								
									
										36
									
								
								hub/templates/admin-peer-delete.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								hub/templates/admin-peer-delete.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Delete Peer</h2> | ||||
|  | ||||
| {{with .Peer -}} | ||||
| <form method="POST"> | ||||
|   <input type="hidden" name="CSRF" value="{{$.Session.CSRF}}"> | ||||
|   <p> | ||||
|     <label>Peer IP</label><br> | ||||
|     <input type="number" name="PeerIP" value="{{.PeerIP}}" disabled> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>Name</label><br> | ||||
|     <input type="text" value="{{.Name}}" disabled> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>IP</label><br> | ||||
|     <input type="text" value="{{ipToString .IP}}" disabled> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>Port</label><br> | ||||
|     <input type="number" value="{{.Port}}" disabled> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label> | ||||
|       <input type="checkbox" {{if .Mediator}}checked{{end}} disabled> | ||||
|       Mediator | ||||
|     </label> | ||||
|   </p> | ||||
|   <p> | ||||
|     <button type="submit">Delete</button> | ||||
|     <a href="/admin/peer/view/?PeerIP={{.PeerIP}}">Cancel</a> | ||||
|   </p> | ||||
| </form> | ||||
| {{- end}} | ||||
|  | ||||
| {{- end}} | ||||
							
								
								
									
										36
									
								
								hub/templates/admin-peer-edit.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								hub/templates/admin-peer-edit.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Edit Peer</h2> | ||||
|  | ||||
| {{with .Peer -}} | ||||
| <form method="POST"> | ||||
|   <input type="hidden" name="CSRF" value="{{$.Session.CSRF}}"> | ||||
|   <p> | ||||
|     <label>Peer IP</label><br> | ||||
|     <input type="number" name="PeerIP" value="{{.PeerIP}}" disabled> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>Name</label><br> | ||||
|     <input type="text" name="Name" value="{{.Name}}"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>IP</label><br> | ||||
|     <input type="text" name="IP" value="{{ipToString .IP}}"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label>Port</label><br> | ||||
|     <input type="number" name="Port" value="{{.Port}}"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <label> | ||||
|       <input type="checkbox" name="Mediator" {{if .Mediator}}checked{{end}}> | ||||
|       Mediator | ||||
|     </label> | ||||
|   </p> | ||||
|   <p> | ||||
|     <button type="submit">Save</button> | ||||
|     <a href="/admin/peer/view/?PeerIP={{.PeerIP}}">Cancel</a> | ||||
|   </p> | ||||
| </form> | ||||
| {{- end}} | ||||
|  | ||||
| {{- end}} | ||||
							
								
								
									
										13
									
								
								hub/templates/admin-peer-intent.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								hub/templates/admin-peer-intent.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Create Peer</h2> | ||||
|  | ||||
| <p> | ||||
|   Configure the peer with the following URL: | ||||
| </p> | ||||
| <pre> | ||||
|   {{.HubAddress}}/peer/create/?Code={{.Code}} | ||||
| </pre> | ||||
| <p> | ||||
|   <a href="/admin/peer/list/">Done</a> | ||||
| </p> | ||||
| {{- end}} | ||||
							
								
								
									
										39
									
								
								hub/templates/admin-peer-list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								hub/templates/admin-peer-list.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Peers</h2> | ||||
|  | ||||
| <p> | ||||
|   <a href="/admin/peer/create/">Add Peer</a> | ||||
| </p> | ||||
|  | ||||
| {{if .Peers -}} | ||||
| <table> | ||||
|   <thead> | ||||
|     <tr> | ||||
|       <th>PeerIP</th> | ||||
|       <th>Name</th> | ||||
|       <th>IP</th> | ||||
|       <th>Port</th> | ||||
|       <th>Mediator</th> | ||||
|     </tr> | ||||
|   </thead> | ||||
|   <tbody> | ||||
|   {{range .Peers -}} | ||||
|   <tr> | ||||
|     <td> | ||||
|       <a href="/admin/peer/view/?PeerIP={{.PeerIP}}"> | ||||
|         {{.PeerIP}} | ||||
|       </a> | ||||
|     </td> | ||||
|     <td>{{.Name}}</td> | ||||
|     <td>{{ipToString .IP}}</td> | ||||
|     <td>{{.Port}}</td> | ||||
|     <td>{{if .Mediator}}T{{else}}F{{end}}</td> | ||||
|   </tr> | ||||
|   </tbody> | ||||
|   {{- end}} | ||||
| </table> | ||||
| {{- else}} | ||||
| <p>No peers.</p> | ||||
| {{- end}} | ||||
|  | ||||
| {{- end}} | ||||
							
								
								
									
										20
									
								
								hub/templates/admin-peer-view.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								hub/templates/admin-peer-view.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Peer</h2> | ||||
|  | ||||
| <p> | ||||
|   <a href="/admin/peer/edit/?PeerIP={{.Peer.PeerIP}}">Edit</a> / | ||||
|   <a href="/admin/peer/delete/?PeerIP={{.Peer.PeerIP}}">Delete</a> | ||||
| </p> | ||||
|  | ||||
| {{with .Peer -}} | ||||
| <table class="def-list"> | ||||
|   <tr><td>Peer IP</td><td>{{.PeerIP}}</td></tr> | ||||
|   <tr><td>Name</td><td>{{.Name}}</td></tr> | ||||
|   <tr><td>IP</td><td>{{ipToString .IP}}</td></tr> | ||||
|   <tr><td>Port</td><td>{{.Port}}</td></tr> | ||||
|   <tr><td>Mediator</td><td>{{if .Mediator}}T{{else}}F{{end}}</td></tr> | ||||
|   <tr><td>API Key</td><td>{{.APIKey}}</td></tr> | ||||
| </table> | ||||
| {{- end}} | ||||
|  | ||||
| {{- end}} | ||||
							
								
								
									
										11
									
								
								hub/templates/admin-sign-out.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								hub/templates/admin-sign-out.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Sign Out</h2> | ||||
|  | ||||
| <form method="POST"> | ||||
|   <input type="hidden" name="CSRF" value="{{.Session.CSRF}}"> | ||||
|   <p> | ||||
|     <button type="submit">Sign Out</button> | ||||
|     <a href="/admin/config/">Cancel</a> | ||||
|   </p> | ||||
| </form> | ||||
| {{- end}} | ||||
							
								
								
									
										21
									
								
								hub/templates/base.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								hub/templates/base.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| <!DOCTYPE html> | ||||
| <html lang="en"> | ||||
| <head> | ||||
|   <title>VPPN Hub</title> | ||||
|   <link rel="stylesheet" href="/static/new.min.css"> | ||||
|     <link rel="stylesheet" href="/static/custom.css"> | ||||
| </head> | ||||
| <body> | ||||
|   <header> | ||||
|     <h1>VPPN</h1> | ||||
|     <nav> | ||||
|       {{if .Session.SignedIn -}} | ||||
|       <a href="/admin/config/">Config</a> / | ||||
|       <a href="/admin/peer/list/">Peers</a> / | ||||
|       <a href="/admin/sign-out/">Sign out</a> | ||||
|       {{- end}} | ||||
|     </nav> | ||||
|   </header> | ||||
|   {{block "body" .}}There's nothing here.{{end}} | ||||
| </body> | ||||
| </html> | ||||
							
								
								
									
										0
									
								
								hub/templates/share/common.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								hub/templates/share/common.html
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										14
									
								
								hub/templates/sign-in.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								hub/templates/sign-in.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| {{define "body" -}} | ||||
| <h2>Sign In</h2> | ||||
|  | ||||
| <form method="POST"> | ||||
|   <input type="hidden" name="CSRF" value="{{.Session.CSRF}}"> | ||||
|   <p> | ||||
|     <label>Password</label><br> | ||||
|     <input type="password" name="Password"> | ||||
|   </p> | ||||
|   <p> | ||||
|     <button type="submit">Submit</button> | ||||
|   </p> | ||||
| </form> | ||||
| {{- end}} | ||||
		Reference in New Issue
	
	Block a user