1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
This commit is contained in:
suyuan 2023-06-23 07:46:40 +08:00
parent 6491ff86a7
commit 0b87211f9a
22 changed files with 0 additions and 17782 deletions

View file

@ -1,16 +0,0 @@
# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2021 ImmortalWrt.org
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for CPU Freq Setting
LUCI_DEPENDS:=@(arm||aarch64)
PKG_NAME:=luci-app-cpufreq
PKG_VERSION:=1
PKG_RELEASE:=$(COMMITCOUNT)
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View file

@ -1,11 +0,0 @@
module("luci.controller.cpufreq", package.seeall)
function index()
if not nixio.fs.access("/etc/config/cpufreq") then
return
end
local page = entry({"admin", "system", "cpufreq"}, cbi("cpufreq"), _("CPU Freq"), 90)
page.dependent = false
page.acl_depends = { "luci-app-cpufreq" }
end

View file

@ -1,68 +0,0 @@
local fs = require "nixio.fs"
function string.split(input, delimiter)
input = tostring(input)
delimiter = tostring(delimiter)
if (delimiter=='') then return false end
local pos,arr = 0, {}
for st,sp in function() return string.find(input, delimiter, pos, true) end do
table.insert(arr, string.sub(input, pos, st - 1))
pos = sp + 1
end
table.insert(arr, string.sub(input, pos))
return arr
end
mp = Map("cpufreq", translate("CPU Freq Settings"))
mp.description = translate("Set CPU Scaling Governor to Max Performance or Balance Mode")
s = mp:section(NamedSection, "cpufreq", "settings")
s.anonymouse = true
local policy_nums = luci.sys.exec("echo -n $(find /sys/devices/system/cpu/cpufreq/policy* -maxdepth 0 | grep -Eo '[0-9]+')")
for _, policy_num in ipairs(string.split(policy_nums, " ")) do
if not fs.access("/sys/devices/system/cpu/cpufreq/policy" .. policy_num .. "/scaling_available_frequencies") then return end
cpu_freqs = fs.readfile("/sys/devices/system/cpu/cpufreq/policy" .. policy_num .. "/scaling_available_frequencies")
cpu_freqs = string.sub(cpu_freqs, 1, -3)
cpu_governors = fs.readfile("/sys/devices/system/cpu/cpufreq/policy" .. policy_num .. "/scaling_available_governors")
cpu_governors = string.sub(cpu_governors, 1, -3)
freq_array = string.split(cpu_freqs, " ")
governor_array = string.split(cpu_governors, " ")
s:tab(policy_num, translate("Policy " .. policy_num))
governor = s:taboption(policy_num, ListValue, "governor" .. policy_num, translate("CPU Scaling Governor"))
for _, e in ipairs(governor_array) do
if e ~= "" then governor:value(e, translate(e, string.upper(e))) end
end
minfreq = s:taboption(policy_num, ListValue, "minfreq" .. policy_num, translate("Min Idle CPU Freq"))
for _, e in ipairs(freq_array) do
if e ~= "" then minfreq:value(e) end
end
maxfreq = s:taboption(policy_num, ListValue, "maxfreq" .. policy_num, translate("Max Turbo Boost CPU Freq"))
for _, e in ipairs(freq_array) do
if e ~= "" then maxfreq:value(e) end
end
sdfactor = s:taboption(policy_num, Value, "sdfactor" .. policy_num, translate("CPU Switching Sampling rate"))
sdfactor.datatype="range(1,100000)"
sdfactor.description = translate("The sampling rate determines how frequently the governor checks to tune the CPU (ms)")
sdfactor.placeholder = 10
sdfactor.default = 10
sdfactor:depends("governor" .. policy_num, "ondemand")
upthreshold = s:taboption(policy_num, Value, "upthreshold" .. policy_num, translate("CPU Switching Threshold"))
upthreshold.datatype="range(1,99)"
upthreshold.description = translate("Kernel make a decision on whether it should increase the frequency (%)")
upthreshold.placeholder = 50
upthreshold.default = 50
upthreshold:depends("governor" .. policy_num, "ondemand")
end
return mp

View file

