Переглянути джерело

luci-app-ssr-plus: Add `SS` plug custom Settings.

zxlhhyccc 7 місяців тому
батько
коміт
43bdcbb077

+ 5 - 0
luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua

@@ -296,9 +296,14 @@ end
 if is_finded("xray-plugin") then
 	o:value("xray-plugin", translate("xray-plugin"))
 end
+o:value("custom", translate("Custom"))
 o.rmempty = true
 o:depends({type = "ss", enable_plugin = true})
 
+o = s:option(Value, "custom_plugin", translate("Custom Plugin Path"))
+o.placeholder = "/path/to/custom-plugin"
+o:depends({plugin = "custom"})
+
 o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
 o.rmempty = true
 o:depends({type = "ss", enable_plugin = true})

+ 6 - 0
luci-app-ssr-plus/po/zh_Hans/ssr-plus.po

@@ -849,6 +849,12 @@ msgstr "启用插件"
 msgid "Plugin"
 msgstr "插件"
 
+msgid "Custom"
+msgstr "自定义"
+
+msgid "Custom Plugin Path"
+msgstr "自定义插件路径"
+
 msgid "Plugin Opts"
 msgstr "插件参数"
 

+ 5 - 1
luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua

@@ -580,7 +580,11 @@ function config:handleIndex(index)
 		ss = function()
 			ss.protocol = socks_port
 			if server.enable_plugin == "1" and server.plugin and server.plugin ~= "none" then
-				ss.plugin = server.plugin
+				if server.plugin == "custom" then
+					ss.plugin = server.custom_plugin
+				else
+					ss.plugin = server.plugin
+				end
 				ss.plugin_opts = server.plugin_opts or nil
 			end
 			print(json.stringify(ss, 1))