From 1ab4ce1a5e12afbecf1ed74c49ee91c8a049ca0b Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Tue, 16 Aug 2022 13:56:35 +0800 Subject: [PATCH 1/4] luci-app-frpc: fix local_ip datatype Signed-off-by: Liangbin Lian --- .../luci-app-frpc/htdocs/luci-static/resources/view/frpc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js b/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js index c859aa177f..3eb4b3dbc5 100644 --- a/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js +++ b/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js @@ -45,7 +45,7 @@ var baseProxyConf = [ [form.ListValue, 'type', _('Proxy type'), _('ProxyType specifies the type of this proxy. Valid values include "tcp", "udp", "http", "https", "stcp", and "xtcp".
By default, this value is "tcp".'), {values: ['tcp', 'udp', 'http', 'https', 'stcp', 'xtcp']}], [form.Flag, 'use_encryption', _('Encryption'), _('UseEncryption controls whether or not communication with the server will be encrypted. Encryption is done using the tokens supplied in the server and client configuration.
By default, this value is false.'), {datatype: 'bool'}], [form.Flag, 'use_compression', _('Compression'), _('UseCompression controls whether or not communication with the server will be compressed.
By default, this value is false.'), {datatype: 'bool'}], - [form.Value, 'local_ip', _('Local IP'), _('LocalIp specifies the IP address or host name to proxy to.'), {datatype: 'ipaddr'}], + [form.Value, 'local_ip', _('Local IP'), _('LocalIp specifies the IP address or host name to proxy to.'), {datatype: 'host'}], [form.Value, 'local_port', _('Local port'), _('LocalPort specifies the port to proxy to.'), {datatype: 'port'}], ]; From a185562836408ff38dcd0a48f076831424903ba1 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Tue, 16 Aug 2022 13:57:43 +0800 Subject: [PATCH 2/4] luci-app-frpc: show remote port Signed-off-by: Liangbin Lian --- .../htdocs/luci-static/resources/view/frpc.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js b/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js index 3eb4b3dbc5..84eb9f8655 100644 --- a/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js +++ b/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js @@ -212,6 +212,14 @@ return view.extend({ s.option(form.Value, 'type', _('Proxy type')).modalonly = false; s.option(form.Value, 'local_ip', _('Local IP')).modalonly = false; s.option(form.Value, 'local_port', _('Local port')).modalonly = false; + o = s.option(form.Value, 'remote_port', _('Remote port')); + o.modalonly = false; + o.depends('type', 'tcp'); + o.depends('type', 'udp'); + o.cfgvalue = function() { + var v = this.super('cfgvalue', arguments); + return v&&v!='0'?v:'#'; + }; defTabOpts(s, 'general', baseProxyConf, {modalonly: true}); From 4a7726ac624611c2226dad2a6ee22f4008b37381 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Tue, 16 Aug 2022 14:00:47 +0800 Subject: [PATCH 3/4] luci-app-frpc: fix translation Signed-off-by: Liangbin Lian --- applications/luci-app-frpc/po/zh_Hans/frpc.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/luci-app-frpc/po/zh_Hans/frpc.po b/applications/luci-app-frpc/po/zh_Hans/frpc.po index 68d911256f..61e94001d4 100644 --- a/applications/luci-app-frpc/po/zh_Hans/frpc.po +++ b/applications/luci-app-frpc/po/zh_Hans/frpc.po @@ -197,15 +197,15 @@ msgstr "本地 IP" #: applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js:49 #: applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js:214 msgid "Local port" -msgstr "监听端口" +msgstr "本地端口" #: applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js:48 msgid "LocalIp specifies the IP address or host name to proxy to." -msgstr "LocalIp 指定要被代理的 IP 地址或主机名。" +msgstr "本地 IP 指定要被代理的 IP 地址或主机名。" #: applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js:49 msgid "LocalPort specifies the port to proxy to." -msgstr "LocalPort 指定要被代理的端口。" +msgstr "本地端口指定要被代理的端口。" #: applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js:62 msgid "Locations" From 175487f054b904383673d85ca95bdccb386919c1 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Tue, 16 Aug 2022 14:03:09 +0800 Subject: [PATCH 4/4] luci-app-frpc: add plugin options Signed-off-by: Liangbin Lian --- .../htdocs/luci-static/resources/view/frpc.js | 14 ++++++++++++++ applications/luci-app-frpc/po/templates/frpc.pot | 15 +++++++++++++++ applications/luci-app-frpc/po/zh_Hans/frpc.po | 15 +++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js b/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js index 84eb9f8655..0999ba0294 100644 --- a/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js +++ b/applications/luci-app-frpc/htdocs/luci-static/resources/view/frpc.js @@ -72,6 +72,16 @@ var stcpProxyConf = [ [form.Value, 'sk', _('Sk')], ]; +var pluginConf = [ + [form.ListValue, 'plugin', _('Plugin'), undefined, {values: ['', 'http_proxy', 'socks5', 'unix_domain_socket'], rmempty: true}], + [form.Value, 'plugin_http_user', _('HTTP user'), undefined, {depends: {plugin: 'http_proxy'}}], + [form.Value, 'plugin_http_passwd', _('HTTP password'), undefined, {depends: {plugin: 'http_proxy'}}], + [form.Value, 'plugin_user', _('SOCKS5 user'), undefined, {depends: {plugin: 'socks5'}}], + [form.Value, 'plugin_passwd', _('SOCKS5 password'), undefined, {depends: {plugin: 'socks5'}}], + [form.Value, 'plugin_unix_path', _('Unix domain socket path'), undefined, {depends: {plugin: 'unix_domain_socket'}, optional: false, rmempty: false, + datatype: 'file', placeholder: '/var/run/docker.sock', default: '/var/run/docker.sock'}], +]; + function setParams(o, params) { if (!params) return; for (var key in params) { @@ -207,6 +217,7 @@ return view.extend({ s.tab('general', _('General Settings')); s.tab('http', _('HTTP Settings')); + s.tab('plugin', _('Plugin Settings')); s.option(form.Value, 'name', _('Proxy name')).modalonly = false; s.option(form.Value, 'type', _('Proxy type')).modalonly = false; @@ -235,6 +246,9 @@ return view.extend({ // STCP and XTCP defTabOpts(s, 'general', stcpProxyConf, {modalonly: true, depends: [{type: 'stcp'}, {type: 'xtcp'}]}); + // Plugin + defTabOpts(s, 'plugin', pluginConf, {modalonly: true}); + return m.render(); } }); diff --git a/applications/luci-app-frpc/po/templates/frpc.pot b/applications/luci-app-frpc/po/templates/frpc.pot index 87e72ffe71..938dea5729 100644 --- a/applications/luci-app-frpc/po/templates/frpc.pot +++ b/applications/luci-app-frpc/po/templates/frpc.pot @@ -410,3 +410,18 @@ msgstr "" #: applications/luci-app-frpc/root/usr/share/luci/menu.d/luci-app-frpc.json:3 msgid "frp Client" msgstr "" + +msgid "Plugin Settings" +msgstr "" + +msgid "Plugin" +msgstr "" + +msgid "SOCKS5 user" +msgstr "" + +msgid "SOCKS5 password" +msgstr "" + +msgid "Unix domain socket path" +msgstr "" diff --git a/applications/luci-app-frpc/po/zh_Hans/frpc.po b/applications/luci-app-frpc/po/zh_Hans/frpc.po index 61e94001d4..e876bcccd4 100644 --- a/applications/luci-app-frpc/po/zh_Hans/frpc.po +++ b/applications/luci-app-frpc/po/zh_Hans/frpc.po @@ -454,5 +454,20 @@ msgstr "" msgid "frp Client" msgstr "frp 客户端" +msgid "Plugin Settings" +msgstr "插件设置" + +msgid "Plugin" +msgstr "插件" + +msgid "SOCKS5 user" +msgstr "SOCKS5 用户" + +msgid "SOCKS5 password" +msgstr "SOCKS5 密码" + +msgid "Unix domain socket path" +msgstr "Unix 域套接字路径" + #~ msgid "Name can not be \"common\"" #~ msgstr "名称不能\"common\""