@ -1,32 +0,0 @@
msgid "CPU Freq"
msgstr "CPU 性能优化调节"
msgid "CPU Freq Settings"
msgstr "CPU 性能优化调节设置"
msgid "Set CPU Scaling Governor to Max Performance or Balance Mode"
msgstr "设置路由器的 CPU 性能模式(高性能/均衡省电)"
msgid "CPU Scaling Governor"
msgstr "CPU 工作模式"
msgid "CPU Freq from 48000 to 716000 (Khz)"
msgstr "CPU 频率范围为 48000 到 716000 (Khz)"
msgid "Min Idle CPU Freq"
msgstr "待机 CPU 最小频率"
msgid "Max Turbo Boost CPU Freq"
msgstr "最大 Turbo Boost CPU 频率"
msgid "CPU Switching Sampling rate"
msgstr "CPU 切换周期"
msgid "The sampling rate determines how frequently the governor checks to tune the CPU (ms)"
msgstr "CPU 检查切换的周期 (ms)。注意:过于频繁的切换频率会引起网络延迟抖动"
msgid "CPU Switching Threshold"
msgstr "CPU 切换频率触发阈值"
msgid "Kernel make a decision on whether it should increase the frequency (%)"
msgstr "当 CPU 占用率超过 (%) 的情况下触发内核切换频率"

View file

@ -1,3 +0,0 @@
config settings 'cpufreq'

View file

@ -1,27 +0,0 @@
#!/bin/sh /etc/rc.common
START=15
NAME="cpufreq"
config_get_cpufreq()
{
config_get "$NAME" "$1"
}
start()
{
config_load "$NAME"
for i in $(find /sys/devices/system/cpu/cpufreq/policy* -maxdepth 0 | grep -Eo '[0-9]+')
do
[ -z "$(config_get_cpufreq "governor$i")" ] && return
config_get_cpufreq "governor$i" > "/sys/devices/system/cpu/cpufreq/policy$i/scaling_governor"
config_get_cpufreq "minfreq$i" > "/sys/devices/system/cpu/cpufreq/policy$i/scaling_min_freq"
config_get_cpufreq "maxfreq$i" > "/sys/devices/system/cpu/cpufreq/policy$i/scaling_max_freq"
if [ "$(config_get_cpufreq "governor$i")" = "ondemand" ]; then
config_get_cpufreq "sdfactor$i" > "/sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor"
config_get_cpufreq "upthreshold$i" > "/sys/devices/system/cpu/cpufreq/ondemand/up_threshold"
fi
done
}

View file

@ -1,104 +0,0 @@
#!/bin/sh
uci_write_config() {
uci -q set cpufreq.cpufreq.governor$1="$2"
uci -q set cpufreq.cpufreq.minfreq$1="$3"
uci -q set cpufreq.cpufreq.maxfreq$1="$4"
[ -n "$5" ] && uci -q set cpufreq.cpufreq.sdfactor$1="$5"
[ -n "$6" ] && uci -q set cpufreq.cpufreq.upthreshold$1="$6"
uci -q commit cpufreq
}
CPU_FREQS="$(cat '/sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies')"
CPU_POLICYS="$(find '/sys/devices/system/cpu/cpufreq/policy'* -maxdepth 0 | grep -Eo '[0-9]+')"
source "/etc/openwrt_release"
case "$DISTRIB_TARGET" in
"bcm27xx/bcm2710")
uci_write_config 0 ondemand 600000 1200000 10 50
;;
"bcm27xx/bcm2711")
uci_write_config 0 ondemand 600000 1500000 10 50
;;
"ipq40xx/generic")
uci_write_config 0 ondemand 200000 716000 10 50
;;
"ipq60xx/generic")
if echo "$CPU_FREQS" | grep -q "1800000"; then
# IPQ6010/18/28
CPU_MAX_FREQ="1800000"
else
# IPQ6000
CPU_MAX_FREQ="1200000"
fi
uci_write_config 0 ondemand 864000 $CPU_MAX_FREQ 10 50
;;
"ipq806x/generic")
if echo "$CPU_FREQS" | grep -q "1725000"; then
# IPQ8065
CPU_MAX_FREQ="1725000"
elif echo "$CPU_FREQS" | grep -q "1400000"; then
# IPQ8064
CPU_MAX_FREQ="1400000"
else
# IPQ8062
CPU_MAX_FREQ="1000000"
fi
uci_write_config 0 ondemand 600000 $CPU_MAX_FREQ 10 50
# IPQ8064/5
echo "$CPU_POLICYS" | grep -q "1" && uci_write_config 1 ondemand 600000 1200000 10 50
;;
"ipq807x/generic")
if echo "$CPU_FREQS" | grep -q "2208000"; then
# IPQ8072/4/6/8A
CPU_MAX_FREQ="2208000"
else
# IPQ8071A
CPU_MAX_FREQ="1382400"
fi
uci_write_config 0 ondemand 1017600 $CPU_MAX_FREQ 10 50
;;
"mediatek/mt7622")
uci_write_config 0 ondemand 600000 1350000 10 50
;;
"meson/meson8b")
uci_write_config 0 schedutil 816000 1536000
;;
"rockchip/armv8")
if echo "$CPU_POLICYS" | grep -q "4"; then
# RK3399
uci_write_config 0 schedutil 600000 1608000
uci_write_config 4 schedutil 600000 2016000
else
if echo "$CPU_FREQS" | grep -q "1992000"; then
# RK3568
CPU_MAX_FREQ="1992000"
elif echo "$CPU_FREQS" | grep -q "1800000"; then
# RK3566
CPU_MAX_FREQ="1800000"
else
# RK3328
CPU_MAX_FREQ="1512000"
fi
uci_write_config 0 schedutil 816000 $CPU_MAX_FREQ
fi
;;
"sunxi/cortexa53")
if echo "$CPU_FREQS" | grep -q "1800000"; then
# H6
uci_write_config 0 schedutil 816000 1800000
else
# H5
uci_write_config 0 ondemand 648000 1200000 10 50
fi
;;
esac
uci -q batch <<-EOF >/dev/null
delete ucitrack.@cpufreq[-1]
add ucitrack cpufreq
set ucitrack.@cpufreq[-1].init=cpufreq
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View file

