diff --git a/modules/luci-base/root/usr/share/rpcd/ucode/luci b/modules/luci-base/root/usr/share/rpcd/ucode/luci index 26fd3b0e5b..de3ca20b8d 100644 --- a/modules/luci-base/root/usr/share/rpcd/ucode/luci +++ b/modules/luci-base/root/usr/share/rpcd/ucode/luci @@ -196,6 +196,8 @@ const methods = { firewall: access('/sbin/fw3') == true, firewall4: access('/sbin/fw4') == true, opkg: access('/bin/opkg') == true, + bonding: access('/sys/module/bonding'), + mii-tool: access('/usr/sbin/mii-tool'), offloading: access('/sys/module/xt_FLOWOFFLOAD/refcnt') == true || access('/sys/module/nft_flow_offload/refcnt') == true, br2684ctl: access('/usr/sbin/br2684ctl') == true, swconfig: access('/sbin/swconfig') == true, diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js index 4e664a800e..e7bfd59fde 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js @@ -450,10 +450,14 @@ return baseclass.extend({ s.tab('brport', _('Bridge port specific options')); s.tab('bridgevlan', _('Bridge VLAN filtering')); - o = this.replaceOption(s, 'devgeneral', form.ListValue, 'type', _('Device type')); + o = this.replaceOption(s, 'devgeneral', form.ListValue, 'type', _('Device type'), + !L.hasSystemFeature('bonding') && isNew ? ''+ + _('For bonding, install %s').format('kmod-bonding') + '' : null); o.readonly = !isNew; o.value('', _('Network device')); - o.value('bonding', _('Aggregation device')); + if (L.hasSystemFeature('bonding')) { + o.value('bonding', _('Bonding/Aggregation device')); + } o.value('bridge', _('Bridge device')); o.value('8021q', _('VLAN (802.1q)')); o.value('8021ad', _('VLAN (802.1ad)')); @@ -864,7 +868,9 @@ return baseclass.extend({ }; o.depends('type', 'bonding'); - o = this.replaceOption(s, 'devadvanced', form.ListValue, 'monitor_mode', _('Link monitoring mode')); + o = this.replaceOption(s, 'devadvanced', form.ListValue, 'monitor_mode', _('Link monitoring mode'), + !L.hasSystemFeature('mii-tool') ? ''+ + _('Install %s').format('mii-tool') + '' : null); o.default = ''; o.value('arp', _('ARP link monitoring')); o.value('mii', _('MII link monitoring'));