diff --git a/package/ntlf9t/luci-app-clash/luasrc/model/cbi/clash/create.lua b/package/ntlf9t/luci-app-clash/luasrc/model/cbi/clash/create.lua index 831a92acd7..7824cf6c19 100644 --- a/package/ntlf9t/luci-app-clash/luasrc/model/cbi/clash/create.lua +++ b/package/ntlf9t/luci-app-clash/luasrc/model/cbi/clash/create.lua @@ -62,10 +62,6 @@ cc = s:option(Flag, "create", translate("Enable Create")) cc.default = 1 cc.description = translate("Enable to create configuration") -cc = s:option(Flag, "ping_enable", translate("Enable Ping Servers")) -cc.default = 0 -cc.description = translate("Enable Ping Servers") - o = s:option(Value, "create_tag") o.title = translate("Config Name") o.rmempty = true diff --git a/package/ntlf9t/luci-app-clash/luasrc/model/cbi/clash/servers-config.lua b/package/ntlf9t/luci-app-clash/luasrc/model/cbi/clash/servers-config.lua index 167519e084..00ea391d65 100644 --- a/package/ntlf9t/luci-app-clash/luasrc/model/cbi/clash/servers-config.lua +++ b/package/ntlf9t/luci-app-clash/luasrc/model/cbi/clash/servers-config.lua @@ -1,15 +1,10 @@ local m, s, o local clash = "clash" -local uci = luci.model.uci.cursor() -local fs = require "nixio.fs" -local sys = require "luci.sys" local sid = arg[1] local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid") -local server_table = {} - local encrypt_methods_ss = { "rc4-md5", @@ -86,11 +81,17 @@ if m.uci:get(clash, sid) ~= "servers" then return end + -- [[ Servers Setting ]]-- s = m:section(NamedSection, sid, "servers") s.anonymous = true s.addremove = false +o = s:option(DummyValue,"ssr_url",translate("Import config info")) +o.rawhtml = true +o.template = "clash/ssrurl" +o.value =sid + o = s:option(ListValue, "type", translate("Server Node Type")) o:value("ss", translate("Shadowsocks")) o:value("ssr", translate("ShadowsocksR")) @@ -100,6 +101,8 @@ o:value("http", translate("HTTP(S)")) o:value("snell", translate("Snell")) o:value("trojan", translate("trojan")) + + o.description = translate("Using incorrect encryption mothod may causes service fail to start") o = s:option(Value, "name", translate("Alias")) @@ -302,7 +305,7 @@ o:depends("type", "trojan") -- [[ alpn ]]-- o = s:option(DynamicList, "alpn", translate("alpn")) -o.rmempty = true +o.default = "http/1.1" o:value("h2") o:value("http/1.1") o:depends("type", "trojan") diff --git a/package/ntlf9t/luci-app-clash/luasrc/view/clash/list.htm b/package/ntlf9t/luci-app-clash/luasrc/view/clash/list.htm index 75631cde96..5ed961788b 100644 --- a/package/ntlf9t/luci-app-clash/luasrc/view/clash/list.htm +++ b/package/ntlf9t/luci-app-clash/luasrc/view/clash/list.htm @@ -1,3 +1,5 @@ + + <% local dsp = require "luci.dispatcher" -%> @@ -6,44 +8,40 @@ local dsp = require "luci.dispatcher" //',{ - + XHR.get('<%=dsp.build_url("admin", "services", "clash", "ping")%>', { index: i, domain: pings[i].getAttribute("hint") }, function(x, result) { - - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "clash", "ping_check")%>', null, function(x, status) { - if ( x && x.status == 200 ) { - if(status.ping_enable==1){ - pings[result.index].innerHTML = (result.ping ? ''+result.ping+' ms' : '<%:Error%>'); - }else{ - pings[result.index].innerHTML = result.ping ? '<%:DISABLED%>' : '<%:DISABLED%>'; - } + if (result.ping < 500) { + pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Error%>"); } - }) + if (result.ping < 200){ + pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Error%>"); + } + if (result.ping < 100){ + pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Error%>"); + } + } ); - - XHR.poll(15,'<%=luci.dispatcher.build_url("admin", "services", "clash", "ping")%>',{ - + XHR.poll(20,'<%=dsp.build_url("admin", "services", "clash", "ping")%>',{ index: i, domain: pings[i].getAttribute("hint") }, function(x, result) { - - XHR.poll(15,'<%=luci.dispatcher.build_url("admin", "services", "clash", "ping_check")%>', null, function(x, status) { - if ( x && x.status == 200 ) { - if(status.ping_enable==1){ - pings[result.index].innerHTML = (result.ping ? ''+result.ping+' ms' : '<%:Error%>'); - }else{ - pings[result.index].innerHTML = result.ping ? '<%:DISABLED%>' : '<%:DISABLED%>'; - } + if (result.ping < 500) { + pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Error%>"); } - }) + if (result.ping < 200){ + pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Error%>"); + } + if (result.ping < 100){ + pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Error%>"); + } + } ); } //]]> - - + \ No newline at end of file diff --git a/package/ntlf9t/luci-app-clash/luasrc/view/clash/ssrurl.htm b/package/ntlf9t/luci-app-clash/luasrc/view/clash/ssrurl.htm new file mode 100644 index 0000000000..e79eedc965 --- /dev/null +++ b/package/ntlf9t/luci-app-clash/luasrc/view/clash/ssrurl.htm @@ -0,0 +1,255 @@ +<%+cbi/valueheader%> + + + +<%+cbi/valuefooter%> diff --git a/package/ntlf9t/luci-app-clash/po/zh_Hans/clash.po b/package/ntlf9t/luci-app-clash/po/zh_Hans/clash.po index 407d4c5346..f0c1e84f6c 100644 --- a/package/ntlf9t/luci-app-clash/po/zh_Hans/clash.po +++ b/package/ntlf9t/luci-app-clash/po/zh_Hans/clash.po @@ -1041,4 +1041,25 @@ msgid "Set to enable or disable dns cache" msgstr "设置为启用或禁用dns缓存" msgid "Old Config" -msgstr "旧配置" \ No newline at end of file +msgstr "旧配置" + +msgid "Import config info" +msgstr "导入配置信息" + +msgid "Import V2ray config info successful" +msgstr "导入V2ray配置信息成功" + +msgid "Import Trojan config info successful" +msgstr "导入Trojan配置信息成功" + +msgid "Import Shadowsocks config info successful" +msgstr "导入Shadowsocks配置信息成功" + +msgid "Import ShadowsocksR config info successful" +msgstr "导入ShadowsocksR配置信息成功" + +msgid "Invalid link" +msgstr "无效格式" + +msgid "Operation Aborted" +msgstr "用户取消" \ No newline at end of file