From 1c100972ddcebb6af97525bfd7dfd4f91eca2622 Mon Sep 17 00:00:00 2001 From: sbwml Date: Sat, 10 Aug 2024 17:47:27 +0800 Subject: [PATCH] luci-app-mentohust: exclude invalid interfaces Signed-off-by: sbwml --- luci-app-mentohust/Makefile | 2 +- .../htdocs/luci-static/resources/view/mentohust.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/luci-app-mentohust/Makefile b/luci-app-mentohust/Makefile index a42c48a..d71272a 100644 --- a/luci-app-mentohust/Makefile +++ b/luci-app-mentohust/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-mentohust -PKG_VERSION:=1.0.1 +PKG_VERSION:=1.0.2 PKG_RELEASE:=1 LUCI_TITLE:=LuCI support for MentoHUST diff --git a/luci-app-mentohust/htdocs/luci-static/resources/view/mentohust.js b/luci-app-mentohust/htdocs/luci-static/resources/view/mentohust.js index 16c1b3c..ad7a5da 100644 --- a/luci-app-mentohust/htdocs/luci-static/resources/view/mentohust.js +++ b/luci-app-mentohust/htdocs/luci-static/resources/view/mentohust.js @@ -70,6 +70,11 @@ return view.extend({ o = s.option(widgets.DeviceSelect, '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 = s.option(form.Value, 'ipaddr', _('IP address'),