From ac97aa196dc036c6995265b15ce89ed223d6ecd1 Mon Sep 17 00:00:00 2001 From: kiddin9 <48883331+kiddin9@users.noreply.github.com> Date: Thu, 23 Apr 2026 20:30:30 +0800 Subject: [PATCH] Add files via upload --- .github/diy/patches/luci-base.patch | 208 +++++++++++++++++++++ .github/diy/patches/luci-mod-network.patch | 12 ++ .github/diy/patches/luci-mod-status.patch | 107 +++++++++++ .github/diy/patches/luci-mod-system.patch | 48 +++++ 4 files changed, 375 insertions(+) create mode 100644 .github/diy/patches/luci-base.patch create mode 100644 .github/diy/patches/luci-mod-network.patch create mode 100644 .github/diy/patches/luci-mod-status.patch create mode 100644 .github/diy/patches/luci-mod-system.patch diff --git a/.github/diy/patches/luci-base.patch b/.github/diy/patches/luci-base.patch new file mode 100644 index 000000000..77021edac --- /dev/null +++ b/.github/diy/patches/luci-base.patch @@ -0,0 +1,208 @@ +--- a/luci-base/root/usr/share/rpcd/ucode/luci ++++ b/luci-base/root/usr/share/rpcd/ucode/luci +@@ -223,6 +223,7 @@ const methods = { + + getFeatures: { + call: function() { ++ let kernel_version = popen('echo -n `uname -r`').read('all'); + let result = { + firewall: access('/sbin/fw3') == true, + firewall4: access('/sbin/fw4') == true, +@@ -230,7 +231,7 @@ const methods = { + 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, +- fullcone: access('/sys/module/xt_FULLCONENAT/refcnt') == true || access('/sys/module/nft_fullcone/refcnt') == true, ++ fullcone: access(`/lib/modules/${kernel_version}/xt_FULLCONENAT.ko`) == true || access(`/lib/modules/${kernel_version}/nft_fullcone.ko`) == true, + br2684ctl: access('/usr/sbin/br2684ctl') == true, + swconfig: access('/sbin/swconfig') == true, + zram: access('/sys/class/zram-control') == true, + +--- a/luci-base/htdocs/luci-static/resources/network.js ++++ b/luci-base/htdocs/luci-static/resources/network.js +@@ -4376,4 +4376,10 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */ + } + }); + ++setTimeout(function(){ ++try{ ++ document.getElementsByClassName('cbi-button-apply')[0].children[3].children[0].value='1' ++}catch(err) { ++}},1000) ++ + return Network; + +--- a/luci-base/ucode/dispatcher.uc ++++ b/luci-base/ucode/dispatcher.uc +@@ -939,7 +939,12 @@ dispatch = function(_http, path) { + let cookie_name = (http.getenv('HTTPS') == 'on') ? 'sysauth_https' : 'sysauth_http', + cookie_secure = (http.getenv('HTTPS') == 'on') ? '; secure' : ''; + +- http.header('Set-Cookie', `${cookie_name}=${session.sid}; path=${build_url()}; SameSite=strict; HttpOnly${cookie_secure}`); ++ let cookie_p = uci.get('wizard', 'default', 'cookie_p'); ++ if (cookie_p == '0') { ++ http.header('Set-Cookie', `${cookie_name}=${session.sid}; path=${build_url()}; SameSite=strict; HttpOnly${cookie_secure}`); ++ } else { ++ http.header('Set-Cookie', `${cookie_name}=${session.sid}; Max-Age=2147483647; path=${build_url()}; SameSite=strict; HttpOnly${cookie_secure}`); ++ } + http.redirect(build_url(...resolved.ctx.request_path)); + + return; + +--- a/luci-base/root/www/index.html ++++ b/luci-base/root/www/index.html +@@ -15,6 +15,5 @@ + + + +- LuCI - Lua Configuration Interface + + + +--- a/luci-base/root/etc/init.d/ucitrack ++++ b/luci-base/root/etc/init.d/ucitrack +@@ -8,7 +8,7 @@ register_init() { + local init="$2" + shift; shift + +- if [ -x "$init" ] && "$init" enabled && ! grep -sqE 'USE_PROCD=.' "$init"; then ++ if [ -x "$init" ] && ! grep -sqE 'USE_PROCD=.' "$init"; then + logger -t "ucitrack" "Setting up /etc/config/$config reload trigger for non-procd $init" + procd_add_config_trigger "config.change" "$config" "$init" "$@" + fi + +--- a/luci-base/htdocs/luci-static/resources/tools/widgets.js ++++ b/luci-base/htdocs/luci-static/resources/tools/widgets.js +@@ -4,6 +4,7 @@ + 'require network'; + 'require firewall'; + 'require fs'; ++'require uci'; + + + /** +@@ -752,6 +752,81 @@ var CBIGroupSelect = form.ListValue.extend({ + }, + }); + ++var CBIWifidogxGroupSelect = form.ListValue.extend({ ++ __name__: 'CBI.WifidogxGroupSelect', ++ ++ // group_type: 1: Domain Group, 2: MAC Group ++ // add a new property to store the group type ++ group_type: '1', ++ ++ load: function(section_id) { ++ this.sappList = []; ++ var sections = uci.sections('wifidogx', 'group'); ++ ++ for (var i = 0; i < sections.length; i++) { ++ if (sections[i]['g_type'] == this.group_type) ++ this.sappList.push(sections[i]['.name']); ++ } ++ ++ return this.super('load', section_id); ++ }, ++ ++ setGroupType: function(group_type) { ++ if (group_type == 'mac') { ++ this.group_type = '2'; ++ } else if (group_type == 'wildcard') { ++ this.group_type = '3'; ++ } ++ }, ++ ++ filter: function(section_id, value) { ++ return true; ++ }, ++ ++ renderWidget: function(section_id, option_index, cfgvalue) { ++ var values = L.toArray((cfgvalue != null) ? cfgvalue : this.default), ++ choices = {}, ++ checked = {}; ++ ++ for (var i = 0; i < values.length; i++) ++ checked[values[i]] = true; ++ ++ values = []; ++ ++ if (!this.multiple && (this.rmempty || this.optional)) ++ choices[''] = E('em', _('unspecified')); ++ ++ for (var i = 0; i < this.sappList.length; i++) { ++ var name = this.sappList[i]; ++ ++ if (checked[name]) ++ values.push(name); ++ ++ choices[name] = E('span', { 'class': 'ifacebadge' }, name); ++ } ++ ++ var widget = new ui.Dropdown(this.multiple ? values : values[0], choices, { ++ id: this.cbid(section_id), ++ sort: true, ++ multiple: this.multiple, ++ optional: this.optional || this.rmempty, ++ disabled: (this.readonly != null) ? this.readonly : this.map.readonly, ++ select_placeholder: E('em', _('unspecified')), ++ display_items: this.display_size || this.size || 3, ++ dropdown_items: this.dropdown_size || this.size || 5, ++ validate: L.bind(this.validate, this, section_id), ++ create: !this.nocreate, ++ create_markup: '' + ++ '
  • ' + ++ '' + ++ '{{value}}: ('+_('create')+')' + ++ '' + ++ '
  • ' ++ }); ++ ++ return widget.render(); ++ } ++}); + + return L.Class.extend({ + ZoneSelect: CBIZoneSelect, +@@ -761,4 +836,5 @@ return L.Class.extend({ + DeviceSelect: CBIDeviceSelect, + UserSelect: CBIUserSelect, + GroupSelect: CBIGroupSelect, ++ WifidogxGroupSelect: CBIWifidogxGroupSelect, + }); + +--- a/luci-base/htdocs/luci-static/resources/validation.js ++++ b/luci-base/htdocs/luci-static/resources/validation.js +@@ -403,6 +403,14 @@ const ValidatorFactory = baseclass.extend({ + return this.assert(false, _('valid hostname')); + }, + ++ wildcard() { ++ // must start with '.', then remove it and check if it's a valid hostname ++ if (this.value[0] != '.') ++ return this.assert(false, _('valid wildcard hostname')); ++ const hostname = this.value.substr(1); ++ return this.apply('hostname', hostname); ++ }, ++ + /** + * Assert a valid UCI identifier, hostname or IP address range. + * @function LuCI.validation.ValidatorFactory.types#network + +--- a/luci-base/root/usr/share/luci/menu.d/luci-base.json ++++ b/luci-base/root/usr/share/luci/menu.d/luci-base.json +@@ -59,6 +59,15 @@ + } + }, + ++ "admin/control": { ++ "title": "Control", ++ "order": 51, ++ "action": { ++ "type": "firstchild", ++ "recurse": true ++ } ++ }, ++ + "admin/network": { + "title": "Network", + "order": 60, diff --git a/.github/diy/patches/luci-mod-network.patch b/.github/diy/patches/luci-mod-network.patch new file mode 100644 index 000000000..a93231316 --- /dev/null +++ b/.github/diy/patches/luci-mod-network.patch @@ -0,0 +1,12 @@ +--- a/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js ++++ b/luci-mod-network/htdocs/luci-static/resources/view/network/dns.js +@@ -437,6 +442,9 @@ return view.extend({ + so.rmempty = false; + so.datatype = 'ipaddr("nomask")'; + ++ so = ss.option(form.Value, 'comments', _('Comments')); ++ so.rmempty = true; ++ + const ipaddrs = {}; + + Object.keys(hosts).forEach(function(mac) { \ No newline at end of file diff --git a/.github/diy/patches/luci-mod-status.patch b/.github/diy/patches/luci-mod-status.patch new file mode 100644 index 000000000..7baf3bcf1 --- /dev/null +++ b/.github/diy/patches/luci-mod-status.patch @@ -0,0 +1,107 @@ +--- a/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js ++++ b/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js +@@ -32,8 +32,7 @@ return baseclass.extend({ + swap = L.isObject(systeminfo.swap) ? systeminfo.swap : {}; + + var fields = [ +- _('Total Available'), (mem.available) ? mem.available : (mem.total && mem.free && mem.buffered) ? mem.free + mem.buffered : null, mem.total, +- _('Used'), (mem.total && mem.free) ? (mem.total - mem.free) : null, mem.total, ++ _('Used'), (mem.total && mem.available) ? (mem.total - mem.free - mem.buffered - mem.cached) : null, mem.total, + ]; + + if (mem.buffered) +@@ -43,7 +42,7 @@ return baseclass.extend({ + fields.push(_('Cached'), mem.cached, mem.total); + + if (swap.total > 0) +- fields.push(_('Swap free'), swap.free, swap.total); ++ fields.push(_('Swap used'), swap.total - swap.free, swap.total); + + var table = E('table', { 'class': 'table' }); + + +--- a/luci-mod-status/htdocs/luci-static/resources/view/status/index.js ++++ b/luci-mod-status/htdocs/luci-static/resources/view/status/index.js +@@ -280,6 +280,7 @@ return view.extend({ + load: function() { + var includeModules = [ + { name: 'view.status.include.10_system' }, ++ { name: 'view.status.include.19_cpu' }, + { name: 'view.status.include.15_ports', title: _('Port status'), deferFirstLoad: true }, + { name: 'view.status.include.20_memory' }, + { name: 'view.status.include.25_storage' }, + +--- a/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js ++++ b/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js +@@ -33,9 +33,9 @@ var callCPUInfo = rpc.declare({ + method: 'getCPUInfo' + }); + +-var callCPUUsage = rpc.declare({ ++var callTempInfo = rpc.declare({ + object: 'luci', +- method: 'getCPUUsage' ++ method: 'getTempInfo' + }); + + return baseclass.extend({ +@@ -48,7 +48,7 @@ return baseclass.extend({ + L.resolveDefault(callSystemInfo(), {}), + L.resolveDefault(callCPUBench(), {}), + L.resolveDefault(callCPUInfo(), {}), +- L.resolveDefault(callCPUUsage(), {}), ++ L.resolveDefault(callTempInfo(), {}), + L.resolveDefault(callLuciVersion(), { revision: _('unknown version'), branch: 'LuCI' }), + L.resolveDefault(callGetUnixtime(), 0) + ]); +@@ -59,7 +59,7 @@ return baseclass.extend({ + systeminfo = data[1], + cpubench = data[2], + cpuinfo = data[3], +- cpuusage = data[4], ++ tempinfo = data[4], + luciversion = data[5], + unixtime = data[6]; + +@@ -78,8 +78,7 @@ return baseclass.extend({ + + var fields = [ + _('Hostname'), boardinfo.hostname, +- _('Model'), boardinfo.model + cpubench.cpubench, +- _('Architecture'), cpuinfo.cpuinfo || boardinfo.system, ++ _('Architecture'), (cpuinfo.cpuinfo || boardinfo.system) + ' ' + cpubench.cpubench, + _('Target Platform'), (L.isObject(boardinfo.release) ? boardinfo.release.target : ''), + _('Firmware Version'), (L.isObject(boardinfo.release) + ? '%s%s / '.format( +@@ -94,10 +93,18 @@ return baseclass.extend({ + systeminfo.load[0] / 65535.0, + systeminfo.load[1] / 65535.0, + systeminfo.load[2] / 65535.0 +- ) : null, +- _('CPU usage (%)'), cpuusage.cpuusage ++ ) : null + ]; + ++ if (tempinfo.tempinfo) { ++ fields.splice(6, 0, _('Temperature')); ++ fields.splice(7, 0, tempinfo.tempinfo); ++ } ++ if (boardinfo.model != "Default string Default string") { ++ fields.splice(2, 0, _('Model')); ++ fields.splice(3, 0, boardinfo.model); ++ } ++ + var table = E('table', { 'class': 'table' }); + + for (var i = 0; i < fields.length; i += 2) { + +--- a/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js ++++ b/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js +@@ -675,7 +675,6 @@ return view.extend({ + checkLegacyRules: function(ipt4save, ipt6save) { + if (ipt4save.match(/\n-A /) || ipt6save.match(/\n-A /)) { + ui.addNotification(_('Legacy rules detected'), [ +- E('p', _('There are legacy iptables rules present on the system. Mixing iptables and nftables rules is discouraged and may lead to incomplete traffic filtering.')), + E('button', { + 'class': 'btn cbi-button', + 'click': function() { location.href = 'nftables/iptables' } diff --git a/.github/diy/patches/luci-mod-system.patch b/.github/diy/patches/luci-mod-system.patch new file mode 100644 index 000000000..e690ea3e5 --- /dev/null +++ b/.github/diy/patches/luci-mod-system.patch @@ -0,0 +1,48 @@ +--- a/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js ++++ b/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js +@@ -101,7 +101,7 @@ return view.extend({ + /* Currently the sysupgrade rpc call will not return, hence no promise handling */ + fs.exec('/sbin/firstboot', [ '-r', '-y' ]); + +- ui.awaitReconnect('192.168.1.1', 'immortalwrt.lan'); ++ ui.awaitReconnect('10.0.0.1', 'kwrt.lan'); + }, + + handleRestore: function(ev) { +@@ -163,7 +163,7 @@ return view.extend({ + E('p', { 'class': 'spinning' }, _('The system is rebooting now. If the restored configuration changed the current LAN IP address, you might need to reconnect manually.')) + ]); + +- ui.awaitReconnect(window.location.host, '192.168.1.1', 'immortalwrt.lan'); ++ ui.awaitReconnect(window.location.host, '10.0.0.1', 'kwrt.lan'); + }, this)) + .catch(function(e) { ui.addNotification(null, E('p', e.message)) }) + .finally(function() { btn.firstChild.data = _('Upload archive...') }); +@@ -263,6 +263,7 @@ return view.extend({ + body.push(E('p', {}, E('label', { 'class': 'btn' }, [ + opts.backup_pkgs[0], ' ', _('Include in backup a list of current installed packages at /etc/backup/installed_packages.txt') + ]))); ++ opts.backup_pkgs[0].checked = true; + }; + + var cntbtn = E('button', { +@@ -304,6 +305,10 @@ return view.extend({ + opts.keep[0].addEventListener('change', function(ev) { + opts.skip_orig[0].disabled = !ev.target.checked; + opts.backup_pkgs[0].disabled = !ev.target.checked; ++ if (ev.target.checked == false){ ++ opts.skip_orig[0].checked =false ++ opts.backup_pkgs[0].checked =false ++ } + + }); + +@@ -337,7 +342,7 @@ return view.extend({ + if (opts['keep'][0].checked) + ui.awaitReconnect(window.location.host); + else +- ui.awaitReconnect('192.168.1.1', 'immortalwrt.lan'); ++ ui.awaitReconnect('10.0.0.1', 'kwrt.lan'); + }, + + handleBackupList: function(ev) {