parent
d69b420733
commit
fd78cc0d49
@ -278,8 +278,20 @@ if api.fs.access(gfwlist_path) then
|
|||||||
o.rows = 45
|
o.rows = 45
|
||||||
o.wrap = "off"
|
o.wrap = "off"
|
||||||
o.cfgvalue = function(self, section)
|
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
|
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
|
end
|
||||||
|
|
||||||
if api.fs.access(chnlist_path) then
|
if api.fs.access(chnlist_path) then
|
||||||
@ -289,8 +301,20 @@ if api.fs.access(chnlist_path) then
|
|||||||
o.rows = 45
|
o.rows = 45
|
||||||
o.wrap = "off"
|
o.wrap = "off"
|
||||||
o.cfgvalue = function(self, section)
|
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
|
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
|
end
|
||||||
|
|
||||||
if api.fs.access(chnroute_path) then
|
if api.fs.access(chnroute_path) then
|
||||||
@ -300,8 +324,20 @@ if api.fs.access(chnroute_path) then
|
|||||||
o.rows = 45
|
o.rows = 45
|
||||||
o.wrap = "off"
|
o.wrap = "off"
|
||||||
o.cfgvalue = function(self, section)
|
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
|
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
|
end
|
||||||
|
|
||||||
m:append(Template(appname .. "/rule_list/js"))
|
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."
|
msgid "Set the default domain resolution strategy for the sing-box node."
|
||||||
msgstr "为 sing-box 节点设置默认的域名解析策略。"
|
msgstr "为 sing-box 节点设置默认的域名解析策略。"
|
||||||
|
|
||||||
|
msgid "Total Lines"
|
||||||
|
msgstr "总行数:"
|
||||||
|
|
||||||
|
msgid "Displayed Lines"
|
||||||
|
msgstr "展示行数:"
|
||||||
|
|
||||||
|
msgid "%d lines"
|
||||||
|
msgstr "%d 行"
|
||||||
|
Loading…
Reference in New Issue
Block a user