update 2026-05-10 09:48:30

This commit is contained in:
action committed 2026-05-10 09:48:30 +08:00
1 parent 95ac96413e
commit 0b362674f1
6244 files changed
+2992248

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 gSpotx2f
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+19
View File
@@ -0,0 +1,19 @@
#
# Copyright (C) 2025 gSpot (https://github.com/gSpotx2f/luci-app-cpu-status-mini)
#
# This is free software, licensed under the MIT License.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-cpu-status-mini
PKG_VERSION:=0.2.0
PKG_RELEASE:=1
LUCI_TITLE:=CPU utilization info for the LuCI status page
LUCI_PKGARCH:=all
PKG_LICENSE:=MIT
#include ../../luci.mk
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
+38
View File
@@ -0,0 +1,38 @@
# luci-app-cpu-status-mini
CPU utilization info for the LuCI status page (OpenWrt webUI).
OpenWrt >= 21.02.
Advanced version: [luci-app-cpu-status](https://github.com/gSpotx2f/luci-app-cpu-status).
## Installation notes
**OpenWrt >= 25.12:**
wget --no-check-certificate -O /tmp/luci-app-cpu-status-mini-0.2.0-r1.apk https://github.com/gSpotx2f/packages-openwrt/raw/master/25.12/luci-app-cpu-status-mini-0.2.0-r1.apk
apk --allow-untrusted add /tmp/luci-app-cpu-status-mini-0.2.0-r1.apk
rm /tmp/luci-app-cpu-status-mini-0.2.0-r1.apk
service rpcd reload
i18n-ru:
wget --no-check-certificate -O /tmp/luci-i18n-cpu-status-mini-ru-0.2.0-r1.apk https://github.com/gSpotx2f/packages-openwrt/raw/master/25.12/luci-i18n-cpu-status-mini-ru-0.2.0-r1.apk
apk --allow-untrusted add /tmp/luci-i18n-cpu-status-mini-ru-0.2.0-r1.apk
rm /tmp/luci-i18n-cpu-status-mini-ru-0.2.0-r1.apk
**OpenWrt <= 24.10:**
wget --no-check-certificate -O /tmp/luci-app-cpu-status-mini_0.2.0-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/24.10/luci-app-cpu-status-mini_0.2.0-r1_all.ipk
opkg install /tmp/luci-app-cpu-status-mini_0.2.0-r1_all.ipk
rm /tmp/luci-app-cpu-status-mini_0.2.0-r1_all.ipk
service rpcd reload
i18n-ru:
wget --no-check-certificate -O /tmp/luci-i18n-cpu-status-mini-ru_0.2.0-r1_all.ipk https://github.com/gSpotx2f/packages-openwrt/raw/master/24.10/luci-i18n-cpu-status-mini-ru_0.2.0-r1_all.ipk
opkg install /tmp/luci-i18n-cpu-status-mini-ru_0.2.0-r1_all.ipk
rm /tmp/luci-i18n-cpu-status-mini-ru_0.2.0-r1_all.ipk
## Screenshots:
![](https://github.com/gSpotx2f/luci-app-cpu-status-mini/blob/master/screenshots/01.jpg)
@@ -0,0 +1,58 @@
'use strict';
'require baseclass';
'require fs';
return baseclass.extend({
title : _('CPU Load'),
cpuStatLast: null,
load() {
return L.resolveDefault(fs.read('/proc/stat'), null);
},
render(cpuData) {
if(!cpuData) return;
let cpuStat = null;
let statItemsArray = cpuData.trim().split('\n').filter(s => s.startsWith('cpu'));
for(let str of statItemsArray) {
let arr = str.split(/\s+/).slice(0, 8);
if(arr[0] === 'cpu') {
arr[0] = 0;
arr = arr.map(e => Number(e));
cpuStat = [
arr[1] + arr[2] + arr[3] + arr[5] + arr[6] + arr[7],
arr[4],
];
};
};
let cpuTable = E('table', { 'class': 'table' });
let loadAvg = 0;
if(this.cpuStatLast !== null) {
let idle = cpuStat[1] - this.cpuStatLast[1];
let sum = cpuStat[0] - this.cpuStatLast[0];
loadAvg = Math.round(100 * sum / (sum + idle));
};
cpuTable.append(
E('tr', { 'class': 'tr' }, [
E('td', { 'class': 'td left', 'width': '33%' }, _('Total Load')),
E('td', { 'class': 'td' },
E('div', {
'class': 'cbi-progressbar',
'title': (this.cpuStatLast !== null) ? loadAvg + '%' : _('Calculating') + '...',
},
E('div', { 'style': 'width:' + loadAvg + '%' })
)
),
])
);
this.cpuStatLast = cpuStat;
return cpuTable;
},
});
@@ -0,0 +1,22 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
"Language: ru\n"
msgid "Calculating"
msgstr "Вычисление"
msgid "CPU Load"
msgstr "Загрузка ЦПУ"
msgid "Total Load"
msgstr "Общая загрузка"
@@ -0,0 +1,11 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "Calculating"
msgstr ""
msgid "CPU Load"
msgstr ""
msgid "Total Load"
msgstr ""
@@ -0,0 +1,10 @@
{
"luci-app-cpu-status": {
"description": "Grant access to cpu-status procedures",
"read": {
"file": {
"/proc/stat": [ "read" ]
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB