mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-08 10:23:47 +08:00
autocore: remove 10_system hack
It's now merged into luci feed. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
parent
08b6c139d5
commit
79f50ce7df
@ -38,11 +38,8 @@ define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/autocore/install/Default
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/generic/10_system.js $(1)/etc/rpcd_10_system.js
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/generic/090-cover-index_files $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/generic/60-autocore-reload-rpcd $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) ./files/generic/cpuinfo $(1)/sbin/
|
||||
|
@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ ! -f '/etc/rpcd_10_system.js' ] || \
|
||||
mv -f '/etc/rpcd_10_system.js' '/www/luci-static/resources/view/status/include/10_system.js'
|
||||
/etc/init.d/rpcd restart
|
||||
|
||||
exit 0
|
@ -1,114 +0,0 @@
|
||||
'use strict';
|
||||
'require baseclass';
|
||||
'require fs';
|
||||
'require rpc';
|
||||
|
||||
var callSystemBoard = rpc.declare({
|
||||
object: 'system',
|
||||
method: 'board'
|
||||
});
|
||||
|
||||
var callSystemInfo = rpc.declare({
|
||||
object: 'system',
|
||||
method: 'info'
|
||||
});
|
||||
|
||||
var callCPUBench = rpc.declare({
|
||||
object: 'luci',
|
||||
method: 'getCPUBench'
|
||||
});
|
||||
|
||||
var callCPUInfo = rpc.declare({
|
||||
object: 'luci',
|
||||
method: 'getCPUInfo'
|
||||
});
|
||||
|
||||
var callCPUUsage = rpc.declare({
|
||||
object: 'luci',
|
||||
method: 'getCPUUsage'
|
||||
});
|
||||
|
||||
var callTempInfo = rpc.declare({
|
||||
object: 'luci',
|
||||
method: 'getTempInfo'
|
||||
});
|
||||
|
||||
return baseclass.extend({
|
||||
title: _('System'),
|
||||
|
||||
load: function() {
|
||||
return Promise.all([
|
||||
L.resolveDefault(callSystemBoard(), {}),
|
||||
L.resolveDefault(callSystemInfo(), {}),
|
||||
L.resolveDefault(callCPUBench(), {}),
|
||||
L.resolveDefault(callCPUInfo(), {}),
|
||||
L.resolveDefault(callCPUUsage(), {}),
|
||||
L.resolveDefault(callTempInfo(), {}),
|
||||
fs.lines('/usr/lib/lua/luci/version.lua')
|
||||
]);
|
||||
},
|
||||
|
||||
render: function(data) {
|
||||
var boardinfo = data[0],
|
||||
systeminfo = data[1],
|
||||
cpubench = data[2],
|
||||
cpuinfo = data[3],
|
||||
cpuusage = data[4],
|
||||
tempinfo = data[5],
|
||||
luciversion = data[6];
|
||||
|
||||
luciversion = luciversion.filter(function(l) {
|
||||
return l.match(/^\s*(luciname|luciversion)\s*=/);
|
||||
}).map(function(l) {
|
||||
return l.replace(/^\s*\w+\s*=\s*['"]([^'"]+)['"].*$/, '$1');
|
||||
}).join(' ');
|
||||
|
||||
var datestr = null;
|
||||
|
||||
if (systeminfo.localtime) {
|
||||
var date = new Date(systeminfo.localtime * 1000);
|
||||
|
||||
datestr = '%04d-%02d-%02d %02d:%02d:%02d'.format(
|
||||
date.getUTCFullYear(),
|
||||
date.getUTCMonth() + 1,
|
||||
date.getUTCDate(),
|
||||
date.getUTCHours(),
|
||||
date.getUTCMinutes(),
|
||||
date.getUTCSeconds()
|
||||
);
|
||||
}
|
||||
|
||||
var fields = [
|
||||
_('Hostname'), boardinfo.hostname,
|
||||
_('Model'), boardinfo.model + cpubench.cpubench,
|
||||
_('Architecture'), cpuinfo.cpuinfo,
|
||||
_('Target Platform'), (L.isObject(boardinfo.release) ? boardinfo.release.target : ''),
|
||||
_('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''),
|
||||
_('Kernel Version'), boardinfo.kernel,
|
||||
_('Local Time'), datestr,
|
||||
_('Uptime'), systeminfo.uptime ? '%t'.format(systeminfo.uptime) : null,
|
||||
_('Load Average'), Array.isArray(systeminfo.load) ? '%.2f, %.2f, %.2f'.format(
|
||||
systeminfo.load[0] / 65535.0,
|
||||
systeminfo.load[1] / 65535.0,
|
||||
systeminfo.load[2] / 65535.0
|
||||
) : null,
|
||||
_('CPU usage (%)'), cpuusage.cpuusage
|
||||
];
|
||||
|
||||
if (tempinfo.tempinfo) {
|
||||
fields.splice(6, 0, _('Temperature'));
|
||||
fields.splice(7, 0, tempinfo.tempinfo);
|
||||
}
|
||||
|
||||
var table = E('table', { 'class': 'table' });
|
||||
|
||||
for (var i = 0; i < fields.length; i += 2) {
|
||||
table.appendChild(E('tr', { 'class': 'tr' }, [
|
||||
E('td', { 'class': 'td left', 'width': '33%' }, [ fields[i] ]),
|
||||
E('td', { 'class': 'td left' }, [ (fields[i + 1] != null) ? fields[i + 1] : '?' ])
|
||||
]));
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
});
|
5
package/emortal/autocore/files/generic/60-autocore-reload-rpcd
Executable file
5
package/emortal/autocore/files/generic/60-autocore-reload-rpcd
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
/etc/init.d/rpcd restart
|
||||
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user