mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
Add Apply Config button to save wireguard config file
This commit is contained in:
parent
ea36311475
commit
7c3cac8084
7 changed files with 177 additions and 2 deletions
|
@ -55,6 +55,12 @@ Global Settings
|
|||
name="persistent_keepalive" placeholder="Persistent Keepalive"
|
||||
value="{{ .globalSettings.PersistentKeepalive }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="config_file_path">Wireguard Config File Path</label>
|
||||
<input type="text" class="form-control" id="config_file_path"
|
||||
name="config_file_path" placeholder="E.g. /etc/wireguard/wg0.conf"
|
||||
value="{{ .globalSettings.ConfigFilePath }}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
|
||||
|
@ -104,7 +110,8 @@ Global Settings
|
|||
var dns_servers = $("#dns_servers").val().split(",");
|
||||
var mtu = $("#mtu").val();
|
||||
var persistent_keepalive = $("#persistent_keepalive").val();
|
||||
var data = {"endpoint_address": endpoint_address, "dns_servers": dns_servers, "mtu": mtu, "persistent_keepalive": persistent_keepalive};
|
||||
var config_file_path = $("#config_file_path").val();
|
||||
var data = {"endpoint_address": endpoint_address, "dns_servers": dns_servers, "mtu": mtu, "persistent_keepalive": persistent_keepalive, "config_file_path": config_file_path};
|
||||
|
||||
$.ajax({
|
||||
cache: false,
|
||||
|
@ -173,6 +180,9 @@ Global Settings
|
|||
persistent_keepalive: {
|
||||
required: true,
|
||||
digits: true
|
||||
},
|
||||
config_file_path: {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
|
@ -184,6 +194,9 @@ Global Settings
|
|||
persistent_keepalive: {
|
||||
required: "Please enter a Persistent Keepalive value",
|
||||
digits: "Persistent keepalive must be an integer"
|
||||
},
|
||||
config_file_path: {
|
||||
required: "Please enter WireGuard config file path"
|
||||
}
|
||||
},
|
||||
errorElement: 'span',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue