added Post Up and Post Down configuration to server interface (#28)

This commit is contained in:
Jaryl Chng 2020-09-14 03:47:01 +08:00 committed by GitHub
parent d82da2fb35
commit b0ed08f19d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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}}