@ -1,11 +0,0 @@
{
"luci-app-cpufreq": {
"description": "Grant UCI access for luci-app-cpufreq",
"read": {
"uci": [ "cpufreq" ]
},
"write": {
"uci": [ "cpufreq" ]
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,26 +0,0 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Bootstrap Theme (default)
LUCI_DEPENDS:=
PKG_LICENSE:=Apache-2.0
define Package/luci-theme-bootstrap/postrm
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || {
uci -q delete luci.themes.Bootstrap
uci -q delete luci.themes.BootstrapDark
uci -q delete luci.themes.BootstrapLight
uci commit luci
}
endef
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View file

@ -1,22 +0,0 @@
#
# Copyright (C) 2020 Jo-Philipp Wich <jo@mein.io>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI modern OpenWrt theme
LUCI_DEPENDS:=
define Package/luci-theme-openwrt-2020/postrm
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || {
uci -q delete luci.themes.OpenWrt2020
uci commit luci
}
endef
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 81 98">
<path d="m 40.5,50.8 a 6.6,6.6 0 1 0 0,13.2 6.6,6.6 0 0 0 0,-13.2 m -40.5,-33.9 7,6.8 a 47.5,47.5 0 0 1 67.2,0 l 7,-6.8 a 57.2,57.2 0 0 0 -81.2,0" style="fill:#fff" />
<path d="m 12.5,29.2 6.8,7 a 30,30 0 0 1 42.6,0 l 6.8,-7 a 39.7,39.7 0 0 0 -56.3,0" style="fill:#fff" />
<path d="m 24.8,41.6 6.8,6.9 a 12.6,12.6 0 0 1 18,0 l 6.8,-6.9 a 22.3,22.3 0 0 0 -31.6,0" style="fill:#fff" />
<path d="m 64.9,39.7 a 30.2,30.2 0 1 1 -48.7,0 l -6.9,-7 a 39.9,39.9 0 1 0 62.5,0 z" style="fill:#072342" />
</svg>

Before

Width:  |  Height:  |  Size: 624 B

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="132 132 264 264">
<defs>
<radialGradient id="g" cx="0%" cy="0%" r="60%">
<stop offset=".8" style="stop-opacity:1" />
<stop offset="1" style="stop-opacity:.5" />
</radialGradient>
</defs>
<g>
<path style="fill:url(#g)" d="M 264 132 A 132 132 0 0 0 132 264 A 132 132 0 0 0 264 396 A 132 132 0 0 0 396 264 A 132 132 0 0 0 264 132 z M 264 170 A 94 94 0 0 1 359 264 A 94 94 0 0 1 264 359 A 94 94 0 0 1 170 264 A 94 94 0 0 1 264 170 z " />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 582 B

View file

@ -1,147 +0,0 @@
'use strict';
'require baseclass';
'require ui';
return baseclass.extend({
__init__: function() {
ui.menu.load().then(L.bind(this.render, this));
},
render: function(tree) {
var node = tree,
url = '';
this.renderModeMenu(node);
if (L.env.dispatchpath.length >= 3) {
for (var i = 0; i < 3 && node; i++) {
node = node.children[L.env.dispatchpath[i]];
url = url + (url ? '/' : '') + L.env.dispatchpath[i];
}
if (node)
this.renderTabMenu(node, url);
}
document.querySelector('#menubar > .navigation')
.addEventListener('click', ui.createHandlerFn(this, 'handleSidebarToggle'));
},
handleMenuExpand: function(ev) {
var a = ev.target, ul1 = a.parentNode.parentNode, ul2 = a.nextElementSibling;
document.querySelectorAll('ul.mainmenu.l1 > li.active').forEach(function(li) {
if (li !== a.parentNode)
li.classList.remove('active');
});
if (!ul2)
return;
if (ul2.parentNode.offsetLeft + ul2.offsetWidth <= ul1.offsetLeft + ul1.offsetWidth)
ul2.classList.add('align-left');
ul1.classList.add('active');
a.parentNode.classList.add('active');
a.blur();
ev.preventDefault();
ev.stopPropagation();
},
renderMainMenu: function(tree, url, level) {
var l = (level || 0) + 1,
ul = E('ul', { 'class': 'mainmenu l%d'.format(l) }),
children = ui.menu.getChildren(tree);
if (children.length == 0 || l > 2)
return E([]);
for (var i = 0; i < children.length; i++) {
var isActive = (L.env.dispatchpath[l] == children[i].name),
isReadonly = children[i].readonly,
activeClass = 'mainmenu-item-%s%s'.format(children[i].name, isActive ? ' selected' : '');
ul.appendChild(E('li', { 'class': activeClass }, [
E('a', {
'href': L.url(url, children[i].name),
'click': (l == 1) ? ui.createHandlerFn(this, 'handleMenuExpand') : null
}, [ _(children[i].title) ]),
this.renderMainMenu(children[i], url + '/' + children[i].name, l)
]));
}
if (l == 1)
document.querySelector('#mainmenu').appendChild(E('div', [ ul ]));
return ul;
},
renderModeMenu: function(tree) {
var menu = document.querySelector('#modemenu'),
children = ui.menu.getChildren(tree);
for (var i = 0; i < children.length; i++) {
var isActive = (L.env.requestpath.length ? children[i].name == L.env.requestpath[0] : i == 0);
if (i > 0)
menu.appendChild(E([], ['\u00a0|\u00a0']));
menu.appendChild(E('div', { 'class': isActive ? 'active' : null }, [
E('a', { 'href': L.url(children[i].name) }, [ _(children[i].title) ])
]));
if (isActive)
this.renderMainMenu(children[i], children[i].name);
}
if (menu.children.length > 1)
menu.style.display = '';
},
renderTabMenu: function(tree, url, level) {
var container = document.querySelector('#tabmenu'),
l = (level || 0) + 1,
ul = E('ul', { 'class': 'cbi-tabmenu' }),
children = ui.menu.getChildren(tree),
activeNode = null;
if (children.length == 0)
return E([]);
for (var i = 0; i < children.length; i++) {
var isActive = (L.env.dispatchpath[l + 2] == children[i].name),
activeClass = isActive ? ' cbi-tab' : '',
className = 'tabmenu-item-%s %s'.format(children[i].name, activeClass);
ul.appendChild(E('li', { 'class': className }, [
E('a', { 'href': L.url(url, children[i].name) }, [ _(children[i].title) ] )
]));
if (isActive)
activeNode = children[i];
}
container.appendChild(ul);
container.style.display = '';
if (activeNode)
container.appendChild(this.renderTabMenu(activeNode, url + '/' + activeNode.name, l));
return ul;
},
handleSidebarToggle: function(ev) {
var btn = ev.currentTarget,
bar = document.querySelector('#mainmenu');
if (btn.classList.contains('active')) {
btn.classList.remove('active');
bar.classList.remove('active');
}
else {
btn.classList.add('active');
bar.classList.add('active');
}
}
});

View file

@ -1,12 +0,0 @@
#!/bin/sh
if [ "$PKG_UPGRADE" != 1 ]; then
uci get luci.themes.OpenWrt2020 >/dev/null 2>&1 || \
uci batch <<-EOF
set luci.themes.OpenWrt2020=/luci-static/openwrt2020
set luci.main.mediaurlbase=/luci-static/openwrt2020
commit luci
EOF
fi
exit 0

View file

@ -1,16 +0,0 @@
{#
Copyright 2020 Jo-Philipp Wich <jo@mein.io>
Licensed to the public under the Apache License 2.0.
-#}
</div>
</div>
<p class="luci">
Powered by {{ version.luciname }} ({{ version.luciversion }})
</p>
<script type="text/javascript">L.require('menu-openwrt2020')</script>
</body>
</html>

View file

@ -1,72 +0,0 @@
{#
Copyright 2020 Jo-Philipp Wich <jo@mein.io>
Licensed to the public under the Apache License 2.0.
-#}
{%
import { getuid, getspnam } from 'luci.core';
const boardinfo = ubus.call('system', 'board');
http.prepare_content('text/html; charset=UTF-8');
-%}
<!DOCTYPE html>
<html lang="{{ dispatcher.lang }}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" type="text/css" media="screen" href="{{ media }}/cascade.css" />
<link rel="icon" href="{{ media }}/logo.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="{{ media }}/logo.png" />
<script type="text/javascript" src="{{ dispatcher.build_url('admin/translations', dispatcher.lang) }}"></script>
<script type="text/javascript" src="{{ resource }}/cbi.js"></script>
<title>{{ striptags(`${boardinfo.hostname ?? '?'}${node ? ` - ${node.title}` : ''}`) }} - LuCI</title>
{% if (css): %}
<style title="text/css">{{ css }}</style>
{% endif %}
</head>
<body class="lang_{{ dispatcher.lang }}" data-page="{{ entityencode(join('-', ctx.request_path), true) }}">
<p class="skiplink">
<span id="skiplink1"><a href="#navigation">{{ _('Skip to navigation') }}</a></span>
<span id="skiplink2"><a href="#content">{{ _('Skip to content') }}</a></span>
</p>
<div id="menubar">
<h2 class="navigation"><a id="navigation" name="navigation">{{ _('Navigation') }}</a></h2>
<span class="hostname"><a href="/">{{ striptags(boardinfo.hostname ?? '?') }}</a></span>
<span class="distversion">{{ version.distversion }} {{ version.distrevision }}</span>
<span id="indicators"></span>
</div>
<div id="modemenu" style="display:none"></div>
<div id="maincontainer">
<div id="mainmenu"></div>
<div id="maincontent">
{% if (getuid() == 0 && getspnam('root')?.pwdp === '' && join('-', ctx.request_path) != 'admin-system-admin'): %}
<div class="alert-message warning">
<h4>{{ _('No password set!') }}</h4>
<p>{{ _('There is no password set on this router. Please configure a root password to protect the web interface.') }}</p>
{% if (dispatcher.lookup("admin/system/admin")): %}
<div class="right"><a class="btn" href="{{ dispatcher.build_url("admin/system/admin") }}">{{ _('Go to password configuration...') }}</a></div>
{% endif %}
</div>
{% endif %}
{% if (boardinfo.rootfs_type == "initramfs"): %}
<div class="alert-message warning">
<h4>{{ _('System running in recovery (initramfs) mode.') }}</h4>
<p>{{ _('No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade') }}</p>
{% if (dispatcher.lookup("admin/system/flash")): %}
<div class="right"><a class="btn" href="{{ dispatcher.build_url("admin/system/flash") }}">{{ _('Go to firmware upgrade...') }}</a></div>
{% endif %}
</div>
{% endif %}
<div id="tabmenu" style="display:none"></div>

View file

@ -1,22 +0,0 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI OpenWrt.org theme
LUCI_DEPENDS:=
define Package/luci-theme-openwrt/postrm
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || {
uci -q delete luci.themes.OpenWrt
uci commit luci
}
endef
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature