luci-app-mentohust: exclude invalid interfaces

Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
sbwml 2024-08-10 17:47:27 +08:00
parent 6e008735b9
commit 1c100972dd
2 changed files with 6 additions and 1 deletions

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-mentohust PKG_NAME:=luci-app-mentohust
PKG_VERSION:=1.0.1 PKG_VERSION:=1.0.2
PKG_RELEASE:=1 PKG_RELEASE:=1
LUCI_TITLE:=LuCI support for MentoHUST LUCI_TITLE:=LuCI support for MentoHUST

View File

@ -70,6 +70,11 @@ return view.extend({
o = s.option(widgets.DeviceSelect, 'interface', o = s.option(widgets.DeviceSelect, 'interface',
_('Network interface')); _('Network interface'));
o.filter = function(section_id, value) {
var dev = this.devices.filter(function(dev) { return dev.getName() == value })[0];
var excludeDevice = ['docker', 'dummy', 'radio', 'sit', 'teql', 'veth', 'ztly'];
return (dev && dev.getName() != null && !excludeDevice.some(prefix => dev.getName().startsWith(prefix)));
}
o.rmempty = false; o.rmempty = false;
o = s.option(form.Value, 'ipaddr', _('IP address'), o = s.option(form.Value, 'ipaddr', _('IP address'),