diff --git a/UnblockNeteaseMusic/Makefile b/UnblockNeteaseMusic/Makefile index 8ca469696..a4700d591 100644 --- a/UnblockNeteaseMusic/Makefile +++ b/UnblockNeteaseMusic/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=UnblockNeteaseMusic PKG_BASE_VERSION:=0.27.0-rc.2 -PKG_RELEASE:=43 +PKG_RELEASE:=44 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/UnblockNeteaseMusic/server.git PKG_SOURCE_DATE:=2021-11-27 -PKG_SOURCE_VERSION:=0738798a7cf025b26ef454f983952cc2e18521db +PKG_SOURCE_VERSION:=fc76cd994f03f931b6b753fd08ceb976dfc57caf PKG_MIRROR_HASH:=skip PKG_VERSION:=$(PKG_BASE_VERSION)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION)) diff --git a/luci-app-openclash/luasrc/controller/openclash.lua b/luci-app-openclash/luasrc/controller/openclash.lua index 2441814c0..fe70da71b 100644 --- a/luci-app-openclash/luasrc/controller/openclash.lua +++ b/luci-app-openclash/luasrc/controller/openclash.lua @@ -10,7 +10,7 @@ function index() page = entry({"admin", "services", "openclash"}, alias("admin", "services", "openclash", "client"), _("OpenClash"), 50) page.dependent = true page.acl_depends = { "luci-app-openclash" } - entry({"admin", "services", "openclash", "client"},cbi("openclash/client"),_("Overviews"), 20).leaf = true + entry({"admin", "services", "openclash", "client"},form("openclash/client"),_("Overviews"), 20).leaf = true entry({"admin", "services", "openclash", "status"},call("action_status")).leaf=true entry({"admin", "services", "openclash", "state"},call("action_state")).leaf=true entry({"admin", "services", "openclash", "startlog"},call("action_start")).leaf=true diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/client.lua b/luci-app-openclash/luasrc/model/cbi/openclash/client.lua index ddf10414b..e4f51e616 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/client.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/client.lua @@ -7,35 +7,35 @@ local UTIL = require "luci.util" local fs = require "luci.openclash" local uci = require("luci.model.uci").cursor() -m = Map("openclash") -m.title = translate("OpenClash") +m = SimpleForm("openclash",translate("OpenClash")) m.description = translate("A Clash Client For OpenWrt") -m.pageaction = false +m.reset = false +m.submit = false m:section(SimpleSection).template = "openclash/status" function IsYamlFile(e) - e=e or"" - local e=string.lower(string.sub(e,-5,-1)) - return e == ".yaml" + e=e or"" + local e=string.lower(string.sub(e,-5,-1)) + return e == ".yaml" end function IsYmlFile(e) - e=e or"" - local e=string.lower(string.sub(e,-4,-1)) - return e == ".yml" + e=e or"" + local e=string.lower(string.sub(e,-4,-1)) + return e == ".yml" end function config_check(CONFIG_FILE) - local yaml = fs.isfile(CONFIG_FILE) - if yaml then - yaml = SYS.exec(string.format('ruby -ryaml -E UTF-8 -e "puts YAML.load_file(\'%s\')" 2>/dev/null',CONFIG_FILE)) - if yaml ~= "false\n" and yaml ~= "" then - return "Config Normal" - else - return "Config Abnormal" - end + local yaml = fs.isfile(CONFIG_FILE) + if yaml then + yaml = SYS.exec(string.format('ruby -ryaml -E UTF-8 -e "puts YAML.load_file(\'%s\')" 2>/dev/null',CONFIG_FILE)) + if yaml ~= "false\n" and yaml ~= "" then + return "Config Normal" + else + return "Config Abnormal" + end elseif (yaml ~= 0) then - return "File Not Exist" + return "File Not Exist" end end @@ -48,21 +48,22 @@ e[t].num=string.format(t) e[t].name=fs.basename(o) BACKUP_FILE="/etc/openclash/backup/".. e[t].name if fs.mtime(BACKUP_FILE) then - e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE)) + e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",fs.mtime(BACKUP_FILE)) else - e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime) + e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime) end -if m.uci:get("openclash", "config", "config_path") and string.sub(m.uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then - e[t].state=translate("Enable") +if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then + e[t].state=translate("Enable") else - e[t].state=translate("Disable") + e[t].state=translate("Disable") end e[t].check=translate(config_check(o)) end end -form = Map("openclash") -form.pageaction = false +form = SimpleForm("openclash") +form.reset = false +form.submit = false tb=form:section(Table,e) st=tb:option(DummyValue,"state",translate("State")) st.template="openclash/cfg_check" @@ -92,16 +93,18 @@ SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &") HTTP.redirect(luci.dispatcher.build_url("admin", "services", "openclash", "client")) end -s = Map("openclash") -s.pageaction = false +s = SimpleForm("openclash") +s.reset = false +s.submit = false s:section(SimpleSection).template = "openclash/myip" local t = { {enable, disable} } -ap = Map("openclash") -ap.pageaction = false +ap = SimpleForm("openclash") +ap.reset = false +ap.submit = false ss = ap:section(Table, t) @@ -109,31 +112,33 @@ o = ss:option(Button, "enable", " ") o.inputtitle = translate("Enable OpenClash") o.inputstyle = "apply" o.write = function() - uci:set("openclash", "config", "enable", 1) - uci:commit("openclash") - SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &") + uci:set("openclash", "config", "enable", 1) + uci:commit("openclash") + SYS.call("/etc/init.d/openclash restart >/dev/null 2>&1 &") end o = ss:option(Button, "disable", " ") o.inputtitle = translate("Disable OpenClash") o.inputstyle = "reset" o.write = function() - uci:set("openclash", "config", "enable", 0) - uci:commit("openclash") - SYS.call("/etc/init.d/openclash stop >/dev/null 2>&1 &") + uci:set("openclash", "config", "enable", 0) + uci:commit("openclash") + SYS.call("/etc/init.d/openclash stop >/dev/null 2>&1 &") end -d = Map("openclash") +d = SimpleForm("openclash") d.title = translate("Credits") -d.pageaction = false +d.reset = false +d.submit = false d:section(SimpleSection).template = "openclash/developer" -dler = Map("openclash") -dler.pageaction = false +dler = SimpleForm("openclash") +dler.reset = false +dler.submit = false dler:section(SimpleSection).template = "openclash/dlercloud" -if m.uci:get("openclash", "config", "dler_token") then - return m, dler, form, s, ap, d +if uci:get("openclash", "config", "dler_token") then + return m, dler, form, s, ap, d else return m, form, s, ap, d end \ No newline at end of file diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua index 92d8d3eff..8bc3fd166 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua @@ -7,8 +7,8 @@ local sys = require "luci.sys" local json = require "luci.jsonc" local sid = arg[1] -font_red = [[]] -font_off = [[]] +font_red = [[]] +font_off = [[]] bold_on = [[]] bold_off = [[]] diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe.lua index 4d5d2409a..d1b00fc5c 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe.lua @@ -9,8 +9,8 @@ local UTIL = require "luci.util" local fs = require "luci.openclash" local uci = require "luci.model.uci".cursor() -font_red = [[]] -font_off = [[]] +font_red = [[]] +font_off = [[]] bold_on = [[]] bold_off = [[]] diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/config.lua b/luci-app-openclash/luasrc/model/cbi/openclash/config.lua index 5bf44d651..045ab050c 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/config.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/config.lua @@ -8,8 +8,8 @@ local fs = require "luci.openclash" local uci = require("luci.model.uci").cursor() local CHIF = "0" -font_green = [[]] -font_off = [[]] +font_green = [[]] +font_off = [[]] bold_on = [[]] bold_off = [[]] align_mid = [[
]]
diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/groups-config.lua b/luci-app-openclash/luasrc/model/cbi/openclash/groups-config.lua
index 89f3df741..30323056f 100644
--- a/luci-app-openclash/luasrc/model/cbi/openclash/groups-config.lua
+++ b/luci-app-openclash/luasrc/model/cbi/openclash/groups-config.lua
@@ -6,8 +6,8 @@ local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
-font_red = [[]]
-font_off = [[]]
+font_red = [[]]
+font_off = [[]]
bold_on = [[]]
bold_off = [[]]
@@ -129,4 +129,4 @@ o.write = function()
luci.http.redirect(m.redirect)
end
-return m
\ No newline at end of file
+return m
diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua b/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua
index ddf0bbbb1..5b1d89a36 100644
--- a/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua
+++ b/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua
@@ -6,9 +6,9 @@ local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
-font_red = [[]]
-font_green = [[]]
-font_off = [[]]
+font_red = [[]]
+font_green = [[]]
+font_off = [[]]
bold_on = [[]]
bold_off = [[]]
@@ -337,4 +337,4 @@ o.write = function()
luci.http.redirect(m.redirect)
end
-return m
\ No newline at end of file
+return m
diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-config.lua b/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-config.lua
index 17e76da57..d71eadf4a 100644
--- a/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-config.lua
+++ b/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-config.lua
@@ -6,8 +6,8 @@ local sys = require "luci.sys"
local sid = arg[1]
local fs = require "luci.openclash"
-font_red = [[]]
-font_off = [[]]
+font_red = [[]]
+font_off = [[]]
bold_on = [[]]
bold_off = [[]]
diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/rule-providers-config.lua b/luci-app-openclash/luasrc/model/cbi/openclash/rule-providers-config.lua
index 2a42a6999..ba371ba03 100644
--- a/luci-app-openclash/luasrc/model/cbi/openclash/rule-providers-config.lua
+++ b/luci-app-openclash/luasrc/model/cbi/openclash/rule-providers-config.lua
@@ -6,8 +6,8 @@ local fs = require "luci.openclash"
local sys = require "luci.sys"
local sid = arg[1]
-font_red = [[]]
-font_off = [[]]
+font_red = [[]]
+font_off = [[]]
bold_on = [[]]
bold_off = [[]]
diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/servers-config.lua b/luci-app-openclash/luasrc/model/cbi/openclash/servers-config.lua
index fa0bd518c..8e817058b 100644
--- a/luci-app-openclash/luasrc/model/cbi/openclash/servers-config.lua
+++ b/luci-app-openclash/luasrc/model/cbi/openclash/servers-config.lua
@@ -7,8 +7,8 @@ local sys = require "luci.sys"
local sid = arg[1]
local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
-font_red = [[]]
-font_off = [[]]
+font_red = [[]]
+font_off = [[]]
bold_on = [[]]
bold_off = [[]]
diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/servers.lua b/luci-app-openclash/luasrc/model/cbi/openclash/servers.lua
index 499c61a52..bbb410cff 100644
--- a/luci-app-openclash/luasrc/model/cbi/openclash/servers.lua
+++ b/luci-app-openclash/luasrc/model/cbi/openclash/servers.lua
@@ -4,8 +4,8 @@ local openclash = "openclash"
local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
-font_red = [[]]
-font_off = [[]]
+font_red = [[]]
+font_off = [[]]
bold_on = [[]]
bold_off = [[]]
diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua
index 185a89ce1..58fe325d5 100644
--- a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua
+++ b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua
@@ -8,9 +8,9 @@ local fs = require "luci.openclash"
local uci = require "luci.model.uci".cursor()
local json = require "luci.jsonc"
-font_green = [[]]
-font_red = [[]]
-font_off = [[]]
+font_green = [[]]
+font_red = [[]]
+font_off = [[]]
bold_on = [[]]
bold_off = [[]]
diff --git a/luci-app-openclash/luasrc/view/openclash/other_button.htm b/luci-app-openclash/luasrc/view/openclash/other_button.htm
index 1c391ad98..a7a2e4957 100644
--- a/luci-app-openclash/luasrc/view/openclash/other_button.htm
+++ b/luci-app-openclash/luasrc/view/openclash/other_button.htm
@@ -1,6 +1,6 @@
<%+cbi/valueheader%>
<% if self:cfgvalue(section) ~= false then %>
- " style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
+ " style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
<% else %>
-
<% end %>
diff --git a/luci-app-openclash/luasrc/view/openclash/server_list.htm b/luci-app-openclash/luasrc/view/openclash/server_list.htm
index 8c3d4c118..bc373d3c0 100644
--- a/luci-app-openclash/luasrc/view/openclash/server_list.htm
+++ b/luci-app-openclash/luasrc/view/openclash/server_list.htm
@@ -16,7 +16,7 @@ local dsp = require "luci.dispatcher"
domain: pings[i].getAttribute("hint")
},
function(x, result) {
- pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Test failed%>");
+ pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Test failed%>");
}
);
XHR.poll(10,'<%=dsp.build_url("admin", "services", "openclash", "ping")%>',{
@@ -24,9 +24,9 @@ local dsp = require "luci.dispatcher"
domain: pings[i].getAttribute("hint")
},
function(x, result) {
- pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Test failed%>");
+ pings[result.index].innerHTML = (result.ping ? ""+result.ping+" ms" : "<%:Test failed%>");
}
);
}
//]]>
-
\ No newline at end of file
+
diff --git a/luci-app-openclash/luasrc/view/openclash/server_url.htm b/luci-app-openclash/luasrc/view/openclash/server_url.htm
index 350970b72..134d70980 100644
--- a/luci-app-openclash/luasrc/view/openclash/server_url.htm
+++ b/luci-app-openclash/luasrc/view/openclash/server_url.htm
@@ -69,9 +69,9 @@ function export_ssr_url(btn, urlname, sid) {
textarea.select();
try {
document.execCommand("copy"); // Security exception may be thrown by some browsers.
- s.innerHTML = "<%:Copy SSR to clipboard successfully.%>";
+ s.innerHTML = "<%:Copy SSR to clipboard successfully.%>";
} catch (ex) {
- s.innerHTML = "<%:Unable to copy SSR to clipboard.%>";
+ s.innerHTML = "<%:Unable to copy SSR to clipboard.%>";
} finally {
document.body.removeChild(textarea);
}
@@ -83,7 +83,7 @@ function import_ssr_url(btn, urlname, sid) {
if (!s) return false;
var ssrurl = prompt("<%:Paste sharing link here%>", "");
if (ssrurl == null || ssrurl == "") {
- s.innerHTML = "<%:User cancelled.%>";
+ s.innerHTML = "<%:User cancelled.%>";
return false;
}
s.innerHTML = "";
@@ -156,7 +156,7 @@ function import_ssr_url(btn, urlname, sid) {
if (param != undefined) {
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
}
- s.innerHTML = "<%:Import configuration information successfully.%>";
+ s.innerHTML = "<%:Import configuration information successfully.%>";
} else {
var sstr = b64decsafe(url0);
document.getElementsByName('cbid.openclash.' + sid + '.type')[0].value = ssu[0];
@@ -171,7 +171,7 @@ function import_ssr_url(btn, urlname, sid) {
if (param != undefined) {
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
}
- s.innerHTML = "<%:Import configuration information successfully.%>";
+ s.innerHTML = "<%:Import configuration information successfully.%>";
}
return false;
case "ssr":
@@ -204,7 +204,7 @@ function import_ssr_url(btn, urlname, sid) {
document.getElementsByName('cbid.openclash.' + sid + '.protocol_param')[0].value = dictvalue(pdict, 'protoparam');
var rem = pdict['remarks'];
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0) document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = b64decutf8safe(rem);
- s.innerHTML = "<%:Import configuration information successfully.%>";
+ s.innerHTML = "<%:Import configuration information successfully.%>";
return false;
case "trojan":
var url0, param = "";
@@ -246,7 +246,7 @@ function import_ssr_url(btn, urlname, sid) {
if (param != undefined) {
document.getElementsByName('cbid.openclash.' + sid + '.name')[0].value = decodeURI(param);
}
- s.innerHTML = "<%:Import configuration information successfully.%>";
+ s.innerHTML = "<%:Import configuration information successfully.%>";
return false;
case "vmess":
var sstr = b64DecodeUnicode(ssu[1]);
@@ -302,10 +302,10 @@ function import_ssr_url(btn, urlname, sid) {
if (ssm.sni) {
document.getElementsByName('cbid.openclash.' + sid + '.servername')[0].value = ssm.sni;
}
- s.innerHTML = "<%:Import configuration information successfully.%>";
+ s.innerHTML = "<%:Import configuration information successfully.%>";
return false;
default:
- s.innerHTML = "<%:Invalid format.%>";
+ s.innerHTML = "<%:Invalid format.%>";
return false;
}
}
diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm
index b13bc22d3..ae2a3f38b 100644
--- a/luci-app-openclash/luasrc/view/openclash/status.htm
+++ b/luci-app-openclash/luasrc/view/openclash/status.htm
@@ -77,7 +77,7 @@
<%:Up:%>
-
+
0 KB/S
@@ -86,7 +86,7 @@
<%:Down:%>
-
+
0 KB/S
@@ -95,7 +95,7 @@
<%:Up Total:%>
-
+
0 KB
@@ -104,7 +104,7 @@
<%:Down Total:%>
-
+
0 KB
@@ -113,7 +113,7 @@
<%:Connections:%>
-
+
0
@@ -122,7 +122,7 @@
<%:Ram:%>
-
+
0 KB
@@ -131,7 +131,7 @@
<%:CPU:%>
-
+
0 %
@@ -227,36 +227,36 @@
if ( x && x.status == 200 ) {
if ( status.restricted_mode != "1" )
{
- clash.innerHTML = status.clash ? '<%:Running%>' : '<%:Not Running%>';
+ clash.innerHTML = status.clash ? '<%:Running%>' : '<%:Not Running%>';
}
else
{
- clash.innerHTML = status.clash ? '<%:Running%> <%: