mirror of
				https://github.com/h44z/wg-portal.git
				synced 2025-11-03 23:56:18 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			109 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			109 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html lang="en">
 | 
						|
<head>
 | 
						|
    <meta charset="utf-8">
 | 
						|
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
 | 
						|
    <title>{{ .Static.WebsiteTitle }} - Admin</title>
 | 
						|
    <meta name="description" content="{{ .Static.WebsiteTitle }}">
 | 
						|
    <link rel="stylesheet" href="/css/bootstrap.min.css">
 | 
						|
    <link rel="stylesheet" href="/fonts/fontawesome-all.min.css">
 | 
						|
    <link rel="stylesheet" href="/css/custom.css">
 | 
						|
</head>
 | 
						|
 | 
						|
<body id="page-top" class="d-flex flex-column min-vh-100">
 | 
						|
    {{template "prt_nav.html" .}}
 | 
						|
    <div class="container mt-5">
 | 
						|
        {{if .Peer.IsNew}}
 | 
						|
            <h1>Create a new client</h1>
 | 
						|
        {{else}}
 | 
						|
            <h1>Edit client <strong>{{.Peer.Identifier}}</strong></h1>
 | 
						|
        {{end}}
 | 
						|
 | 
						|
        {{template "prt_flashes.html" .}}
 | 
						|
 | 
						|
        <form method="post" enctype="multipart/form-data">
 | 
						|
            <input type="hidden" name="uid" value="{{.Peer.UID}}">
 | 
						|
            {{if .EditableKeys}}
 | 
						|
                <div class="form-row">
 | 
						|
                    <div class="form-group col-md-12">
 | 
						|
                        <label for="inputServerPrivateKey">Private Key</label>
 | 
						|
                        <input type="text" name="privkey" class="form-control" id="inputServerPrivateKey" value="{{.Peer.PrivateKey}}">
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
                <div class="form-row">
 | 
						|
                    <div class="form-group col-md-12">
 | 
						|
                        <label for="inputServerPublicKey">Public Key</label>
 | 
						|
                        <input type="text" name="pubkey" class="form-control" id="inputServerPublicKey" value="{{.Peer.PublicKey}}">
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
                <div class="form-row">
 | 
						|
                    <div class="form-group col-md-12">
 | 
						|
                        <label for="inputServerPresharedKey">Preshared Key</label>
 | 
						|
                        <input type="text" name="presharedkey" class="form-control" id="inputServerPresharedKey" value="{{.Peer.PresharedKey}}">
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
            {{else}}
 | 
						|
                <input type="hidden" name="privkey" value="{{.Peer.PrivateKey}}">
 | 
						|
                <input type="hidden" name="presharedkey" value="{{.Peer.PresharedKey}}">
 | 
						|
                <div class="form-row">
 | 
						|
                    <div class="form-group col-md-12">
 | 
						|
                        <label for="inputServerPublicKey">Public Key</label>
 | 
						|
                        <input type="text" name="pubkey" readonly class="form-control" id="inputServerPublicKey" value="{{.Peer.PublicKey}}">
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
            {{end}}
 | 
						|
            <div class="form-row">
 | 
						|
                <div class="form-group col-md-12">
 | 
						|
                    <label for="inputIdentifier">Client Friendly Name</label>
 | 
						|
                    <input type="text" name="identifier" class="form-control" id="inputIdentifier" value="{{.Peer.Identifier}}">
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
            <div class="form-row">
 | 
						|
                <div class="form-group col-md-12">
 | 
						|
                    <label for="inputEmail">Client Email Address</label>
 | 
						|
                    <input type="email" name="mail" class="form-control" id="inputEmail" value="{{.Peer.Email}}">
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
            <div class="form-row">
 | 
						|
                <div class="form-group col-md-12">
 | 
						|
                    <label for="inputIP">Client IP Address</label>
 | 
						|
                    <input type="text" name="ip" class="form-control" id="inputIP" value="{{.Peer.IPsStr}}">
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
            <div class="form-row">
 | 
						|
                <div class="form-group col-md-12">
 | 
						|
                    <label for="inputAllowedIP">Allowed IPs</label>
 | 
						|
                    <input type="text" name="allowedip" class="form-control" id="inputAllowedIP" value="{{.Peer.AllowedIPsStr}}">
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
 | 
						|
            <div class="form-row">
 | 
						|
                <div class="form-group col-md-12">
 | 
						|
                    <div class="custom-control custom-switch">
 | 
						|
                        <input class="custom-control-input" name="isdisabled" type="checkbox" value="true" id="inputDisabled" {{if .Peer.DeactivatedAt}}checked{{end}}>
 | 
						|
                        <label class="custom-control-label" for="inputDisabled">
 | 
						|
                            Disabled
 | 
						|
                        </label>
 | 
						|
                    </div>
 | 
						|
                    <div class="custom-control custom-switch">
 | 
						|
                        <input class="custom-control-input" name="ignorekeepalive" type="checkbox" value="true" id="inputIgnoreKeepalive" {{if .Peer.IgnorePersistentKeepalive}}checked{{end}}>
 | 
						|
                        <label class="custom-control-label" for="inputIgnoreKeepalive">
 | 
						|
                            Ignore persistent keepalive
 | 
						|
                        </label>
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
 | 
						|
 | 
						|
            <button type="submit" class="btn btn-primary">Save</button>
 | 
						|
            <a href="/admin" class="btn btn-secondary">Cancel</a>
 | 
						|
        </form>
 | 
						|
    </div>
 | 
						|
    {{template "prt_footer.html" .}}
 | 
						|
    <script src="/js/jquery.min.js"></script>
 | 
						|
    <script src="/js/bootstrap.bundle.min.js"></script>
 | 
						|
    <script src="/js/jquery.easing.js"></script>
 | 
						|
    <script src="/js/custom.js"></script>
 | 
						|
</body>
 | 
						|
 | 
						|
</html> |