diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-03-03 21:14:04 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-03-03 21:22:46 +0100 |
commit | 890dcac2de7b1d6bc6768c69ea7129d27a809ef9 (patch) | |
tree | 69ede7832d4ae3eb8c2b87706d4c8eb79546e01d | |
parent | a22aba2fed7b95f241b70c215e23e5699a3ff9d9 (diff) |
luci-proto-wireguard: remove peer sections when deleting interface
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js index c8e1f8403..46cf53798 100644 --- a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js +++ b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js @@ -1,4 +1,5 @@ 'use strict'; +'require uci'; 'require form'; 'require network'; @@ -138,5 +139,11 @@ return network.registerProtocol('wireguard', { o = ss.option(form.Value, 'persistent_keepalive', _('Persistent Keep Alive'), _('Optional. Seconds between keep alive messages. Default is 0 (disabled). Recommended value if this device is behind a NAT is 25.')); o.datatype = 'range(0,65535)'; o.placeholder = '0'; + }, + + deleteConfiguration: function() { + uci.sections('network', 'wireguard_%s'.format(this.sid), function(s) { + uci.remove('network', s['.name']); + }); } }); |