luci-proto-wireguard: add option to disable peer-section
authorRobert Walli <12079858+rwalli@users.noreply.github.com>
Fri, 12 Nov 2021 22:20:10 +0000 (23:20 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Wed, 17 Nov 2021 15:38:20 +0000 (16:38 +0100)
Submitted-by: Robert Walli <12079858+rwalli@users.noreply.github.com>
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js

index 5795eaebec45b859b769d5b0cc5833ded4f4fdfd..e361b2f5ea7f8f500762ac13d5903f6342c74e07 100644 (file)
@@ -151,6 +151,9 @@ return network.registerProtocol('wireguard', {
                        ]);
                };
 
+               o = ss.option(form.Flag, 'disabled', _('Peer disabled'), _('Enable / Disable peer. Restart wireguard interface to apply changes.'));
+               o.optional = true;
+
                o = ss.option(form.Value, 'description', _('Description'), _('Optional. Description of peer.'));
                o.placeholder = 'My Peer';
                o.datatype = 'string';