From 5538caa25c4646547ea39a4a653af5a818bdcf97 Mon Sep 17 00:00:00 2001 From: gitea-action Date: Thu, 10 Oct 2024 20:00:12 +0800 Subject: [PATCH] luci-app-mihomo: sync upstream last commit: https://github.com/morytyann/OpenWrt-mihomo/commit/f0b2af8b5a2d76d1d09c504efdfe410092772c2a --- luci-app-mihomo/Makefile | 2 +- .../resources/view/mihomo/config.js | 31 ++++++++++++------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/luci-app-mihomo/Makefile b/luci-app-mihomo/Makefile index ce2b2a515..5ff816c4f 100644 --- a/luci-app-mihomo/Makefile +++ b/luci-app-mihomo/Makefile @@ -1,6 +1,6 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.8.5 +PKG_VERSION:=1.8.6 LUCI_TITLE:=LuCI Support for mihomo LUCI_DEPENDS:=+luci-base +mihomo diff --git a/luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js b/luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js index 8264a638b..c8b92be56 100644 --- a/luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js +++ b/luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js @@ -232,6 +232,7 @@ return view.extend({ s = m.section(form.TableSection, 'subscription', _('Subscription Config')); s.addremove = true; s.anonymous = true; + s.sortable = true; o = s.option(form.Value, 'name', _('Subscription Name')); o.rmempty = false; @@ -241,7 +242,7 @@ return view.extend({ o.rmempty = false; o = s.option(form.Value, 'user_agent', _('User Agent')); - o.default = 'mihomo'; + o.default = 'clash'; o.rmempty = false; o.width = '15%'; o.value('mihomo'); @@ -276,11 +277,11 @@ return view.extend({ o.rmempty = false; o = s.taboption('general', form.Value, 'tcp_keep_alive_idle', _('TCP Keep Alive Idle')); - o.datatype = 'integer'; + o.datatype = 'uinteger'; o.placeholder = '600'; o = s.taboption('general', form.Value, 'tcp_keep_alive_interval', _('TCP Keep Alive Interval')); - o.datatype = 'integer'; + o.datatype = 'uinteger'; o.placeholder = '15'; s.tab('external_control', _('External Control Config')); @@ -336,8 +337,9 @@ return view.extend({ o.retain = true; o.depends('authentication', '1'); - o.subsection.anonymous = true; o.subsection.addremove = true; + o.subsection.anonymous = true; + o.subsection.sortable = true; so = o.subsection.option(form.Flag, 'enabled', _('Enable')); so.rmempty = false; @@ -356,13 +358,16 @@ return view.extend({ o.value('mixed', 'Mixed'); o = s.taboption('tun', form.Value, 'tun_mtu', '*' + ' ' + _('MTU')); + o.datatype = 'uinteger'; o.placeholder = '9000'; o = s.taboption('tun', form.Flag, 'tun_gso', '*' + ' ' + _('GSO')); o.rmempty = false; o = s.taboption('tun', form.Value, 'tun_gso_max_size', '*' + ' ' + _('GSO Max Size')); + o.datatype = 'uinteger'; o.placeholder = '65536'; + o.retain = true; o.depends('tun_gso', '1'); o = s.taboption('tun', form.Flag, 'tun_endpoint_independent_nat', '*' + ' ' + _('Endpoint Independent NAT')); @@ -374,12 +379,12 @@ return view.extend({ o.datatype = 'port'; o.placeholder = '1053'; - o = s.taboption('dns', form.ListValue, 'dns_mode', _('DNS Mode')); + o = s.taboption('dns', form.ListValue, 'dns_mode', '*' + ' ' + _('DNS Mode')); o.value('normal', 'Normal'); o.value('fake-ip', 'Fake-IP'); o.value('redir-host', 'Redir-Host'); - o = s.taboption('dns', form.Value, 'fake_ip_range', _('Fake-IP Range')); + o = s.taboption('dns', form.Value, 'fake_ip_range', '*' + ' ' + _('Fake-IP Range')); o.datatype = 'cidr4'; o.placeholder = '198.18.0.1/16'; o.retain = true; @@ -395,6 +400,7 @@ return view.extend({ o.depends({ 'dns_mode': 'fake-ip', 'fake_ip_filter': '1' }); o = s.taboption('dns', form.ListValue, 'fake_ip_filter_mode', _('Fake-IP Filter Mode')) + o.retain = true; o.value('blacklist', _('Block Mode')); o.value('whitelist', _('Allow Mode')); o.depends({ 'dns_mode': 'fake-ip', 'fake_ip_filter': '1' }); @@ -426,8 +432,9 @@ return view.extend({ o.retain = true; o.depends('hosts', '1'); - o.subsection.anonymous = true; o.subsection.addremove = true; + o.subsection.anonymous = true; + o.subsection.sortable = true; so = o.subsection.option(form.Flag, 'enabled', _('Enable')); so.rmempty = false; @@ -444,16 +451,17 @@ return view.extend({ o.retain = true; o.depends('dns_nameserver', '1'); + o.subsection.addremove = true; o.subsection.anonymous = true; - o.subsection.addremove = false; + o.subsection.sortable = true; so = o.subsection.option(form.Flag, 'enabled', _('Enable')); so.rmempty = false; so = o.subsection.option(form.ListValue, 'type', _('Type')); - so.readonly = true; so.value('default-nameserver'); so.value('proxy-server-nameserver'); + so.value('direct-nameserver'); so.value('nameserver'); so.value('fallback'); @@ -466,8 +474,9 @@ return view.extend({ o.retain = true; o.depends('dns_nameserver_policy', '1'); - o.subsection.anonymous = true; o.subsection.addremove = true; + o.subsection.anonymous = true; + o.subsection.sortable = true; so = o.subsection.option(form.Flag, 'enabled', _('Enable')); so.rmempty = false; @@ -503,7 +512,7 @@ return view.extend({ o.rmempty = false; o = s.taboption('geox', form.Value, 'geox_update_interval', _('GeoX Update Interval'), _('Hour')); - o.datatype = 'integer'; + o.datatype = 'uinteger'; o.placeholder = '24'; o.retain = true; o.depends('geox_auto_update', '1');