diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index 2a952f263..1dc5c6bff 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -245,6 +245,25 @@ function has_peerdns(proto) { return false; } +function has_sourcefilter(proto) { + switch (proto) { + case '3g': + case 'dhcpv6': + case 'directip': + case 'mbim': + case 'modemmanager': + 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(); @@ -537,6 +556,11 @@ return view.extend({ tdEl.lastChild.childNodes[3].disabled = true; } + if (dynamic) { + //disable the 'Edit' button on dynamic interfaces + tdEl.lastChild.childNodes[2].disabled = true; + } + return tdEl; }; @@ -588,6 +612,10 @@ return view.extend({ o.nobridges = false; o.optional = false; o.network = ifc.getName(); + o.exclude = '@' + ifc.getName(); + + o = s.taboption('general', form.Flag, 'disabled', _('Disable this interface')); + o.modalonly = true; o = s.taboption('general', form.Flag, 'auto', _('Bring up on boot')); o.modalonly = true; @@ -1043,7 +1071,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; } @@ -1550,9 +1578,24 @@ return view.extend({ o = s.option(form.Value, 'ula_prefix', _('IPv6 ULA-Prefix'), _('Unique Local Address - in the range fc00::/7. Typically only within the ‘local’ half fd00::/8. ULA for IPv6 is analogous to IPv4 private network addressing. This prefix is randomly generated at first install.')); o.datatype = 'cidr6'; - o = s.option(form.Flag, 'packet_steering', _('Packet Steering'), _('Enable packet steering across all CPUs. May help or hinder network speed.')); + o = s.option(form.ListValue, 'packet_steering', _('Packet Steering'), _('Enable packet steering across CPUs. May help or hinder network speed.')); + o.value('', _('Disabled')); + o.value('1',_('Enabled')); + o.value('2',_('Enabled (all CPUs)')); o.optional = true; + var steer_flow = uci.get('network', 'globals', 'steering_flows'); + + o = s.option(form.Value, 'steering_flows', _('Steering flows (RPS)'), + _('Directs packet flows to specific CPUs where the local socket owner listens (the local service).') + ' ' + + _('Note: this setting is for local services on the device only (not for forwarding).')); + o.value('', _('Standard: none')); + o.value('128', _('Suggested: 128')); + o.value('256', _('256')); + o.depends('packet_steering', '1'); + o.depends('packet_steering', '2'); + o.datatype = 'uinteger'; + o.default = steer_flow; if (dslModemType != null) { s = m.section(form.TypedSection, 'dsl', _('DSL'));