mirror of
https://github.com/roacn/openwrt-packages.git
synced 2025-01-07 03:16:45 +08:00
🛸 Sync 2024-12-11 00:35
This commit is contained in:
parent
732f73a109
commit
1221a5ba21
@ -278,8 +278,20 @@ if api.fs.access(gfwlist_path) then
|
||||
o.rows = 45
|
||||
o.wrap = "off"
|
||||
o.cfgvalue = function(self, section)
|
||||
return fs.readfile(gfwlist_path) or ""
|
||||
local limit = 100 -- 限制行数
|
||||
local cmd = string.format("head -n %d %s", limit, gfwlist_path)
|
||||
return api.sys.exec(cmd) or ""
|
||||
-- return fs.readfile(gfwlist_path) or ""
|
||||
end
|
||||
local total_lines_cmd = string.format("wc -l < %s", gfwlist_path)
|
||||
local total_lines = tonumber(api.sys.exec(total_lines_cmd)) or 0
|
||||
local displayed_lines = 100
|
||||
|
||||
local total_lines_label = s:taboption("gfw_list", DummyValue, "total_lines", translate("Total Lines"))
|
||||
total_lines_label.value = translatef("%d lines", total_lines)
|
||||
|
||||
local displayed_lines_label = s:taboption("gfw_list", DummyValue, "displayed_lines", translate("Displayed Lines"))
|
||||
displayed_lines_label.value = translatef("%d lines", displayed_lines)
|
||||
end
|
||||
|
||||
if api.fs.access(chnlist_path) then
|
||||
@ -289,8 +301,20 @@ if api.fs.access(chnlist_path) then
|
||||
o.rows = 45
|
||||
o.wrap = "off"
|
||||
o.cfgvalue = function(self, section)
|
||||
return fs.readfile(chnlist_path) or ""
|
||||
local limit = 100 -- 限制行数
|
||||
local cmd = string.format("head -n %d %s", limit, chnlist_path)
|
||||
return api.sys.exec(cmd) or ""
|
||||
-- return fs.readfile(chnlist_path) or ""
|
||||
end
|
||||
local total_lines_cmd = string.format("wc -l < %s", chnlist_path)
|
||||
local total_lines = tonumber(api.sys.exec(total_lines_cmd)) or 0
|
||||
local displayed_lines = 100
|
||||
|
||||
local total_lines_label = s:taboption("chn_list", DummyValue, "total_lines", translate("Total Lines"))
|
||||
total_lines_label.value = translatef("%d lines", total_lines)
|
||||
|
||||
local displayed_lines_label = s:taboption("chn_list", DummyValue, "displayed_lines", translate("Displayed Lines"))
|
||||
displayed_lines_label.value = translatef("%d lines", displayed_lines)
|
||||
end
|
||||
|
||||
if api.fs.access(chnroute_path) then
|
||||
@ -300,8 +324,20 @@ if api.fs.access(chnroute_path) then
|
||||
o.rows = 45
|
||||
o.wrap = "off"
|
||||
o.cfgvalue = function(self, section)
|
||||
return fs.readfile(chnroute_path) or ""
|
||||
local limit = 100 -- 限制行数
|
||||
local cmd = string.format("head -n %d %s", limit, chnroute_path)
|
||||
return api.sys.exec(cmd) or ""
|
||||
-- return fs.readfile(chnroute_path) or ""
|
||||
end
|
||||
local total_lines_cmd = string.format("wc -l < %s", chnroute_path)
|
||||
local total_lines = tonumber(api.sys.exec(total_lines_cmd)) or 0
|
||||
local displayed_lines = 100
|
||||
|
||||
local total_lines_label = s:taboption("chnroute_list", DummyValue, "total_lines", translate("Total Lines"))
|
||||
total_lines_label.value = translatef("%d lines", total_lines)
|
||||
|
||||
local displayed_lines_label = s:taboption("chnroute_list", DummyValue, "displayed_lines", translate("Displayed Lines"))
|
||||
displayed_lines_label.value = translatef("%d lines", displayed_lines)
|
||||
end
|
||||
|
||||
m:append(Template(appname .. "/rule_list/js"))
|
||||
|
@ -1725,3 +1725,12 @@ msgstr "与使用 %s 节点时生效。"
|
||||
|
||||
msgid "Set the default domain resolution strategy for the sing-box node."
|
||||
msgstr "为 sing-box 节点设置默认的域名解析策略。"
|
||||
|
||||
msgid "Total Lines"
|
||||
msgstr "总行数:"
|
||||
|
||||
msgid "Displayed Lines"
|
||||
msgstr "展示行数:"
|
||||
|
||||
msgid "%d lines"
|
||||
msgstr "%d 行"
|
||||
|
Loading…
Reference in New Issue
Block a user