From aa5f30b70b102896142276ba9ffaf8dc428e8c33 Mon Sep 17 00:00:00 2001 From: kiddin9 <48883331+kiddin9@users.noreply.github.com> Date: Mon, 28 Sep 2026 19:17:52 +0800 Subject: [PATCH] Update luci-mod-status.patch --- .github/diy/patches/luci-mod-status.patch | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/diy/patches/luci-mod-status.patch b/.github/diy/patches/luci-mod-status.patch index b7670dd15..5a8cce7c8 100644 --- a/.github/diy/patches/luci-mod-status.patch +++ b/.github/diy/patches/luci-mod-status.patch @@ -1,3 +1,50 @@ +--- a/luci-mod-status/htdocs/luci-static/resources/view/status/index.js ++++ b/luci-mod-status/htdocs/luci-static/resources/view/status/index.js +@@ -2,6 +2,7 @@ + 'require view'; + 'require dom'; + 'require poll'; ++'require fs'; + 'require network'; + 'require ui'; + +@@ -278,27 +279,14 @@ 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' }, +- { name: 'view.status.include.30_network' }, +- { name: 'view.status.include.40_dhcp', title: _('Online Hosts'), deferFirstLoad: true }, +- { name: 'view.status.include.50_dsl' }, +- { name: 'view.status.include.60_wifi' } +- ]; +- +- return Promise.all(includeModules.map(L.bind(function(spec) { +- if (spec.deferFirstLoad) +- return this.wrapDeferredInclude(spec); +- +- return L.resolveDefault(L.require(spec.name), null); +- }, this))).then(function(includes) { +- return includes.filter(function(include) { +- return include != null; +- }); ++ return L.resolveDefault(fs.list('/www' + L.resource('view/status/include')), []).then(function(entries) { ++ return Promise.all(entries.filter(function(e) { ++ return (e.type == 'file' && e.name.match(/\.js$/)); ++ }).map(function(e) { ++ return 'view.status.include.' + e.name.replace(/\.js$/, ''); ++ }).sort().map(function(n) { ++ return L.require(n); ++ })); + }); + }, + + --- 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 @@ -36,14 +36,14 @@ return baseclass.extend({