update 2026-09-24 10:46:53

This commit is contained in:
action committed 2026-09-24 10:46:53 +08:00
1 parent 907a158127
commit b31a5c3878
4914 files changed
-1716179

No files matched your search

-52
View File
@@ -1,52 +0,0 @@
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=my-default-settings
PKG_VERSION:=2
PKG_RELEASE:=80
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=luci
CATEGORY:=LuCI
TITLE:=Default Settings
MAINTAINER:=Kiddin'
PKGARCH:=all
DEPENDS:=+luci-base
endef
define Package/$(PKG_NAME)/conffiles
/etc/config/
/etc/nginx/
endef
define Build/Prepare
chmod -R +x ./files/bin ./files/sbin ./files/etc/profile.d ./files/etc/rc.d ./files/usr/share diy/*/{*,}/base-files/{etc/init.d,usr/bin} >/dev/null || true
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
echo $(BOARD)$(TARGETID)
if [ -d ./diy/$(BOARD)/base-files/. ]; then \
$(CP) ./diy/$(BOARD)/base-files/* $(1)/; \
fi
if [ -d ./diy/$(TARGETID)/base-files/. ]; then \
$(CP) ./diy/$(TARGETID)/base-files/* $(1)/; \
fi; \
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
po2lmo ./po/zh_Hans/default.po $(1)/usr/lib/lua/luci/i18n/default.zh-cn.lmo
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
@@ -1,14 +0,0 @@
if [[ "$(board_name)" == *xe300 ]]; then
uci -q add_list firewall.@zone[1].network='wwan0'
uci commit firewall
uci -q set network.wwan0=interface
uci -q set network.wwan0.proto='qmi'
uci -q set network.wwan0.device='/dev/cdc-wdm0'
uci -q set network.wwan0.apn='internet'
uci -q set network.wwan0.auth='none'
uci -q set network.wwan0.delay='10'
uci -q set network.wwan0.pdptype='IPV4V6'
uci commit network
fi
exit 0
@@ -1,12 +0,0 @@
#!/bin/sh
ETHTOOL=/usr/sbin/ethtool
$ETHTOOL -i eth0 | grep r8152 && \
[ "$ACTION" = "ifup" ] && \
$ETHTOOL -K eth0 rx off tx off
$ETHTOOL -i eth1 | grep r8152 && \
[ "$ACTION" = "ifup" ] && \
$ETHTOOL -K eth1 rx off tx off
@@ -1,278 +0,0 @@
<% local raid = {}
local devs = {}
local devinfo = {}
local colors = { "c0c0ff", "fbbd00", "e97c30", "a0e0a0", "e0c0ff" }
local mounts = nixio.fs.readfile("/proc/mounts")
local show_raid = 1
local show_disc = 1
if self then
if self.hide_raid then
show_raid = 0
end
if self.hide_disc then
show_disc = 0
end
end
function disp_size(s)
local units = { "kB", "MB", "GB", "TB" }
local i, unit
s = s / 2
for i, unit in ipairs(units) do
if (i == #units) or (s < 1024) then
return math.floor(s * 100) / 100 .. unit
end
s = s / 1024
end
end
function first_line(s)
local n = s:find("\n")
if n then
return s:sub(1, n-1)
end
return s
end
function get_fs(pname, status)
for r,raid in ipairs(raid) do
for m,member in ipairs(raid.members) do
if member.name == pname then
return "(raid member)"
end
end
end
local mounted_fs = mounts:match("\n[a-z/]*" .. pname .. " [^ ]* ([^ ]*)")
if mounted_fs then
if status == "standby" then
return "(" .. mounted_fs .. ")"
end
local df = luci.sys.exec("df /dev/" .. pname):match(" ([0-9]+)%% ")
return "(" .. mounted_fs .. " " .. df .. "%)"
end
if status == "standby" then
return
end
local blkid = luci.sys.exec(" blkid -s TYPE /dev/" .. pname):match("TYPE=\"(.*)\"")
if blkid then
return "(" .. blkid .. ")"
end
end
function get_status(raid)
for m,member in ipairs(raid.members) do
for d,dev in ipairs(devinfo) do
if member.name == dev.name then
return dev.status
end
for p,part in ipairs(dev.parts) do
if member.name == part.name then
return dev.status
end
end
end
end
end
function get_parts(dev,status,size)
local c = 1
local unused = size
local parts = {}
for part in nixio.fs.glob("/sys/block/" .. dev .."/" .. dev .. "*") do
local pname = nixio.fs.basename(part)
local psize = nixio.fs.readfile(part .. "/size")
table.insert(parts, {name=pname, size=psize, perc=math.floor(psize*100/size), fs=get_fs(pname,status), color=colors[c]})
c = c + 1
unused = unused - psize
end
if unused > 2048 then
table.insert(parts, { name="", fs=get_fs(dev,status), size=unused, color=colors[c] })
end
return parts
end
for dev in nixio.fs.glob("/sys/block/*") do
if nixio.fs.access(dev .. "/md") then
local name = nixio.fs.basename(dev)
local rlevel = first_line(nixio.fs.readfile(dev .. "/md/level"))
local ndisks = tonumber(nixio.fs.readfile(dev .. "/md/raid_disks"))
local size = tonumber(nixio.fs.readfile(dev .. "/size"))
local metav = nixio.fs.readfile(dev .. "/md/metadata_version")
local degr = tonumber(nixio.fs.readfile(dev .. "/md/degraded"))
local sync = first_line(nixio.fs.readfile(dev .. "/md/sync_action"))
local sync_speed = tonumber(nixio.fs.readfile(dev .. "/md/sync_speed"))
local sync_compl = nixio.fs.readfile(dev .. "/md/sync_completed")
local status = "active"
if sync ~= "idle" then
local progress, total = nixio.fs.readfile(dev .. "/md/sync_completed"):match("^([0-9]*)[^0-9]*([0-9]*)")
local rem = (total - progress) / sync_speed / 2
local rems = math.floor(rem % 60)
if rems < 10 then rems = "0" .. rems end
rem = math.floor(rem / 60)
local remm = math.floor(rem % 60)
if remm < 10 then remm = "0" .. remm end
local remh = math.floor(rem / 60)
local remstr = remh .. ":" .. remm .. ":" .. rems
status = sync .. " (" .. math.floor(sync_speed/1024) .. "MB/s, " .. math.floor(progress * 1000 / total) /10 .. "%, rem. " .. remstr .. ")"
elseif degr == 1 then
status = "degraded"
end
local members = {}
local c = 1
for member in nixio.fs.glob("/sys/block/" .. name .. "/md/dev-*") do
local dname = nixio.fs.basename(nixio.fs.readlink(member .. "/block"))
local dsize = disp_size(tonumber(nixio.fs.readfile(member .. "/block/size")))
local dstate = nixio.fs.readfile(member .. "/state"):gsub("_", " "):match "^%s*(.-)%s*$"
table.insert(members, { name = dname, size = dsize, state = dstate, color = colors[c] })
c = c + 1
end
table.insert(raid, {name=name, rlevel=rlevel, ndisks=ndisks, size=size, metav=metav, status=status, members=members })
end
end
if show_disc == 1 then
for dev in nixio.fs.glob("/sys/class/scsi_disk/*/device") do
local section
local model = nixio.fs.readfile(dev .. "/model")
local fw = nixio.fs.readfile(dev .. "/rev")
for bdev in nixio.fs.glob(dev .. "/block/*") do
local section
local name = nixio.fs.basename(bdev)
local size = tonumber(nixio.fs.readfile(bdev .. "/size"))
local unused = size
local status = "-"
local temp = "-"
local serial = "-"
local secsize = "-"
for _,line in ipairs(luci.util.execl("smartctl -A -i -n standby -f brief /dev/" .. name)) do
local attrib, val
if section == 1 then
attrib, val = line:match "^(.*):%s*(.*)"
elseif section == 2 then
attrib, val = line:match("^([0-9 ]*) [^ ]* * [POSRCK-]* *[0-9-]* *[0-9-]* *[0-9-]* *[0-9-]* *([0-9-]*)")
else
attrib = line:match "^=== START OF (.*) SECTION ==="
if attrib == "INFORMATION" then
section = 1
elseif attrib == "READ SMART DATA" then
section = 2
elseif status == "-" then
val = line:match "^Device is in (.*) mode"
if val then
status = val:lower()
end
end
end
if not attrib then
if section ~= 2 then section = 0 end
elseif (attrib == "Power mode is") or (attrib == "Power mode was") then
status = val:lower():match "(%S*)"
elseif attrib == "Sector Sizes" then
secsize = val:match "([0-9]*) bytes physical"
elseif attrib == "Sector Size" then
secsize = val:match "([0-9]*)"
elseif attrib == "Serial Number" then
serial = val
elseif attrib == "194" then
temp = val .. "&deg;C"
end
end
table.insert(devinfo, {name=name, model=model, fw=fw, size=size, status=status, temp=temp, serial=serial, secsize=secsize, parts=get_parts(name,status,size) })
end
end
for r,dev in ipairs(raid) do
table.insert(devinfo, {name=dev.name, model="Linux RAID", size=dev.size, status=get_status(dev), secsize=secsize, parts=get_parts(dev.name,status,dev.size) })
end
end
if show_disc == 1 then %>
<div class="cbi-section">
<h3><%:Disks%></h3>
<table class="cbi-section-table" style="white-space: nowrap">
<tr>
<th width="5%">&nbsp;</th>
<th width="30%"><%:Model%></th>
<th width="15%"><%:Serial number%></th>
<th width="10%"><%:Firmware%></th>
<th width="10%"><%:Capacity%></th>
<th width="5%"><%:Sector size%></th>
<th width="5%"><%:Temperature%></th>
<th width="20%"><%:Power state%></th>
</tr>
<% local style=true
for d,dev in ipairs(devinfo) do %>
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td class="cbi-vluae-field" style="padding-bottom:0px; border-bottom-width:0px; vertical-align:middle" rowspan="4"><%=dev.name%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.model%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.serial%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.fw%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=disp_size(dev.size)%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.secsize%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.temp%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.status%></td>
</tr>
<tr style="height:0px" />
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td style="padding:0px; border-top-width:0px;" colspan="7" rowspan="2">
<table style="border: 0pt; border-collapse:collapse; width:100%; padding:0px; margin:0px"><tr>
<% for _,part in pairs(dev.parts) do %>
<td style="text-align:center; padding: 0px 4px; border-radius: 3px; background-color:#<%=part.color%>" width="<%=part.perc%>%"><%=part.name%> <%=disp_size(part.size)%> <%=part.fs%></td>
<% end %>
</tr></table>
</td>
</tr>
<tr style="height:0px" />
<% style = not style
end %>
</table>
</div>
<% end
if show_raid == 1 and #raid > 0 then %>
<div class="cbi-section">
<h3><%:Raid arrays%></h3>
<table class="cbi-section-table" style="white-space:nowrap">
<tr>
<th width="5%">&nbsp;</th>
<th width="13%"><%:Level%></th>
<th width="13%"><%:# Disks%></th>
<th width="13%"><%:Capacity%></th>
<th width="13%"><%:Metadata%></th>
<th width="43%"><%:Status%></th>
</tr>
<% local style=true
for r,dev in ipairs(raid) do %>
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td class="cbi-vluae-field" style="padding-bottom:0px; border-bottom-width:0px; vertical-align:middle" rowspan="4"><%=dev.name%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.rlevel%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.ndisks%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=disp_size(dev.size)%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.metav%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.status%></td>
</tr>
<tr style="height:0px" />
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td style="padding-top:0px; border-top-width:0px" colspan="6" rowspan="2">
<table style="border: 0pt; border-collapse:collapse; width:100%; padding:0px; margin:0px"><tr>
<% for _,member in pairs(dev.members) do %>
<td style="text-align:center; padding: 0px 4px; border-radius: 3px; background-color:#<%=member.color%>; white-space: nowrap"><%=member.name%> <%=member.size%> (<%=member.state%>)</td>
<% end %>
</tr></table>
</td>
</tr>
<tr style="height:0px" />
<% style = not style
end %>
</table>
</div>
<% end %>
@@ -1,228 +0,0 @@
<% local raid = {}
local devs = {}
local devinfo = {}
local colors = { "c0c0ff", "fbbd00", "e97c30", "a0e0a0", "b2c005", "e0c0ff" }
local mounts = nixio.fs.readfile("/proc/mounts")
local show_raid = 1
local show_disc = 1
if self then
if self.hide_raid then
show_raid = 0
end
if self.hide_disc then
show_disc = 0
end
end
function disp_size(s)
local units = { "kB", "MB", "GB", "TB" }
local i, unit
s = s / 2
for i, unit in ipairs(units) do
if (i == #units) or (s < 1024) then
return math.floor(s * 100) / 100 .. unit
end
s = s / 1024
end
end
function first_line(s)
local n = s:find("\n")
if n then
return s:sub(1, n-1)
end
return s
end
function get_fs(pname, status)
for r,raid in ipairs(raid) do
for m,member in ipairs(raid.members) do
if member.name == pname then
return "(raid member)"
end
end
end
local mounted_fs = mounts:match("\n[a-z/]*" .. pname .. " [^ ]* ([^ ]*)")
if mounted_fs then
if status == "standby" then
return "(" .. mounted_fs .. ")"
end
local df = luci.sys.exec("df /dev/" .. pname):match(" ([0-9]+)%% ")
return "(" .. mounted_fs .. " " .. df .. "%)"
end
if status == "standby" then
return
end
local blkid = luci.sys.exec(" blkid -s TYPE /dev/" .. pname):match("TYPE=\"(.*)\"")
if blkid then
return "(" .. blkid .. ")"
end
end
function get_status(raid)
for m,member in ipairs(raid.members) do
for d,dev in ipairs(devinfo) do
if member.name == dev.name then
return dev.status
end
for p,part in ipairs(dev.parts) do
if member.name == part.name then
return dev.status
end
end
end
end
end
function get_parts(dev,status,size)
local c = 1
local unused = size
local parts = {}
for part in nixio.fs.glob("/sys/block/" .. dev .."/" .. dev .. "*") do
local pname = nixio.fs.basename(part)
local psize = nixio.fs.readfile(part .. "/size")
table.insert(parts, {name=pname, size=psize, perc=math.floor(psize*100/size), fs=get_fs(pname,status), color=colors[c]})
c = c + 1
unused = unused - psize
end
if unused > 2048 then
table.insert(parts, { name="", fs=get_fs(dev,status), size=unused, color=colors[c] })
end
return parts
end
for dev in nixio.fs.glob("/sys/block/*") do
if nixio.fs.access(dev .. "/md") then
local name = nixio.fs.basename(dev)
local rlevel = first_line(nixio.fs.readfile(dev .. "/md/level"))
local ndisks = tonumber(nixio.fs.readfile(dev .. "/md/raid_disks"))
local size = tonumber(nixio.fs.readfile(dev .. "/size"))
local metav = nixio.fs.readfile(dev .. "/md/metadata_version")
local degr = tonumber(nixio.fs.readfile(dev .. "/md/degraded"))
local sync = first_line(nixio.fs.readfile(dev .. "/md/sync_action"))
local sync_speed = tonumber(nixio.fs.readfile(dev .. "/md/sync_speed"))
local sync_compl = nixio.fs.readfile(dev .. "/md/sync_completed")
local status = "active"
if sync ~= "idle" then
local progress, total = nixio.fs.readfile(dev .. "/md/sync_completed"):match("^([0-9]*)[^0-9]*([0-9]*)")
local rem = (total - progress) / sync_speed / 2
local rems = math.floor(rem % 60)
if rems < 10 then rems = "0" .. rems end
rem = math.floor(rem / 60)
local remm = math.floor(rem % 60)
if remm < 10 then remm = "0" .. remm end
local remh = math.floor(rem / 60)
local remstr = remh .. ":" .. remm .. ":" .. rems
status = sync .. " (" .. math.floor(sync_speed/1024) .. "MB/s, " .. math.floor(progress * 1000 / total) /10 .. "%, rem. " .. remstr .. ")"
elseif degr == 1 then
status = "degraded"
end
local members = {}
local c = 1
for member in nixio.fs.glob("/sys/block/" .. name .. "/md/dev-*") do
local dname = nixio.fs.basename(nixio.fs.readlink(member .. "/block"))
local dsize = disp_size(tonumber(nixio.fs.readfile(member .. "/block/size")))
local dstate = nixio.fs.readfile(member .. "/state"):gsub("_", " "):match "^%s*(.-)%s*$"
table.insert(members, { name = dname, size = dsize, state = dstate, color = colors[c] })
c = c + 1
end
table.insert(raid, {name=name, rlevel=rlevel, ndisks=ndisks, size=size, metav=metav, status=status, members=members })
end
end
if show_disc == 1 then
for dev in nixio.fs.glob("/sys/class/nvme/*/device/nvme/*") do
local section
local model = nixio.fs.readfile(dev .. "/model")
local fw = nixio.fs.readfile(dev .. "/firmware_rev")
for bdev in nixio.fs.glob(dev .. "/nvme*") do
local section
local name = nixio.fs.basename(bdev)
local size = tonumber(nixio.fs.readfile(bdev .. "/size"))
local unused = size
local status = "-"
local temp = "-"
local serial = "-"
local secsize = "-"
for _,line in ipairs(luci.util.execl("smartctl -A -i -d nvme -n standby -f brief /dev/" .. name)) do
local attrib, val
if section == 1 then
attrib, val = line:match "^(.*):%s*(.*)"
elseif section == 2 then
attrib, val = line:match("^([0-9 ]*) [^ ]* * [POSRCK-]* *[0-9-]* *[0-9-]* *[0-9-]* *[0-9-]* *([0-9-]*)")
else
attrib = line:match "^=== START OF (.*) SECTION ==="
if attrib == "INFORMATION" then
section = 1
elseif attrib == "READ SMART DATA" then
section = 2
elseif status == "-" then
val = line:match "^Device is in (.*) mode"
if val then
status = val:lower()
end
end
end
if not attrib then
if section ~= 2 then section = 0 end
elseif (attrib == "Power mode is") or (attrib == "Power mode was") then
status = val:lower():match "(%S*)"
elseif attrib == "Serial Number" then
serial = val
elseif attrib == "194" then
temp = val .. "&deg;C"
end
end
table.insert(devinfo, {name=name, model=model, fw=fw, size=size, serial=serial, parts=get_parts(name,status,size) })
end
end
end
if show_raid == 1 and #devinfo > 0 then %>
<div class="cbi-section">
<h3><%:NVMe SSD%></h3>
<table class="cbi-section-table" style="white-space: nowrap">
<tr>
<th width="5%">&nbsp;</th>
<th width="30%"><%:Model%></th>
<th width="25%"><%:Serial number%></th>
<th width="20%"><%:Firmware%></th>
<th width="20%"><%:Capacity%></th>
<!-- <th width="10%"><%:Temperature%></th>-->
</tr>
<% local style=true
for d,dev in ipairs(devinfo) do %>
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td class="cbi-vluae-field" style="padding-bottom:0px; border-bottom-width:0px; vertical-align:middle" rowspan="4"><%=dev.name%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.model%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.serial%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.fw%></td>
<td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=disp_size(dev.size)%></td>
<!-- <td class="cbi-value-field" style="padding-bottom:0px; border-bottom-width:0px" rowspan="2"><%=dev.temp%></td>-->
</tr>
<tr style="height:0px" />
<tr class="cbi-section-table-row cbi-rowstyle-<%=(style and 1 or 2)%>">
<td style="padding:0px; border-top-width:0px" colspan="7" rowspan="2">
<table style="border: 0pt; border-collapse:collapse; width:100%; padding:0px; margin:0px"><tr>
<% for _,part in pairs(dev.parts) do %>
<td style="text-align:center; padding: 0px 4px; border-radius: 3px; background-color:#<%=part.color%>" width="<%=part.perc%>%"><%=part.name%> <%=disp_size(part.size)%> <%=part.fs%></td>
<% end %>
</tr></table>
</td>
</tr>
<tr style="height:0px" />
<% style = not style
end %>
</table>
</div>
<% end %>
@@ -1,3 +0,0 @@
config status
option version '0'
option base '1'
@@ -1,6 +0,0 @@
#!/bin/sh
[ "${ACTION}" = "add" ] && {
/sbin/wifi config
[[ -z "$(uci -q get base_config.@status[0].wifi)" ]] && . /sbin/mywifi &
}
@@ -1,42 +0,0 @@
server
{
listen 8877;
#listen 443 ssl http2;
server_name _lan;
index index.html index.htm index.php default.html default.htm default.php;
root /data;
# ssl_certificate /etc/acme/supes.top/fullchain.cer;
# ssl_certificate_key /etc/acme/supes.top/supes.top.key;
# ssl_session_timeout '64m';
# ssl_protocols TLSv1.2 TLSv1.3;
# ssl_prefer_server_ciphers on;
# ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
# ssl_session_cache 'shared:SSL:10m';
client_max_body_size 0;
location / {
set $dest $http_destination;
if (-d $request_filename) {
rewrite ^(.*[^/])$ $1/;
set $dest $dest/;
}
if ($request_method ~ (MOVE|COPY)) {
more_set_input_headers 'Destination: $dest';
}
if ($request_method ~ MKCOL) {
rewrite ^(.*[^/])$ $1/ break;
}
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
dav_access user:rw group:rw all:r;
create_full_put_path on;
auth_basic "Restricted access";
auth_basic_user_file /etc/nginx/htpasswd.conf;
}
}
@@ -1 +0,0 @@
root:fU70Nx.37Ofww
@@ -1,121 +0,0 @@
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LANG=zh_CN.UTF-8
THIS_SCRIPT="sysinfo"
MOTD_DISABLE=""
SHOW_IP_PATTERN="^[ewr].*|^br.*|^lt.*|^umts.*"
DATA_STORAGE=/userdisk/data
MEDIA_STORAGE=/userdisk/snail
# don't edit below here
function display()
{
# $1=name $2=value $3=red_limit $4=minimal_show_limit $5=unit $6=after $7=acs/desc{
# battery red color is opposite, lower number
if [[ "$1" == "Battery" ]]; then
local great="<";
else
local great=">";
fi
if [[ -n "$2" && "$2" > "0" && (( "${2%.*}" -ge "$4" )) ]]; then
printf "%-14s%s" "$1:"
if awk "BEGIN{exit ! ($2 $great $3)}"; then
echo -ne "\e[0;91m $2";
else
echo -ne "\e[0;92m $2";
fi
printf "%-1s%s\x1B[0m" "$5"
printf "%-11s%s\t" "$6"
return 1
fi
} # display
function get_ip_addresses()
{
local ips=()
for f in /sys/class/net/*; do
local intf=$(basename $f)
# match only interface names starting with e (Ethernet), br (bridge), w (wireless), r (some Ralink drivers use ra<number> format)
if [[ $intf =~ $SHOW_IP_PATTERN ]]; then
local tmp=$(ip -4 addr show dev $intf | awk '/inet/ {print $2}' | cut -d'/' -f1)
# add both name and IP - can be informative but becomes ugly with long persistent/predictable device names
#[[ -n $tmp ]] && ips+=("$intf: $tmp")
# add IP only
[[ -n $tmp ]] && ips+=("$tmp")
fi
done
echo "${ips[@]}"
} # get_ip_addresses
function storage_info()
{
# storage info
RootInfo=$(df -h /)
root_usage=$(awk '/\// {print $(NF-1)}' <<<${RootInfo} | sed 's/%//g')
root_total=$(awk '/\// {print $(NF-4)}' <<<${RootInfo})
} # storage_info
# query various systems and send some stuff to the background for overall faster execution.
# Works only with ambienttemp and batteryinfo since A20 is slow enough :)
storage_info
critical_load=$(( 1 + $(grep -c processor /proc/cpuinfo) / 2 ))
# get uptime, logged in users and load in one take
UptimeString=$(uptime | tr -d ',')
time=$(awk -F" " '{print $3" "$4}' <<<"${UptimeString}")
load="$(awk -F"average: " '{print $2}'<<<"${UptimeString}")"
case ${time} in
1:*) # 1-2 hours
time=$(awk -F" " '{print $3" 小时"}' <<<"${UptimeString}")
;;
*:*) # 2-24 hours
time=$(awk -F" " '{print $3" 小时"}' <<<"${UptimeString}")
;;
*day) # days
days=$(awk -F" " '{print $3"天"}' <<<"${UptimeString}")
time=$(awk -F" " '{print $5}' <<<"${UptimeString}")
time="$days "$(awk -F":" '{print $1"小时 "$2"分钟"}' <<<"${time}")
;;
esac
# memory and swap
mem_info=$(LC_ALL=C free -w 2>/dev/null | grep "^Mem" || LC_ALL=C free | grep "^Mem")
memory_usage=$(awk '{printf("%.0f",(($2-($4+$6))/$2) * 100)}' <<<${mem_info})
memory_total=$(awk '{printf("%d",$2/1024)}' <<<${mem_info})
swap_info=$(LC_ALL=C free -m | grep "^Swap")
swap_usage=$( (awk '/Swap/ { printf("%3.0f", $3/$2*100) }' <<<${swap_info} 2>/dev/null || echo 0) | tr -c -d '[:digit:]')
swap_total=$(awk '{print $(2)}' <<<${swap_info})
c=0
while [ ! -n "$(get_ip_addresses)" ];do
[ $c -eq 3 ] && break || let c++
sleep 1
done
ip_address="$(get_ip_addresses)"
# display info
display "系统负载" "${load%% *}" "${critical_load}" "0" "" "${load#* }"
printf "运行时间: \x1B[92m%s\x1B[0m\t\t" "$time"
echo "" # fixed newline
display "内存已用" "$memory_usage" "70" "0" " %" " of ${memory_total}MB"
display "交换内存" "$swap_usage" "10" "0" " %" " of $swap_total""Mb"
printf "IP 地址: \x1B[92m%s\x1B[0m" "$ip_address"
echo "" # fixed newline
display "系统存储" "$root_usage" "90" "1" "%" " of $root_total"
if [ -x /sbin/cpuinfo ]; then
printf "CPU 信息: \x1B[92m%s\x1B[0m\t" "$(echo `/sbin/cpuinfo | cut -d ' ' -f -4`)"
fi
echo ""
echo ""
@@ -1,14 +0,0 @@
#!/bin/sh /etc/rc.common
[[ -f "/bin/coremark" && ! -f "/etc/bench.log" && "$(uci -q get wizard.default.coremark)" == '1' ]] && {
(
sleep 5
while :; do
[ -f /var/lock/opkg.lock ] || {
/sbin/coremark
break;
}
sleep 1
done
) &
}
@@ -1,149 +0,0 @@
#!/bin/sh
# 1. 基础系统与组件链接修正
sed -i 's|op.supes.top|dl.openwrt.ai|g' /etc/opkg/distfeeds.conf 2>/dev/null
[ -x /bin/bash ] && sed -i 's|/bin/ash|/bin/bash|g' /etc/passwd 2>/dev/null && ln -sf /bin/bash /bin/sh 2>/dev/null
[ -x /usr/bin/wget ] && [ ! -x /usr/bin/wget-ssl ] && ln -sf /usr/bin/wget /usr/bin/wget-ssl
sed -i -e '/profile.d/d' /lib/upgrade/keep.d/base-files \
-e 's/git-.*-\(.*\)/git-\1/g' /usr/lib/lua/luci/version.lua 2>/dev/null
# 2. 版本与环境参数提取
version=$(uci -q get base_config.@status[0].version)
case "$version" in ''|*[!0-9]*) version=0 ;; esac
for ip in $(uci -q get network.lan.ipaddr); do
case "$ip" in *.*) lan_ip="${ip%%/*}"; break ;; esac
done
lan_ip="${lan_ip:-10.0.0.1}"
[ -z "$(uci -q get system.@system[0].hostname)" ] && uci -q set system.@system[0].hostname='Kwrt'
[ "$(uci -q get dropbear.main._direct)" != "1" ] && uci -q delete dropbear.main.Interface
case "$(uci -q get uhttpd.main.index_page)" in *cgi-bin/luci*) ;; *) uci -q add_list uhttpd.main.index_page='cgi-bin/luci' ;; esac
proc=$(grep -c '^processor' /proc/cpuinfo 2>/dev/null)
[ "${proc:-0}" -gt 0 ] 2>/dev/null || proc=3
sed -i "s/^threads =.*/threads = $proc/" /etc/uwsgi/vassals/luci-webui.ini 2>/dev/null
# 3. 内存分级计算
mem=0
[ -r /proc/meminfo ] && read -r _ mem _ < /proc/meminfo
case "$mem" in ''|*[!0-9]*) mem=0 ;; esac
c=1024; nf=16384
[ "$mem" -ge 65536 ] && { c=2048; nf=32768; }
[ "$mem" -ge 131072 ] && { c=4096; nf=65536; }
[ "$mem" -ge 262144 ] && { c=8192; nf=65536; }
[ "$mem" -ge 524288 ] && { c=10000; nf=131072; }
[ "$mem" -ge 1048576 ] && { c=10000; nf=262144; }
# 4. 首次开机参数统一批量预设
if [ "$version" -lt 1 ]; then
uci -q batch <<-EOF
set luci.main.lang='auto'
set uhttpd.main.rfc1918_filter='0'
set uhttpd.main.redirect_https='0'
set uhttpd.main.script_timeout='120'
set upnpd.config.enabled='1'
set firewall.@defaults[0].flow_offloading='1'
set firewall.@defaults[0].flow_offloading_hw='1'
set fstab.@global[0].anon_mount='1'
set network.globals.packet_steering='1'
set nft-qos.default.limit_enable='0'
set system.@system[0].zonename='Asia/Shanghai'
set system.@system[0].timezone='CST-8'
set system.@system[0].ttylogin='1'
set system.@system[0].zram_size_mb='$((mem / 1024 / 3))'
del system.ntp.server
add_list system.ntp.server='ntp.aliyun.com'
add_list system.ntp.server='0.openwrt.pool.ntp.org'
set dhcp.@dnsmasq[0].port='53'
set dhcp.@dnsmasq[0].dns_redirect='1'
set dhcp.@dnsmasq[0].allservers='1'
del dhcp.@dnsmasq[0].noresolv
set dhcp.@dnsmasq[0].cachesize='$c'
set dhcp.@dnsmasq[0].dnsforwardmax='$c'
set dhcp.@dnsmasq[0].min_ttl='3600'
set dhcp.lan.force='1'
set dhcp._ta=domain
set dhcp._ta.name='time.android.com'
set dhcp._ta.ip='203.107.6.88'
set dhcp._ta.comments='time.android'
EOF
(echo root; echo root) | passwd root >/dev/null 2>&1
[ -f /usr/share/rpcd/acl.d/luci-theme-argon.json ] && uci -q set luci.main.mediaurlbase='/luci-static/argon'
grep -q 'log-facility' /etc/dnsmasq.conf 2>/dev/null || echo "log-facility=/dev/null" >> /etc/dnsmasq.conf
mkdir -p /etc/sysctl.d
printf "net.nf_conntrack_max=%s\nnet.core.rmem_max=%s\n" "$nf" "$nf" > /etc/sysctl.d/50-local.conf
if command -v nginx >/dev/null 2>&1 && [ -z "$(uci -q get wizard.pw)" ]; then
uci -q batch <<-EOF
set wizard.pw=shortcuts
set wizard.pw.shortcut='pw'
set wizard.pw.to_url='http://${lan_ip}/cgi-bin/luci/admin/services/passwall'
set wizard.pw.comments='passwall'
set nginx._sc_pw=server
set nginx._sc_pw.server_name='pw'
add_list nginx._sc_pw.listen='80'
add_list nginx._sc_pw.listen='443'
set nginx._sc_pw.return='302 http://${lan_ip}/cgi-bin/luci/admin/services/passwall'
set dhcp._sc_pw=domain
set dhcp._sc_pw.name='pw'
set dhcp._sc_pw.ip='${lan_ip}'
set dhcp._sc_pw.comments='PassWall'
EOF
fi
version=1
fi
# 5. 默认后台域名映射与 Nginx 规则
[ -z "$(uci -q get dhcp.default_server)" ] && uci -q batch <<-EOF
set dhcp.default_server=domain
set dhcp.default_server.name='kwrt'
set dhcp.default_server.ip='${lan_ip}'
set dhcp.default_server.comments='后台地址'
EOF
if command -v nginx >/dev/null 2>&1; then
[ -z "$(uci -q get nginx.default_server)" ] && uci -q batch <<-EOF
set nginx.default_server=server
set nginx.default_server.server_name='kwrt'
add_list nginx.default_server.listen='80 default_server'
add_list nginx.default_server.listen='[::]:80 default_server'
add_list nginx.default_server.include='conf.d/*.locations'
set nginx.default_server.access_log='off; # logd openwrt'
EOF
if [ -f /etc/nginx/conf.d/luci.locations ]; then
grep -q 'uwsgi_read_timeout' /etc/nginx/conf.d/luci.locations || sed -i '/include uwsgi_params;/a\\t\tuwsgi_read_timeout 300s;' /etc/nginx/conf.d/luci.locations
grep -q 'ubus_script_timeout' /etc/nginx/conf.d/luci.locations || sed -i '/ubus_parallel_req/a\ ubus_script_timeout 600;' /etc/nginx/conf.d/luci.locations
fi
if [ -f /etc/nginx/uci.conf.template ]; then
sed -i -e 's/128M/3072M/' -e 's/2 1k/4 512k/' /etc/nginx/uci.conf.template
grep -q 'client_body_buffer_size' /etc/nginx/uci.conf.template || sed -i '/large_client_header_buffers/a\\tclient_body_buffer_size 128K;' /etc/nginx/uci.conf.template
fi
fi
# 6. uWSGI 超时与 FullCone 探测(兼容 fw3/fw4)
for ini in /etc/uwsgi/vassals/luci-*.ini; do
[ -f "$ini" ] && ! grep -q 'cgi-timeout' "$ini" && echo "cgi-timeout = 500" >> "$ini"
done
sed -i 's/limit-as = 1000/limit-as = 5000/g' /etc/uwsgi/vassals/luci-webui.ini 2>/dev/null
modprobe xt_FULLCONENAT >/dev/null 2>&1 || modprobe nft_fullcone >/dev/null 2>&1 || {
iptables -L -t nat 2>/dev/null | grep -q 'FULLCONENAT' || \
nft list ruleset 2>/dev/null | grep -q 'fullcone' || \
uci -q set firewall.@defaults[0].fullcone='0'
}
# 7. 更新版本状态、一次性提交所有 UCI 配置并安全退出
[ -f /etc/config/base_config ] && {
uci -q get base_config.@status[0] >/dev/null || uci -q add base_config status >/dev/null
uci -q set base_config.@status[0].version="$version"
}
uci -q commit
rm -rf /tmp/luci-*
exit 0
-3
View File
@@ -1,3 +0,0 @@
#!/bin/ash
/bin/coremark | grep "CoreMark 1.0" | cut -d "/" -f 1 | cut -d "." -f -2 | sed -e 's/CoreMark 1.0\(.*\)/(CpuMark\1 Scores)/g' | tee /etc/bench.log
-236
View File
@@ -1,236 +0,0 @@
#!/bin/sh
#
# Optimized OpenWrt WiFi Configuration Script
#
LOCK_FILE="/var/run/mywifi.lock"
[ -f /etc/openwrt_release ] && . /etc/openwrt_release
log_info() { echo "[INFO] $*"; }
log_error() { echo "[ERROR] $*" >&2; }
show_help() {
cat << 'EOF'
用法:
mywifi [选项]
选项:
-s, --ssid <名称> 指定基础WiFi名称(默认使用系统 hostname / Kwrt)
-p, --password <密码> 指定WiFi密码(8-63 位,未指定时默认开放网络)
-f, --force 强制重新配置(忽略 wifi=1 完成标记)
-h, --help 查看帮助信息
命名规范:
<WiFi名>_2.4G / <WiFi名>_5G / <WiFi名>_6G
EOF
}
# -------------------------------------------------------------
# 1. 参数解析
# -------------------------------------------------------------
CUSTOM_SSID=""
CUSTOM_PASSWD=""
HAS_PASSWD=0
FORCE=0
while [ $# -gt 0 ]; do
case "$1" in
-h|--help) show_help; exit 0 ;;
-f|--force) FORCE=1 ;;
-s|--ssid)
[ $# -ge 2 ] && [ "${2#-}" = "$2" ] && { shift; CUSTOM_SSID="$1"; }
;;
-p|--password)
if [ $# -ge 2 ] && [ "${2#-}" = "$2" ]; then
shift; CUSTOM_PASSWD="$1"; HAS_PASSWD=1
else
CUSTOM_PASSWD=""; HAS_PASSWD=0
fi
;;
esac
shift
done
# -------------------------------------------------------------
# 2. 状态标记检查与防并发锁
# -------------------------------------------------------------
# 既未强制重新配置,又无自定义参数,且已配置过时直接跳过
if [ $FORCE -eq 0 ] && [ -z "$CUSTOM_SSID" ] && [ $HAS_PASSWD -eq 0 ]; then
if [ "$(uci -q get base_config.@status[0].wifi 2>/dev/null)" = "1" ]; then
log_info "WiFi 已配置完成,无需重复执行。"
exit 0
fi
fi
# 文件锁(有任务参数时排队等待,否则遇锁直接退出)
WAIT_LOCK=0
[ $FORCE -eq 1 ] || [ -n "$CUSTOM_SSID" ] || [ $HAS_PASSWD -eq 1 ] && WAIT_LOCK=1
exec 9>"$LOCK_FILE" 2>/dev/null || true
if ! flock -n 9 2>/dev/null; then
if [ $WAIT_LOCK -eq 1 ]; then
log_info "检测到 mywifi 正在运行,等待其执行完毕..."
flock -w 60 9 2>/dev/null || { log_error "等待执行超时(60s)!"; exit 1; }
else
log_info "检测到 mywifi 正在运行,直接终止。"
exit 0
fi
fi
# 密码合法性检查
if [ $HAS_PASSWD -eq 1 ] && [ -n "$CUSTOM_PASSWD" ]; then
pwd_len=${#CUSTOM_PASSWD}
if [ "$pwd_len" -lt 8 ] || [ "$pwd_len" -gt 63 ]; then
log_error "WiFi 密码长度必须在 8 到 63 个字符之间!"
exit 1
fi
fi
# -------------------------------------------------------------
# 3. 硬件驱动与 UCI 就绪检测
# -------------------------------------------------------------
wait_wifi_ready() {
local waited=0
while [ $waited -lt 15 ]; do
local phys="$(ls -d /sys/class/ieee80211/phy* 2>/dev/null)"
local phy_count=$(echo $phys | wc -w)
local uci_radios="$(uci -q show wireless | sed -n 's/^wireless\.\([^.]*\)=wifi-device/\1/p')"
local uci_count=$(echo $uci_radios | wc -w)
# 缺少配置文件或配置项落后于物理网卡时,触发 wifi config 生成默认配置
if [ $phy_count -gt "$uci_count" ] || { [ $phy_count -eq 0 ] && [ ! -s /etc/config/wireless ]; }; then
command -v wifi >/dev/null && wifi config >/dev/null 2>&1
uci_radios="$(uci -q show wireless | sed -n 's/^wireless\.\([^.]*\)=wifi-device/\1/p')"
uci_count=$(echo $uci_radios | wc -w)
fi
if [ "$uci_count" -gt 0 ] && { [ "$phy_count" -eq 0 ] || [ "$uci_count" -ge "$phy_count" ]; }; then
return 0
fi
sleep 1
waited=$((waited + 1))
done
return 1
}
if ! wait_wifi_ready; then
log_error "未检测到可用无线硬件或无线配置生成超时!"
exit 1
fi
# -------------------------------------------------------------
# 4. 辅助函数:频段识别 & Hostname 解析
# -------------------------------------------------------------
detect_band() {
local radio="$1"
local band="$(uci -q get wireless.${radio}.band | tr 'A-Z' 'a-z')"
case "$band" in
*2g*|*2.4g*) echo "2g"; return ;;
*5g*) echo "5g"; return ;;
*6g*) echo "6g"; return ;;
esac
local channel="$(uci -q get wireless.${radio}.channel)"
if [ -n "$channel" ] && [ "$channel" -eq "$channel" ] 2>/dev/null; then
[ "$channel" -ge 1 ] && [ "$channel" -le 14 ] && { echo "2g"; return; }
[ "$channel" -ge 32 ] && [ "$channel" -le 177 ] && { echo "5g"; return; }
[ "$channel" -ge 180 ] && { echo "6g"; return; }
fi
local hwmode="$(uci -q get wireless.${radio}.hwmode | tr 'A-Z' 'a-z')"
case "$hwmode" in
*a*) echo "5g"; return ;;
*b*|*g*) echo "2g"; return ;;
esac
# 针对双频 radio0/radio1 的交叉推导
if [ "$radio" = "radio0" ] && [ "$(uci -q get wireless.radio1.band)" = "5g" ]; then
echo "2g"; return
elif [ "$radio" = "radio1" ] && [ "$(uci -q get wireless.radio0.band)" = "2g" ]; then
echo "5g"; return
fi
echo "2g"
}
get_base_ssid() {
[ -n "$CUSTOM_SSID" ] && { echo "$CUSTOM_SSID"; return; }
local h="$(uci -q get system.@system[0].hostname)"
case "$h" in
""|ieee80211|"(none)"|OpenWrt) echo "Kwrt" ;;
*) echo "$h" ;;
esac
}
# -------------------------------------------------------------
# 5. 无线配置生成
# -------------------------------------------------------------
BASE_SSID="$(get_base_ssid)"
# 清理 disabled 配置行并规范化 radio0/radio1 频段
sed -i '/option disabled/d' /etc/config/wireless 2>/dev/null
[ "$(uci -q get wireless.radio1.band)" = "5g" ] && [ -z "$(uci -q get wireless.radio0.band)" ] && \
uci -q set wireless.radio0.band="2g"
# 重命名现有匿名 wifi-iface 为 default_radioX,便于幂等管理
idx=0
while uci rename wireless.@wifi-iface[$idx]="default_radio$idx" 2>/dev/null; do
idx=$((idx + 1))
done
# 获取所有射频设备
RADIOS="$(uci -q show wireless | sed -n 's/^wireless\.\([^.]*\)=wifi-device/\1/p')"
[ -z "$RADIOS" ] && RADIOS="radio0 radio1 radio2 radio3"
for radio in $RADIOS; do
uci -q get wireless.${radio} >/dev/null 2>&1 || continue
band="$(detect_band "$radio")"
case "$band" in
2g) suffix="_2.4G" ;;
5g) suffix="_5G" ;;
6g) suffix="_6G" ;;
*) suffix="_${band}" ;;
esac
full_ssid="${BASE_SSID}${suffix}"
iface="default_${radio}"
# 配置 radio 参数
uci -q del wireless.${radio}.disabled
uci -q set wireless.${radio}.country='CN'
[ "$band" = "5g" ] && case "$DISTRIB_TARGET" in *ipq60xx*) uci -q set wireless.${radio}.htmode='HE80' ;; esac
# 配置 iface 参数
uci -q get wireless.${iface} >/dev/null 2>&1 || uci -q set wireless.${iface}=wifi-iface
uci -q set wireless.${iface}.device="${radio}"
uci -q set wireless.${iface}.mode='ap'
uci -q set wireless.${iface}.network='lan'
uci -q set wireless.${iface}.ssid="${full_ssid}"
if [ $HAS_PASSWD -eq 1 ] && [ -n "$CUSTOM_PASSWD" ]; then
enc="psk2"
[ "$band" = "6g" ] && enc="sae"
uci -q set wireless.${iface}.encryption="$enc"
uci -q set wireless.${iface}.key="$CUSTOM_PASSWD"
log_info "${radio} (${band}): SSID='${full_ssid}', 加密='${enc}'"
else
uci -q set wireless.${iface}.encryption='none'
uci -q del wireless.${iface}.key
log_info "${radio} (${band}): SSID='${full_ssid}', 无密码 (开放网络)"
fi
done
# -------------------------------------------------------------
# 6. 提交配置与重载
# -------------------------------------------------------------
uci commit wireless 2>/dev/null
if uci -q get base_config.@status[0] >/dev/null 2>&1; then
uci -q set base_config.@status[0].wifi=1
uci commit base_config 2>/dev/null
fi
wifi reload 2>/dev/null || /sbin/wifi reload 2>/dev/null
log_info "无线配置已更新并生效。"
-68
View File
@@ -1,68 +0,0 @@
#!/bin/ash
# 默认使用关机命令
ACTION="poweroff"
# 获取shutdown参数
# Qemu-GA 默认调用 -h -P +0的方式
while [ -n "$1" ]; do
case "$1" in
-r)
ACTION="reboot"
shift
;;
-k)
ACTION="warning"
shift
;;
-h|-H)
ACTION="halt"
shift
;;
-n)
ACTION="poweroff"
shift
;;
-c)
echo "Cancel shutdown, but not support the Openwrt!" > /dev/kmsg
ACTION="stop"
shift
;;
-p|-P)
ACTION="poweroff"
shift
;;
-*)
shift
;;
*)
break
;;
esac
done
if [ $# == 0 ]; then
echo "Shutting down without any params" > /dev/kmsg
/sbin/poweroff
elif [ "$ACTION" = "poweroff" ]; then
/sbin/poweroff;
elif [ "$ACTION" = "reboot" ]; then
/sbin/reboot
elif [ "$ACTION" = "warning" ]; then
echo "关机警告">/dev/kmsg
/sbin/poweroff;
elif [ "$ACTION" = "halt" ]; then
/sbin/halt
fi
@@ -1,14 +0,0 @@
<% if luci.sys.exec("echo -n `uci -q get base_config.@status[0].links`") ~= "0" then %>
<script>
var links = document.createElement('div');
links.innerHTML ='<table class="table"><tr class="tr"><td class="td left"><a href="https://openwrt.ai/" target="_blank">固件下载与定制</a></td><td class="td left" width="25%"><a href="https://openwrt.ai/fadian/" target="_blank" style="color:orangered">赞助</a></td><td class="td left" width="25%"><a href="https://github.com/kiddin9/Kwrt" target="_blank">源码与反馈</a></td><td class="td left" width="25%"><a href="https://t.me/opkwrt" target="_blank">TG交流</a></td></tr></table>';
setTimeout(function(){
var telegram = document.querySelectorAll(".cbi-section")[0];
telegram.appendChild(links);
}, 1500);
setTimeout(function(){
var telegram = document.querySelectorAll(".cbi-section")[0];
telegram.appendChild(links);
}, 2400);
</script>
<%end%>
@@ -1,45 +0,0 @@
'use strict';
'require rpc';
var callCPUFreeInfo = rpc.declare({
object: 'luci',
method: 'getCPUUsage'
});
function progressbar(value, max) {
var vn = parseInt(value) || 0,
mn = parseInt(max) || 100,
pc = Math.floor((100 / mn) * vn);
return E('div', {
'class': 'cbi-progressbar',
'title': '%s%% / %s%%'.format(vn, mn, pc)
}, E('div', { 'style': 'width:%.2f%%'.format(pc) }));
}
return L.Class.extend({
title: _('CPU'),
load: function() {
return L.resolveDefault(callCPUFreeInfo(), {});
},
render: function(info) {
var fields = [
_('Used'), (info.cpuusage) ? info.cpuusage : 0, 100
];
var table = E('table', { 'class': 'table cpu' });
for (var i = 0; i < fields.length; i += 3) {
table.appendChild(E('tr', { 'class': 'tr' }, [
E('td', { 'class': 'td left', 'width': '33%' }, [ fields[i] ]),
E('td', { 'class': 'td left' }, [
(fields[i + 1] != null) ? progressbar(fields[i + 1], fields[i + 2], true) : '?'
])
]));
}
return table;
}
});
-209
View File
@@ -1,209 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2021-04-12 14:21+0000\n"
"Language: zh_Hans\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.5-dev\n"
msgid "Processor"
msgstr "处理器"
msgid "Architecture"
msgstr "架构"
msgid "CPU Temperature"
msgstr "CPU 温度"
msgid "Temperature"
msgstr "温度"
msgid "CPU Info"
msgstr "CPU 信息"
msgid "CPU Model"
msgstr "处理器型号"
msgid "CPU frequency"
msgstr "CPU 频率"
msgid "RAM frequency"
msgstr "RAM 频率"
msgid "Flash Size"
msgstr "闪存大小"
msgid "Free Memory"
msgstr "释放内存"
msgid "RUNNING"
msgstr "运行中"
msgid "NOT RUNNING"
msgstr "未运行"
msgid "ZRam Settings"
msgstr "ZRam 设置"
msgid "ZRam Compression Algorithm"
msgstr "ZRam 压缩算法"
msgid "ZRam Compression Streams"
msgstr "ZRam 压缩数据流线程数"
msgid "ZRam Size"
msgstr "ZRam 大小"
msgid "Size of the ZRam device in megabytes"
msgstr "划分给 ZRam 分区的内存大小(MB),推荐留空由系统自动管理"
msgid "Number of parallel threads used for compression"
msgstr "用于压缩内存数据的CPU并发线程数"
msgid "Swap"
msgstr "虚拟内存"
msgid "Swap used"
msgstr "已用交换区"
msgid "Force 40MHz mode"
msgstr "强制 40MHz 频宽"
msgid ""
"Always use 40MHz channels even if the secondary channel overlaps. Using this "
"option does not comply with IEEE 802.11n-2009!"
msgstr "强制启用 40MHz 频宽并忽略辅助信道重叠。此选项可能不兼容某些无线硬件导致无法启用!"
msgid "Disassociate On Low Acknowledgement"
msgstr "弱信号剔除"
msgid "Allow AP mode to disconnect STAs based on low ACK condition"
msgstr "允许 AP 模式基于低 ACK 条件判断剔除弱信号的客户端"
msgid "Running Status"
msgstr "运行状况"
msgid "Online Users"
msgstr "在线用户数"
msgid "DNS Redirect"
msgstr "DNS 重定向"
msgid "Redirect client DNS to dnsmasq"
msgstr "重定向客户端DNS到dnsmasq"
msgid "Enable 256-QAM"
msgstr "启用 256-QAM"
msgid "802.11n 2.4Ghz Only"
msgstr "只适合 802.11n 2.4Ghz"
msgid "Enables The 802.11k standard provides information to discover the best available access point"
msgstr "启用 802.11k 自动寻找发现最佳可用接入点的信息"
msgid "Enable neighbor report via radio measurements"
msgstr "启用无线电测量邻居报告"
msgid "Enable beacon report via radio measurements"
msgstr "启用无线电测量信标报告"
msgid "Enables 802.11v allows client devices to exchange information about the network topology,tating overall improvement of the wireless network."
msgstr "启用 802.11v 将允许客户端设备交换有关网络拓扑的信息,从而全面改善无线网络漫游"
msgid "extended sleep mode for stations"
msgstr "扩展无线休眠节能模式"
msgid "BSS Transition Management"
msgstr "BSS 传输管理"
msgid "UTC time at which the TSF timer is 0"
msgstr "TSF计时器为0的UTC时间"
msgid "Time advertisement"
msgstr "广播同步时间"
msgid "time zone"
msgstr "时区"
msgid "Local time zone as specified in 8.3 of IEEE Std 1003.1-2004"
msgstr "本地时区采用 IEEE Std 1003.1-2004 的 8.3 格式(例如 UTC8)"
msgid "Custom Redirect Domain"
msgstr "自定义挟持域名"
msgid "Define a custom domain name and the corresponding PTR record"
msgstr "自定义域名对应的IP地址(需要客户端DNS指向本路由)"
msgid "Domain Name"
msgstr "域名(不带 HTTP(S)://)"
msgid "Comments"
msgstr "备注"
msgid "Packet Steering"
msgstr "数据包引导"
msgid "Enable packet steering across all CPUs. May help or hinder network speed."
msgstr "启用所有CPU的数据包控制。 可能有助于或阻碍网络速度。"
msgid "Disable IPv6 DNS forwards"
msgstr "禁止解析 IPv6 DNS 记录"
msgid "Filter IPv6(AAAA) DNS Query Name Resolve"
msgstr "过滤掉 IPv6(AAAA) ,只返回 IPv4 DNS 域名记录"
msgid "Minimum TTL to send to clients"
msgstr "客户端缓存的最小 DNS TTL"
msgid "Modify DNS entries minimum TTL (max is 86400, 0 is no modify)"
msgstr "修改发送到客户端的域名记录的 TTL 时间 (最大 86400, 0 表示不修改)"
msgid "FullCone NAT"
msgstr "全锥形 NAT"
msgid "Using FullCone NAT can improve gaming performance effectively"
msgstr "使用全锥形 NAT 可以有效提升游戏体验"
msgid "Used space"
msgstr "已用空间"
msgid "Upgrade all…"
msgstr "更新所有软件包 (谨慎)"
msgid "Expose WAN"
msgstr "暴露至公网"
msgid "Ports to Expose"
msgstr "需要暴露至公网的端口"
msgid "Danger! Proceed at your own risk."
msgstr "危险! 风险自担."
msgid "Multiple ports can be, separated by spaces, format: 80 81 82"
msgstr "可多端口,空格隔开,格式:80 81 82"
msgid "Expose SSH"
msgstr "暴露SSH至公网"
msgid "Expose Backend"
msgstr "暴露后台管理至公网"
msgid "Enable FullCone NAT"
msgstr "开启 FullCone NAT"
msgid "Enable FullCone NAT6"
msgstr "开启 FullCone NAT6"
msgid "Ethernet Information"
msgstr "网口信息"
msgid "Force redirect all local DNS queries to DNSMasq, a.k.a. DNS Hijacking."
msgstr "强制将所有本地 DNS 查询重定向到 DNSMasq,即 DNS 劫持。"
msgid "Auto Share"
msgstr "自动共享"
msgid "Auto share local disk which connected"
msgstr "自动匿名共享路由器所连接的硬盘"
-178
View File
@@ -1,178 +0,0 @@
msgid ""
msgstr ""
"PO-Revision-Date: 2021-04-12 14:21+0000\n"
"Language: zh_Hant\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 4.5-dev\n"
msgid "Processor"
msgstr "處理器"
msgid "Architecture"
msgstr "架構"
msgid "CPU Temperature"
msgstr "CPU 溫度"
msgid "CPU Info"
msgstr "CPU 資訊"
msgid "CPU Model"
msgstr "處理器型號"
msgid "CPU frequency"
msgstr "CPU 頻率"
msgid "RAM frequency"
msgstr "RAM 頻率"
msgid "Flash Size"
msgstr "閃存大小"
msgid "Free Memory"
msgstr "釋放記憶體"
msgid "RUNNING"
msgstr "運行中"
msgid "NOT RUNNING"
msgstr "未運行"
msgid "ZRam Settings"
msgstr "ZRam 設置"
msgid "ZRam Compression Algorithm"
msgstr "ZRam 壓縮算法"
msgid "ZRam Compression Streams"
msgstr "ZRam 壓縮數據流線程數"
msgid "ZRam Size"
msgstr "ZRam 大小"
msgid "Size of the ZRam device in megabytes"
msgstr "劃分給 ZRam 分區的內存大小(MB),推薦留空由系統自動管理"
msgid "Number of parallel threads used for compression"
msgstr "用於壓縮內存數據的CPU並發線程數"
msgid "Swap"
msgstr "(虛擬記憶體)交換區"
msgid "Swap used"
msgstr "已啟用交換區"
msgid "Force 40MHz mode"
msgstr "強制 40MHz 頻寬"
msgid ""
"Always use 40MHz channels even if the secondary channel overlaps. Using this "
"option does not comply with IEEE 802.11n-2009!"
msgstr "強制啟用 40MHz 頻寬並忽略輔助信道重疊。此選項可能不兼容某些無線硬件導致無法啟用!"
msgid "Disassociate On Low Acknowledgement"
msgstr "弱信號剔除"
msgid "Allow AP mode to disconnect STAs based on low ACK condition"
msgstr "允許 AP 模式基於低 ACK 條件判斷剔除弱信號的客戶端"
msgid "Running Status"
msgstr "運行狀況"
msgid "Online Users"
msgstr "在線用戶數"
msgid "DNS Redirect"
msgstr "DNS 重定向"
msgid "Redirect client DNS to dnsmasq"
msgstr "重定向客戶端DNS到dnsmasq"
msgid "Enable 256-QAM"
msgstr "啟用 256-QAM"
msgid "802.11n 2.4Ghz Only"
msgstr "只適合 802.11n 2.4Ghz"
msgid "Enables The 802.11k standard provides information to discover the best available access point"
msgstr "啟用 802.11k 自動尋找發現最佳可用接入點的資訊"
msgid "Enable neighbor report via radio measurements"
msgstr "啟用無線電測量鄰居報告"
msgid "Enable beacon report via radio measurements"
msgstr "啟用無線電測量信標報告"
msgid "Enables 802.11v allows client devices to exchange information about the network topology,tating overall improvement of the wireless network."
msgstr "啟用 802.11v 將允許客戶端設備交換有關網絡拓撲的資訊,從而全面改善無線網絡漫遊"
msgid "extended sleep mode for stations"
msgstr "擴展無線休眠節能模式"
msgid "BSS Transition Management"
msgstr "BSS 傳輸管理"
msgid "UTC time at which the TSF timer is 0"
msgstr "TSF計時器為0的UTC時間"
msgid "Time advertisement"
msgstr "廣播同步時間"
msgid "time zone"
msgstr "時區"
msgid "Local time zone as specified in 8.3 of IEEE Std 1003.1-2004"
msgstr "本地時區採用 IEEE Std 1003.1-2004 的 8.3 格式(例如 UTC8)"
msgid "Custom Redirect Domain"
msgstr "自定義域名轉址"
msgid "Define a custom domain name and the corresponding PTR record"
msgstr "自定義域名對應的IP地址(需要客戶端DNS指向本路由)"
msgid "Domain Name"
msgstr "域名(不帶 HTTP(S)://)"
msgid "Comments"
msgstr "備註"
msgid "Packet Steering"
msgstr "數據包引導"
msgid "Enable packet steering across all CPUs. May help or hinder network speed."
msgstr "啟用所有CPU的數據包控制。 可能有助於或阻礙網路速度。"
msgid "Disable IPv6 DNS forwards"
msgstr "禁止解析 IPv6 DNS 記錄"
msgid "Filter IPv6(AAAA) DNS Query Name Resolve"
msgstr "過濾掉 IPv6(AAAA) ,只返回 IPv4 DNS 域名記錄"
msgid "Minimum TTL to send to clients"
msgstr "客戶端緩存的最小 DNS TTL"
msgid "Modify DNS entries minimum TTL (max is 86400, 0 is no modify)"
msgstr "修改發送到客戶端的域名記錄的 TTL 時間 (最大 86400, 0 表示不修改)"
msgid "FullCone NAT"
msgstr "完全錐形 NAT"
msgid "Using FullCone NAT can improve gaming performance effectively"
msgstr "使用完全錐形 NAT 可以有效提升遊戲體驗"
msgid "Used space"
msgstr "已用空間"
msgid "Upgrade all…"
msgstr "更新所有軟件包 (謹慎)"
msgid "Temperature"
msgstr "溫度"
msgid "Ethernet Information"
msgstr "乙太網路資訊"
msgid "Force redirect all local DNS queries to DNSMasq, a.k.a. DNS Hijacking."
msgstr "強制將所有本地 DNS 查詢轉址到 DNSMasq,即 DNS 劫持。"