luci-proto-wireguard: Remove confirmation dialogue to generate keys (#6697)
authorPaul Donald <newtwen@gmail.com>
Mon, 4 Dec 2023 21:00:35 +0000 (22:00 +0100)
committerPaul Donald <newtwen@gmail.com>
Mon, 4 Dec 2023 22:55:58 +0000 (23:55 +0100)
Quality of life improvements. Reduce click amounts.
LuCI batches all changes for user-review anyway.

Tested on 23.05.0

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit a5786b5f2f68596b2ea8441fc8ad8ad7cf2ce2a9)

protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js

index 58537f38f8b9e68c92130e762070ca6ebbeff015..0f13c9e9ee432582acde05d17e27fbc3fefc60e1 100644 (file)
@@ -97,9 +97,6 @@ var cbiKeyPairGenerate = form.DummyValue.extend({
                                    pub = this.section.getUIElement(section_id, 'public_key'),
                                    map = this.map;
 
-                               if ((prv.getValue() || pub.getValue()) && !confirm(_('Do you want to replace the current keys?')))
-                                       return;
-
                                return generateKey().then(function(keypair) {
                                        prv.setValue(keypair.priv);
                                        pub.setValue(keypair.pub);
@@ -610,9 +607,6 @@ return network.registerProtocol('wireguard', {
                                        var psk = this.section.getUIElement(section_id, 'preshared_key'),
                                            map = this.map;
 
-                                       if (psk.getValue() && !confirm(_('Do you want to replace the current PSK?')))
-                                               return;
-
                                        return generatePsk().then(function(key) {
                                                psk.setValue(key);
                                                map.save(null, true);