Update luci-mod-status.patch

This commit is contained in:
kiddin9 authored and GitHub committed 2026-09-14 23:28:05 +08:00
1 parent 20ded69afb
commit 0603b094cf
1 file changed
+11 -48
+11 -48
View File
@@ -1,16 +1,14 @@
--- a/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js --- 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 +++ b/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
@@ -32,8 +32,7 @@ return baseclass.extend({ @@ -36,14 +36,14 @@ return baseclass.extend({
swap = L.isObject(systeminfo.swap) ? systeminfo.swap : {}; available = Math.min(mem.total ?? Infinity, Math.max(0, available + (mem.buffered || 0)));
var fields = [ var fields = [
- _('Total Available'), (mem.available) ? mem.available : (mem.total && mem.free && mem.buffered) ? mem.free + mem.buffered : null, mem.total, - _('Total Available'), available, mem.total,
- _('Used'), (mem.total && mem.free) ? (mem.total - mem.free) : null, mem.total, + _('Used'), (mem.total && mem.available) ? (mem.total - available): null, mem.total,
+ _('Used'), (mem.total && mem.available) ? (mem.total - mem.free - mem.buffered - mem.cached) : null, mem.total,
]; ];
if (mem.buffered) if (mem.cached)
@@ -43,7 +42,7 @@ return baseclass.extend({
fields.push(_('Cached'), mem.cached, mem.total); fields.push(_('Cached'), mem.cached, mem.total);
if (swap.total > 0) if (swap.total > 0)
@@ -33,37 +31,7 @@
--- a/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js --- 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 +++ b/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
@@ -33,9 +33,9 @@ var callCPUInfo = rpc.declare({ @@ -85,10 +85,9 @@ return baseclass.extend({
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,15 +78,9 @@ return baseclass.extend({
var fields = [ var fields = [
_('Hostname'), boardinfo.hostname, _('Hostname'), boardinfo.hostname,
@@ -72,16 +40,11 @@
+ _('Architecture'), (cpuinfo.cpuinfo || boardinfo.system) + ' ' + cpubench.cpubench, + _('Architecture'), (cpuinfo.cpuinfo || boardinfo.system) + ' ' + cpubench.cpubench,
_('Target Platform'), (L.isObject(boardinfo.release) ? boardinfo.release.target : ''), _('Target Platform'), (L.isObject(boardinfo.release) ? boardinfo.release.target : ''),
- _('Firmware Version'), (L.isObject(boardinfo.release) - _('Firmware Version'), (L.isObject(boardinfo.release)
- ? '%s%s / '.format(
- boardinfo.release.description || '',
- boardinfo.release.revision ? boardinfo.release.revision : ''
- )
- : '') + (luciversion || ''),
+ _('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''), + _('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''),
_('Kernel Version'), boardinfo.kernel, ? '%s%s / '.format(
_('Local Time'), datestr, boardinfo.release.description || '',
_('Uptime'), systeminfo.uptime ? '%t'.format(systeminfo.uptime) : null, boardinfo.release.revision ? boardinfo.release.revision : ''
@@ -94,10 +88,18 @@ return baseclass.extend({ @@ -101,10 +100,18 @@ return baseclass.extend({
systeminfo.load[0] / 65535.0, systeminfo.load[0] / 65535.0,
systeminfo.load[1] / 65535.0, systeminfo.load[1] / 65535.0,
systeminfo.load[2] / 65535.0 systeminfo.load[2] / 65535.0
@@ -90,7 +53,7 @@
+ ) : null + ) : null
]; ];
+ if (tempinfo.tempinfo) { + if (cpuusage.tempinfo) {
+ fields.splice(6, 0, _('Temperature')); + fields.splice(6, 0, _('Temperature'));
+ fields.splice(7, 0, tempinfo.tempinfo); + fields.splice(7, 0, tempinfo.tempinfo);
+ } + }