luci-base: support loopback by widgets.NetworkSelect 5270/head
authorVladislav Grigoryev <vg.aetera@gmail.com>
Sat, 14 Aug 2021 23:37:44 +0000 (02:37 +0300)
committerVladislav Grigoryev <vg.aetera@gmail.com>
Sat, 14 Aug 2021 23:56:45 +0000 (02:56 +0300)
Support the "loopback" interface by "widgets.NetworkSelect".
Enable the "loopback" option to include this interface.
Can be used to configure interface binding for services.

Signed-off-by: Vladislav Grigoryev <vg.aetera@gmail.com>
modules/luci-base/htdocs/luci-static/resources/tools/widgets.js

index 3f2b7b9ffcfafbcf888d29ab56eabe039628516c..35a4dc8ec9dcc5b8f897d782d0236a108ce5ca96 100644 (file)
@@ -372,7 +372,10 @@ var CBINetworkSelect = form.ListValue.extend({
                        var network = this.networks[i],
                            name = network.getName();
 
-                       if (name == 'loopback' || name == this.exclude || !this.filter(section_id, name))
+                       if (name == this.exclude || !this.filter(section_id, name))
+                               continue;
+
+                       if (name == 'loopback' && !this.loopback)
                                continue;
 
                        if (this.novirtual && network.isVirtual())