From a9c0a21fa313d61961a5768536645323f2776a24 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 22 Mar 2020 06:34:41 +0800 Subject: [PATCH] autocore: fix typo error --- package/lean/autocore/files/rpcd_10_system.js | 1 - package/lean/autocore/files/rpcd_luci | 55 ++++++++++--------- .../lean/autocore/files/rpcd_luci-base.json | 2 +- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/package/lean/autocore/files/rpcd_10_system.js b/package/lean/autocore/files/rpcd_10_system.js index fc0d42c061..8c1e788245 100644 --- a/package/lean/autocore/files/rpcd_10_system.js +++ b/package/lean/autocore/files/rpcd_10_system.js @@ -74,7 +74,6 @@ return L.Class.extend({ _('Hostname'), boardinfo.hostname, _('Model'), boardinfo.model + cpubench.cpubench, _('CPU Info'), cpuinfo.cpuinfo, - _('Architecture'), boardinfo.system, _('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''), _('Kernel Version'), boardinfo.kernel, _('Local Time'), datestr, diff --git a/package/lean/autocore/files/rpcd_luci b/package/lean/autocore/files/rpcd_luci index 4a3e54bbc9..2415c28e78 100755 --- a/package/lean/autocore/files/rpcd_luci +++ b/package/lean/autocore/files/rpcd_luci @@ -613,22 +613,6 @@ local methods = { end }, - getCPUUsage = { - call = function() - local sys = require "luci.sys" - local cpuusage = {} - - sys.call("/bin/getcpu &") - cpuusage.cpuusage = sys.exec("cat /tmp/cpuusage 2>/dev/null") - - if (cpuusage.cpuusage == nil) or (cpuusage.cpuusage == "") then - cpuusage.cpuusage = "2.33%" - end - - return cpuusage - end - }, - getCPUBench = { call = function() local sys = require "luci.sys" @@ -639,17 +623,6 @@ local methods = { end }, - getOnlineUsers = { - call = function() - local sys = require "luci.sys" - local onlineusers = {} - - onlineusers.onlineusers = sys.exec("cat /proc/net/arp | grep 'br-lan' | grep '0x2' | wc -l") - return onlineusers - - end - }, - getCPUInfo = { call = function() local sys = require "luci.sys" @@ -665,6 +638,22 @@ local methods = { end }, + getCPUUsage = { + call = function() + local sys = require "luci.sys" + local cpuusage = {} + + sys.call("/bin/getcpu &") + cpuusage.cpuusage = sys.exec("cat /tmp/cpuusage 2>/dev/null") + + if (cpuusage.cpuusage == nil) or (cpuusage.cpuusage == "") then + cpuusage.cpuusage = "2.33%" + end + + return cpuusage + end + }, + getETHInfo = { call = function() local sys = require "luci.sys" @@ -686,6 +675,18 @@ local methods = { fd:close() return { ethinfo = rv } end + }, + + getOnlineUsers = { + call = function() + local sys = require "luci.sys" + local onlineusers = {} + + onlineusers.onlineusers = sys.exec("cat /proc/net/arp | grep 'br-lan' | grep '0x2' | wc -l") + return onlineusers + + end + } } local function parseInput() diff --git a/package/lean/autocore/files/rpcd_luci-base.json b/package/lean/autocore/files/rpcd_luci-base.json index 4d9eaa0ab1..0ff3c22e98 100644 --- a/package/lean/autocore/files/rpcd_luci-base.json +++ b/package/lean/autocore/files/rpcd_luci-base.json @@ -61,7 +61,7 @@ "ubus": { "file": [ "list", "read", "stat" ], "iwinfo": [ "assoclist", "freqlist", "txpowerlist", "countrylist" ], - "luci": [ "getConntrackList", "getInitList", "getLocaltime", "getProcessList", "getRealtimeStats", "getTimezones", "getLEDs", "getUSBDevices", "getSwconfigFeatures", "getSwconfigPortState", "getBlockDevices", "getMountPoints", "getCPUBench", "getCPUUsage", "getOnlineUsers", "getETHInfo" ], + "luci": [ "getConntrackList", "getInitList", "getLocaltime", "getProcessList", "getRealtimeStats", "getTimezones", "getLEDs", "getUSBDevices", "getSwconfigFeatures", "getSwconfigPortState", "getBlockDevices", "getMountPoints", "getCPUBench", "getCPUInfo", "getCPUUsage", "getETHInfo", "getOnlineUsers" ], "luci-rpc": [ "getBoardJSON", "getDHCPLeases", "getDSLStatus", "getDUIDHints", "getHostHints", "getNetworkDevices", "getWirelessDevices" ], "network.interface": [ "dump" ], "network.rrdns": [ "lookup" ],