mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 08:44:29 +00:00
refactor: move log level configuration to the Log tab and add issue report button
This commit is contained in:
parent
27566be57f
commit
1938207eb7
6
.github/ISSUE_TEMPLATE/bug-report.md
vendored
6
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@ -8,7 +8,11 @@ assignees: ''
|
||||
---
|
||||
|
||||
我的 OpenWrt 发行版:
|
||||
|
||||
我的 OpenWrt 发行版版本:
|
||||
UA3F 的版本:
|
||||
|
||||
我的 UA3F 版本:
|
||||
|
||||
OpenWrt 有无同时运行 Clash 等代理客户端:
|
||||
|
||||
请提供 debug 运行日志。
|
||||
|
||||
@ -58,17 +58,6 @@ function M.add_general_fields(section)
|
||||
port:depends("server_mode", "TPROXY")
|
||||
port:depends("server_mode", "REDIRECT")
|
||||
|
||||
-- Log Level
|
||||
local log_level = section:taboption("general", ListValue, "log_level", translate("Log Level"))
|
||||
log_level:value("debug")
|
||||
log_level:value("info")
|
||||
log_level:value("warn")
|
||||
log_level:value("error")
|
||||
log_level:value("fatal")
|
||||
log_level:value("panic")
|
||||
log_level.description = translate(
|
||||
"Sets the logging level. Do not keep the log level set to debug/info/warn for an extended period of time.")
|
||||
|
||||
-- Rewrite Mode
|
||||
local rewrite_mode = section:taboption("general", ListValue, "rewrite_mode", translate("Rewrite Mode"))
|
||||
rewrite_mode:value("DIRECT", translate("Direct Forward"))
|
||||
@ -143,6 +132,17 @@ function M.add_log_fields(section)
|
||||
luci.http.write("</script>")
|
||||
end
|
||||
|
||||
-- Log Level
|
||||
local log_level = section:taboption("log", ListValue, "log_level", translate("Log Level"))
|
||||
log_level:value("debug")
|
||||
log_level:value("info")
|
||||
log_level:value("warn")
|
||||
log_level:value("error")
|
||||
log_level:value("fatal")
|
||||
log_level:value("panic")
|
||||
log_level.description = translate(
|
||||
"Sets the logging level. Do not keep the log level set to debug/info/warn for an extended period of time.")
|
||||
|
||||
-- Log Lines
|
||||
local logLines = section:taboption("log", Value, "log_lines", translate("Display Lines"))
|
||||
logLines.default = "1000"
|
||||
@ -182,6 +182,25 @@ function M.add_log_fields(section)
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin/services/ua3f/download_log"))
|
||||
end
|
||||
|
||||
-- Issue Report Button
|
||||
local issue = section:taboption("log", Button, "_issue", translate("Issue Report"))
|
||||
issue.inputtitle = translate("Issue Report")
|
||||
issue.inputstyle = "save"
|
||||
function issue.write(self, section)
|
||||
end
|
||||
|
||||
function issue.render(self, section, scope)
|
||||
Button.render(self, section, scope)
|
||||
luci.http.write([[
|
||||
<script>
|
||||
document.querySelector("input[name='cbid.ua3f.main._issue']").addEventListener("click", function(e) {
|
||||
e.preventDefault();
|
||||
window.open('https://github.com/SunBK201/UA3F/issues/new?template=bug-report.md', '_blank');
|
||||
});
|
||||
</script>
|
||||
]])
|
||||
end
|
||||
|
||||
return log
|
||||
end
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ msgid "Display Lines"
|
||||
msgstr "显示行数"
|
||||
|
||||
msgid "Sets the logging level. Do not keep the log level set to debug/info/warn for an extended period of time."
|
||||
msgstr "设置日志级别,请勿长时间将日志级别设置为 debug / info / warn"
|
||||
msgstr "设置日志级别,debug / info / warn 仅用于问题反馈与调试,请勿长时间保持该级别。"
|
||||
|
||||
msgid "Download Logs"
|
||||
msgstr "下载日志"
|
||||
@ -265,3 +265,6 @@ msgstr "固定 IP ID"
|
||||
|
||||
msgid "Set the IP ID to 0 for packets"
|
||||
msgstr "将数据包的 IP ID 设置为 0,不推荐开启,除非你知道这是什么"
|
||||
|
||||
msgid "Issue Report"
|
||||
msgstr "问题反馈"
|
||||
Loading…
Reference in New Issue
Block a user