From b1cac55cefd620d11830b47b58584bd246fee5fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 11 Sep 2022 23:44:21 +0800 Subject: [PATCH] update 2022-09-11 23:44:21 --- luci-app-v2raya/Makefile | 2 +- luci-app-v2raya/luasrc/controller/v2raya.lua | 8 +-- .../cbi/v2raya/{v2raya.lua => basic.lua} | 53 ++++++++++++------- luci-app-v2raya/po/zh-cn/v2raya.po | 16 ++++++ 4 files changed, 56 insertions(+), 23 deletions(-) rename luci-app-v2raya/luasrc/model/cbi/v2raya/{v2raya.lua => basic.lua} (59%) diff --git a/luci-app-v2raya/Makefile b/luci-app-v2raya/Makefile index 53b5487fe..5ec578f43 100644 --- a/luci-app-v2raya/Makefile +++ b/luci-app-v2raya/Makefile @@ -6,7 +6,7 @@ LUCI_PKGARCH:=all PKG_NAME:=luci-app-v2raya PKG_VERSION:=1.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_MAINTAINER:=zxlhhyccc diff --git a/luci-app-v2raya/luasrc/controller/v2raya.lua b/luci-app-v2raya/luasrc/controller/v2raya.lua index 38fa47720..c66946d1e 100644 --- a/luci-app-v2raya/luasrc/controller/v2raya.lua +++ b/luci-app-v2raya/luasrc/controller/v2raya.lua @@ -5,15 +5,15 @@ function index() return end - local page = entry({"admin", "services", "v2raya"}, alias("admin", "services", "v2raya", "v2raya"), _("v2rayA"), 30) + local page = entry({"admin", "services", "v2raya"}, alias("admin", "services", "v2raya", "basic"), _("v2rayA"), 30) page.dependent = true page.acl_depends = { "luci-app-v2raya" } - entry({"admin", "services", "v2raya", "v2raya"}, cbi("v2raya/v2raya"), _("Basic Setting"), 1).leaf = true - entry({"admin", "services", "v2raya", "log"}, cbi("v2raya/log"), _("Logs"), 2).leaf = true - entry({"admin", "services", "v2raya", "status"}, call("act_status")).leaf = true + entry({"admin", "services", "v2raya", "basic"}, cbi("v2raya/basic")).leaf = true + entry({"admin", "services", "v2raya", "log"}, cbi("v2raya/log")).leaf = true entry({"admin", "services", "v2raya", "get_log"}, call("get_log")).leaf = true entry({"admin", "services", "v2raya", "clear_log"}, call("clear_log")).leaf = true + entry({"admin", "services", "v2raya", "status"}, call("act_status")).leaf = true end function act_status() diff --git a/luci-app-v2raya/luasrc/model/cbi/v2raya/v2raya.lua b/luci-app-v2raya/luasrc/model/cbi/v2raya/basic.lua similarity index 59% rename from luci-app-v2raya/luasrc/model/cbi/v2raya/v2raya.lua rename to luci-app-v2raya/luasrc/model/cbi/v2raya/basic.lua index 79aefd002..5d7b73e95 100644 --- a/luci-app-v2raya/luasrc/model/cbi/v2raya/v2raya.lua +++ b/luci-app-v2raya/luasrc/model/cbi/v2raya/basic.lua @@ -15,44 +15,52 @@ m.description = translate("v2rayA is a V2Ray Linux client supporting global tran m:section(SimpleSection).template = "v2raya/v2raya_status" s = m:section(TypedSection, "v2raya") +s:tab("settings", translate("Basic Setting")) +s:tab("log", translate("Logs")) s.addremove = false s.anonymous = true -o = s:option(Flag, "enabled", translate("Enabled")) -o.default = 0 +o = s:taboption("settings", Flag, "enabled", translate("Enabled")) +o.default = o.disabled o.rmempty = false -o = s:option(DummyValue,"v2raya_version",translate("v2rayA Version")) +o = s:taboption("settings", DummyValue,"v2raya_version",translate("v2rayA Version")) o.rawhtml = true o.value = v2raya_version -o = s:option(Value, "address", translate("GUI access address")) +o = s:taboption("settings", Value, "address", translate("GUI access address")) o.description = translate("Use 0.0.0.0:2017 to monitor all access.") +--[[o.datatype = 'ipaddrport(1)']]-- o.default = "http://0.0.0.0:2017" o.rmempty = false -o = s:option(Value, "config", translate("v2rayA configuration directory")) +o = s:taboption("settings", Value, "config", translate("v2rayA configuration directory")) o.rmempty = '/etc/v2raya' +o.rmempty = false; -o = s:option(ListValue, "ipv6_support", translate("Ipv6 Support")) +o = s:taboption("settings", ListValue, "ipv6_support", translate("Ipv6 Support")) o.description = translate("Make sure your IPv6 network works fine before you turn it on.") o:value("auto", translate("AUTO")) o:value("on", translate("ON")) o:value("off", translate("OFF")) o.default = auto +o.rmempty = false -o = s:option(Value, "log_file", translate("Log file")) +o = s:taboption("settings", Value, "log_file", translate("Log file")) o.default = "/var/log/v2raya/v2raya.log" +o.rmempty = false +o.readonly = true -o = s:option(ListValue, "log_level", translate("Log Level")) +o = s:taboption("settings", ListValue, "log_level", translate("Log Level")) o:value("trace",translate("Trace")) o:value("debug",translate("Debug")) o:value("info",translate("Info")) o:value("warn",translate("Warning")) o:value("error",translate("Error")) o.default = "Info" +o.rmempty = false -o = s:option(ListValue, "log_max_days", translate("Log Keepd Max Days")) +o = s:taboption("settings", ListValue, "log_max_days", translate("Log Keepd Max Days")) o.description = translate("Maximum number of days to keep log files is 3 day.") o.datatype = "uinteger" o:value("1", translate("1")) @@ -60,19 +68,24 @@ o:value("2", translate("2")) o:value("3", translate("3")) o.default = 3 o.rmempty = false -o.optional = false -o = s:option(Flag, "log_disable_color", translate("Disable log color")) -o.default = '1' +o = s:taboption("settings", Flag, "log_disable_color", translate("Disable log color")) +o.default = o.enabled o.rmempty = false -o.optional = false -o = s:option(Flag, "log_disable_timestamp", translate("Log disable timestamp")) -o.default = '0' +o = s:taboption("settings", Flag, "log_disable_timestamp", translate("Log disable timestamp")) +o.default = o.disabled o.rmempty = false -o.optional = false -o = s:option(Value, "vless_grpc_inbound_cert_key", translate("Upload certificate")) +o = s:taboption("settings", Value, "v2ray_bin", translate("v2ray binary path")) +o.description = translate("Executable v2ray binary path. Auto-detect if put it empty (recommended).") +o.datatype = 'path' + +o = s:taboption("settings", Value, "v2ray_confdir", translate("Extra config directory")) +o.description = translate("Additional v2ray config directory, files in it will be combined with config generated by v2rayA.") +o.datatype = 'path' + +o = s:taboption("settings", Value, "vless_grpc_inbound_cert_key", translate("Upload certificate")) o.description = translate("Specify the certification path instead of automatically generating a self-signed certificate.") o.template = "v2raya/v2raya_certupload" @@ -106,10 +119,14 @@ if luci.http.formvalue("upload") then end end -o = s:option(Value, "vless_grpc_inbound_cert_key", translate("Upload Certificate Path")) +o = s:taboption("settings", Value, "vless_grpc_inbound_cert_key", translate("Upload Certificate Path")) o.description = translate("This is the path where the certificate resides after the certificate is uploaded.") o.default = "/etc/v2raya/cert.crt,/etc/v2raya/cert.key" +o = s:taboption("log", Value, "log", translate("Logs")) +o.template = "v2raya/v2raya_log" +--[[o.rows = 50]]-- + o.inputstyle = "reload" luci.sys.exec("/etc/init.d/v2raya start >/dev/null 2>&1 &") diff --git a/luci-app-v2raya/po/zh-cn/v2raya.po b/luci-app-v2raya/po/zh-cn/v2raya.po index 9397e10ad..fe1c90d03 100644 --- a/luci-app-v2raya/po/zh-cn/v2raya.po +++ b/luci-app-v2raya/po/zh-cn/v2raya.po @@ -79,6 +79,22 @@ msgstr "禁用日志颜色" msgid "Log disable timestamp" msgstr "禁用日志时间戳" +msgid "v2ray binary path" +msgstr "v2ray 二进制路径" + +msgid "" +"Executable v2ray binary path. Auto-detect if put it empty (recommended)." +msgstr "v2ray 可执行二进制文件目录。留空以自动检测(推荐)。" + +msgid "Extra config directory" +msgstr "附加配置目录" + +msgid "" +"Additional v2ray config directory, files in it will be combined with config " +"generated by v2rayA." +msgstr "" +"附加 v2ray 配置目录,包含在其中的文件将被合并至 v2rayA 生成的配置文件中。" + msgid "Upload certificate" msgstr "上传证书"