summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network
diff options
context:
space:
mode:
authorChen Minqiang <ptpt52@gmail.com>2024-01-22 22:46:51 +0800
committerPaul Donald <itsascambutmailmeanyway@gmail.com>2024-01-25 13:50:49 +0100
commit999f26e951e516ddb394ecf7b6b305e4a34810fa (patch)
tree6e8f22c65ab6efa101ac8a4b8da6822d1e1902ac /modules/luci-mod-network
parent0617d301d9e9bb876621e61600673daef200b182 (diff)
luci-mod-network: let sourcefilter option available for most proto
sourcefilter option should be available for proto like: 'dhcpv6' 'directip' 'ppp' 'pppoe' 'pppoa' 'pptp' 'qmi' 'mbim' 'ncm' '3g' Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Diffstat (limited to 'modules/luci-mod-network')
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
index a3f2e9e34a..4a9abea5a2 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js
@@ -245,6 +245,24 @@ function has_peerdns(proto) {
return false;
}
+function has_sourcefilter(proto) {
+ switch (proto) {
+ case '3g':
+ case 'dhcpv6':
+ case 'directip':
+ case 'mbim':
+ case 'ncm':
+ case 'ppp':
+ case 'pppoa':
+ case 'pppoe':
+ case 'pptp':
+ case 'qmi':
+ return true;
+ }
+
+ return false;
+}
+
var cbiRichListValue = form.ListValue.extend({
renderWidget: function(section_id, option_index, cfgvalue) {
var choices = this.transformChoices();
@@ -1038,7 +1056,7 @@ return view.extend({
for (var i = 0; i < rtTables.length; i++)
o.value(rtTables[i][1], '%s (%d)'.format(rtTables[i][1], rtTables[i][0]));
- if (protoval == 'dhcpv6') {
+ if (has_sourcefilter(protoval)) {
o = nettools.replaceOption(s, 'advanced', form.Flag, 'sourcefilter', _('IPv6 source routing'), _('Automatically handle multiple uplink interfaces using source-based policy routing.'));
o.default = o.enabled;
}