added Post Up and Post Down configuration to server interface

This commit is contained in:
Jaryl Chng 2020-08-22 19:56:53 +08:00
parent cd7f6e500a
commit 80cdb768a6
No known key found for this signature in database
GPG key ID: A7174FB4C337FA37
4 changed files with 22 additions and 2 deletions

View file

@ -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}}