mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-08 00:56:58 +03:00
added Post Up and Post Down configuration to server interface
This commit is contained in:
parent
cd7f6e500a
commit
80cdb768a6
4 changed files with 22 additions and 2 deletions
|
@ -37,6 +37,16 @@ Wireguard Server Settings
|
|||
<input type="text" class="form-control" id="listen_port" name="listen_port"
|
||||
placeholder="Listen Port" value="{{ .serverInterface.ListenPort }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="post_up">Post Up Script</label>
|
||||
<input type="text" class="form-control" id="post_up" name="post_up"
|
||||
placeholder="Post Up Script" value="{{ .serverInterface.PostUp }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="post_down">Post Down Script</label>
|
||||
<input type="text" class="form-control" id="post_down" name="post_down"
|
||||
placeholder="Post Down Script" value="{{ .serverInterface.PostDown }}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
|
@ -119,7 +129,9 @@ Wireguard Server Settings
|
|||
function submitServerInterfaceSetting() {
|
||||
const addresses = $("#addresses").val().split(",");
|
||||
const listen_port = $("#listen_port").val();
|
||||
const data = {"addresses": addresses, "listen_port": listen_port};
|
||||
const post_up = $("#post_up").val();
|
||||
const post_down = $("#post_down").val();
|
||||
const data = {"addresses": addresses, "listen_port": listen_port, "post_up": post_up, "post_down": post_down};
|
||||
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -232,4 +244,4 @@ Wireguard Server Settings
|
|||
});
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
|
|
@ -8,6 +8,8 @@ Address = {{$first :=true}}{{range .serverConfig.Interface.Addresses }}{{if $fir
|
|||
ListenPort = {{ .serverConfig.Interface.ListenPort }}
|
||||
PrivateKey = {{ .serverConfig.KeyPair.PrivateKey }}
|
||||
MTU = {{ .globalSettings.MTU }}
|
||||
PostUp = {{ .serverConfig.Interface.PostUp }}
|
||||
PostDown = {{ .serverConfig.Interface.PostDown }}
|
||||
|
||||
{{range .clientDataList}}{{if eq .Client.Enabled true}}
|
||||
# ID: {{ .Client.ID }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue