update-12.15
This commit is contained in:
parent
2f2a805130
commit
ada4f3eae4
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -7,8 +7,8 @@ local sys = require "luci.sys"
|
|||
local json = require "luci.jsonc"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<font color="red">]]
|
||||
font_off = [[</font>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ local UTIL = require "luci.util"
|
|||
local fs = require "luci.openclash"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
|
||||
font_red = [[<font color="red">]]
|
||||
font_off = [[</font>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ local fs = require "luci.openclash"
|
|||
local uci = require("luci.model.uci").cursor()
|
||||
local CHIF = "0"
|
||||
|
||||
font_green = [[<font color="green">]]
|
||||
font_off = [[</font>]]
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
align_mid = [[<p align="center">]]
|
||||
|
|
|
@ -6,8 +6,8 @@ local fs = require "luci.openclash"
|
|||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<font color="red">]]
|
||||
font_off = [[</font>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
@ -129,4 +129,4 @@ o.write = function()
|
|||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
return m
|
||||
return m
|
||||
|
|
|
@ -6,9 +6,9 @@ local fs = require "luci.openclash"
|
|||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<font color="red">]]
|
||||
font_green = [[<font color="green">]]
|
||||
font_off = [[</font>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
@ -337,4 +337,4 @@ o.write = function()
|
|||
luci.http.redirect(m.redirect)
|
||||
end
|
||||
|
||||
return m
|
||||
return m
|
||||
|
|
|
@ -6,8 +6,8 @@ local sys = require "luci.sys"
|
|||
local sid = arg[1]
|
||||
local fs = require "luci.openclash"
|
||||
|
||||
font_red = [[<font color="red">]]
|
||||
font_off = [[</font>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ local fs = require "luci.openclash"
|
|||
local sys = require "luci.sys"
|
||||
local sid = arg[1]
|
||||
|
||||
font_red = [[<font color="red">]]
|
||||
font_off = [[</font>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
|
|
@ -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 color="red">]]
|
||||
font_off = [[</font>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ local openclash = "openclash"
|
|||
local uci = luci.model.uci.cursor()
|
||||
local fs = require "luci.openclash"
|
||||
|
||||
font_red = [[<font color="red">]]
|
||||
font_off = [[</font>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@ local fs = require "luci.openclash"
|
|||
local uci = require "luci.model.uci".cursor()
|
||||
local json = require "luci.jsonc"
|
||||
|
||||
font_green = [[<font color="green">]]
|
||||
font_red = [[<font color="red">]]
|
||||
font_off = [[</font>]]
|
||||
font_green = [[<b style=color:green>]]
|
||||
font_red = [[<b style=color:red>]]
|
||||
font_off = [[</b>]]
|
||||
bold_on = [[<strong>]]
|
||||
bold_off = [[</strong>]]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%+cbi/valueheader%>
|
||||
<% if self:cfgvalue(section) ~= false then %>
|
||||
<input class="cbi-button cbi-input-<%=self.inputstyle or "button" %>" style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
|
||||
<input class="btn cbi-button cbi-input-<%=self.inputstyle or "button" %>" style="display: <%= display %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> />
|
||||
<% else %>
|
||||
-
|
||||
<% end %>
|
||||
|
|
|
@ -16,7 +16,7 @@ local dsp = require "luci.dispatcher"
|
|||
domain: pings[i].getAttribute("hint")
|
||||
},
|
||||
function(x, result) {
|
||||
pings[result.index].innerHTML = (result.ping ? "<b><font color=green>"+result.ping+"</font></b> ms" : "<b><font color=red><%:Test failed%></font></b>");
|
||||
pings[result.index].innerHTML = (result.ping ? "<b style=color:green>"+result.ping+"</b> ms" : "<b style=color:red><%:Test failed%></b>");
|
||||
}
|
||||
);
|
||||
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 ? "<b><font color=green>"+result.ping+"</font></b> ms" : "<b><font color=red><%:Test failed%></font></b>");
|
||||
pings[result.index].innerHTML = (result.ping ? "<b style=color:green>"+result.ping+"</b> ms" : "<b style=color:red><%:Test failed%></b>");
|
||||
}
|
||||
);
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -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 = "<font color='green'><%:Copy SSR to clipboard successfully.%></font>";
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Copy SSR to clipboard successfully.%></font>";
|
||||
} catch (ex) {
|
||||
s.innerHTML = "<font color='red'><%:Unable to copy SSR to clipboard.%></font>";
|
||||
s.innerHTML = "<font style=\"color:red\"><%:Unable to copy SSR to clipboard.%></font>";
|
||||
} 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 = "<font color='red'><%:User cancelled.%></font>";
|
||||
s.innerHTML = "<font style=\"color:red\"><%:User cancelled.%></font>";
|
||||
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 = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
} 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 = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
}
|
||||
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 = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
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 = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
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 = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
s.innerHTML = "<font style=\"color:green\"><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
default:
|
||||
s.innerHTML = "<font color='red'><%:Invalid format.%></font>";
|
||||
s.innerHTML = "<font style=\"color:red\"><%:Invalid format.%></font>";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
<span>
|
||||
<%:Up:%>
|
||||
<span id="upload_">
|
||||
<font color=green>
|
||||
<font style=color:green>
|
||||
0 KB/S
|
||||
</font>
|
||||
</span>
|
||||
|
@ -86,7 +86,7 @@
|
|||
<span>
|
||||
<%:Down:%>
|
||||
<span id="download_">
|
||||
<font color=green>
|
||||
<font style=color:green>
|
||||
0 KB/S
|
||||
</font>
|
||||
</span>
|
||||
|
@ -95,7 +95,7 @@
|
|||
<span>
|
||||
<%:Up Total:%>
|
||||
<span id="uploadtotal_">
|
||||
<font color=green>
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
|
@ -104,7 +104,7 @@
|
|||
<span>
|
||||
<%:Down Total:%>
|
||||
<span id="downloadtotal_">
|
||||
<font color=green>
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
|
@ -113,7 +113,7 @@
|
|||
<span>
|
||||
<%:Connections:%>
|
||||
<span id="connect_t">
|
||||
<font color=green>
|
||||
<font style=color:green>
|
||||
0
|
||||
</font>
|
||||
</span>
|
||||
|
@ -122,7 +122,7 @@
|
|||
<span>
|
||||
<%:Ram:%>
|
||||
<span id="mem_t">
|
||||
<font color=green>
|
||||
<font style=color:green>
|
||||
0 KB
|
||||
</font>
|
||||
</span>
|
||||
|
@ -131,7 +131,7 @@
|
|||
<span>
|
||||
<%:CPU:%>
|
||||
<span id="cpu_t">
|
||||
<font color=green>
|
||||
<font style=color:green>
|
||||
0 %
|
||||
</font>
|
||||
</span>
|
||||
|
@ -227,36 +227,36 @@
|
|||
if ( x && x.status == 200 ) {
|
||||
if ( status.restricted_mode != "1" )
|
||||
{
|
||||
clash.innerHTML = status.clash ? '<b><font color=green><%:Running%></font></b>' : '<b><font color=red><%:Not Running%></font></b>';
|
||||
clash.innerHTML = status.clash ? '<b style=color:green><%:Running%></b>' : '<b style=color:red><%:Not Running%></b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
clash.innerHTML = status.clash ? '<b><font color=green><%:Running%> <%:<Limited State>%></font></b>' : '<b><font color=red><%:Not Running%></font></b>';
|
||||
clash.innerHTML = status.clash ? '<b style=color:green><%:Running%> <%:<Limited State>%></b>' : '<b style=color:red><%:Not Running%></b>';
|
||||
}
|
||||
watchdog.innerHTML = status.watchdog ? ' | <%:Daemons%>: <b><font color=green><%:Running%></font></b>' : ' | <%:Daemons%>: <b><font color=red><%:Not Running%></font></b>';
|
||||
dase.innerHTML = status.dase ? "<b><font color=green>"+status.dase+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
|
||||
web.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Open Panel%>" onclick="return ycad_dashboard(this)"/>' : '<b><font color=red><%:Not Running%></font></b>';
|
||||
webo.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Open Panel%>" onclick="return net_dashboard(this)"/>' : '<b><font color=red><%:Not Running%></font></b>';
|
||||
close_all_connection.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Close All Connections%>" onclick="return b_close_all_connection(this)"/>' : '<b><font color=red><%:Not Running%></font></b>';
|
||||
reload_firewall.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Reload Firewall Rules%>" onclick="return b_reload_firewall(this)"/>' : '<b><font color=red><%:Not Running%></font></b>';
|
||||
watchdog.innerHTML = status.watchdog ? ' | <%:Daemons%>: <b style=color:green><%:Running%></b>' : ' | <%:Daemons%>: <b style=color:red><%:Not Running%></b>';
|
||||
dase.innerHTML = status.dase ? "<b style=color:green>"+status.dase+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
web.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Open Panel%>" onclick="return ycad_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
webo.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Open Panel%>" onclick="return net_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
close_all_connection.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Close All Connections%>" onclick="return b_close_all_connection(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
reload_firewall.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Reload Firewall Rules%>" onclick="return b_reload_firewall(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
one_key_update.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check All Components Update%>" onclick="return all_one_key_update(this)"/>';
|
||||
update_subscribe.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check Config Update%>" onclick="return b_update_subscribe(this)"/>';
|
||||
update_other_rules.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check Third Party Rules Update%>" onclick="return b_update_other_rules(this)"/>';
|
||||
update_geoip.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check GEOIP Data Update%>" onclick="return b_update_geoip(this)"/>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
daip.innerHTML = status.daip ? "<b><font color=green>"+status.daip+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b><font color=green>"+status.cn_port+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
|
||||
daip.innerHTML = status.daip ? "<b style=color:green>"+status.daip+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b style=color:green>"+status.cn_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.daip + ":" + status.cn_port;
|
||||
}
|
||||
else if (status.daip && window.location.hostname != status.daip && status.db_foward_domain && status.db_foward_port)
|
||||
{
|
||||
daip.innerHTML = status.db_foward_domain ? "<b><font color=green>"+status.db_foward_domain+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
|
||||
dapo.innerHTML = status.db_foward_port ? "<b><font color=green>"+status.db_foward_port+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
|
||||
daip.innerHTML = status.db_foward_domain ? "<b style=color:green>"+status.db_foward_domain+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.db_foward_port ? "<b style=color:green>"+status.db_foward_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.db_foward_domain + ":" + status.db_foward_port;
|
||||
}
|
||||
else {
|
||||
daip.innerHTML = status.daip ? "<b><font color=green>"+status.daip+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b><font color=green>"+status.cn_port+"</font></b>" : "<b><font color=red>"+"<%:Not Set%>"+"</font></b>";
|
||||
daip.innerHTML = status.daip ? "<b style=color:green>"+status.daip+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b style=color:green>"+status.cn_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.daip + ":" + status.cn_port;
|
||||
};
|
||||
|
||||
|
@ -267,7 +267,7 @@
|
|||
else {
|
||||
radio_mode.style.display = "none";
|
||||
radio_de.style.display = "";
|
||||
radio_de.innerHTML = "<b><font color=red><%:Not Running%></font></b>";
|
||||
radio_de.innerHTML = "<b style=color:red><%:Not Running%></b>";
|
||||
};
|
||||
|
||||
if (status.clash) {
|
||||
|
@ -345,12 +345,12 @@
|
|||
if (x && x.status == 200 && status.mode) {
|
||||
if (status.mode == "fake-ip" || status.mode == "fake-ip-tun" || status.mode == "fake-ip-mix")
|
||||
{
|
||||
mode.innerHTML = status.clash ? "<b><font color=green><%:Fake-IP%></font></b> | " : '<b><font color=red><%:Not Running%></font></b>';
|
||||
mode.innerHTML = status.clash ? "<b style=color:green><%:Fake-IP%></b> | " : '<b style=color:red><%:Not Running%></b>';
|
||||
radio_run_normal.innerHTML = "<%:Enhance%>"
|
||||
}
|
||||
else if (status.mode == "redir-host" || status.mode == "redir-host-tun" || status.mode == "redir-host-mix")
|
||||
{
|
||||
mode.innerHTML = status.clash ? "<b><font color=green><%:Redir-Host%></font></b> | " : '<b><font color=red><%:Not Running%></font></b>';
|
||||
mode.innerHTML = status.clash ? "<b style=color:green><%:Redir-Host%></b> | " : '<b style=color:red><%:Not Running%></b>';
|
||||
radio_run_normal.innerHTML = "<%:Compatible%>"
|
||||
};
|
||||
for (i=0; i<radio_ru.length; i++) {
|
||||
|
@ -382,16 +382,16 @@
|
|||
function state_get() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
ipdb.innerHTML = status.ipdb ? "<b><font color=green>"+status.ipdb+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
lhie1.innerHTML = status.lhie1 ? "<b><font color=green>"+status.lhie1+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
ConnersHua.innerHTML = status.ConnersHua ? "<b><font color=green>"+status.ConnersHua+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
ConnersHua_return.innerHTML = status.ConnersHua_return ? "<b><font color=green>"+status.ConnersHua_return+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
chnroute.innerHTML = status.chnroute ? "<b><font color=green>"+status.chnroute+"</font></b>" : "<b><font color=red>"+"<%:File Not Exist%>"+"</font></b>";
|
||||
ipdb.innerHTML = status.ipdb ? "<b style=color:green>"+status.ipdb+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
lhie1.innerHTML = status.lhie1 ? "<b style=color:green>"+status.lhie1+"/b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
ConnersHua.innerHTML = status.ConnersHua ? "<b style=color:green>"+status.ConnersHua+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
ConnersHua_return.innerHTML = status.ConnersHua_return ? "<b style=color:green>"+status.ConnersHua_return+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
chnroute.innerHTML = status.chnroute ? "<b style=color:green>"+status.chnroute+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
if ( status.historychecktime != "0" ) {
|
||||
historychecktime.innerHTML = "<b><font color=green>"+status.historychecktime+"</font></b>";
|
||||
historychecktime.innerHTML = "<b style=color:green>"+status.historychecktime+"</b>";
|
||||
}
|
||||
else {
|
||||
historychecktime.innerHTML = "<b><font color=green>"+"<%:No Backup%>"+"</font></b>";
|
||||
historychecktime.innerHTML = "<b style=color:green>"+"<%:No Backup%>"+"</b>";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -428,30 +428,30 @@
|
|||
ws_error = true;
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "") {
|
||||
document.getElementById("upload_").innerHTML = "<font color=green>"+status.up+"</font>";
|
||||
document.getElementById("download_").innerHTML = "<font color=green>"+status.down+"</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font color=green>"+status.up_total+"</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font color=green>"+status.down_total+"</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font color=green>"+status.mem+"</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font color=green>"+status.connections+"</font>";
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">"+status.up+"</font>";
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">"+status.down+"</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">"+status.up_total+"</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">"+status.down_total+"</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">"+status.mem+"</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">"+status.connections+"</font>";
|
||||
if (status.cpu <= 50) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font color=green>"+status.cpu+" %</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu >= 50 && status.cpu <= 80) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font color=orange>"+status.cpu+" %</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:orange\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("cpu_t").innerHTML = "<font color=red>"+status.cpu+" %</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:red\">"+status.cpu+" %</font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.getElementById("upload_").innerHTML = "<font color=green>0 B/S</font>";
|
||||
document.getElementById("download_").innerHTML = "<font color=green>0 B/S</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font color=green>0 KB</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font color=green>0 KB</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font color=green>0 KB</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font color=green>0 %</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font color=green>0</font>";
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">0 B/S</font>";
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">0 B/S</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">0</font>";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -459,35 +459,35 @@
|
|||
function show_sys() {
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "toolbar_show_sys")%>', null, function(x, status) {
|
||||
if (x && x.status == 200 && x.responseText != "") {
|
||||
document.getElementById("mem_t").innerHTML = "<font color=green>"+status.mem+"</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">"+status.mem+"</font>";
|
||||
if (status.cpu <= 50) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font color=green>"+status.cpu+" %</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else if (status.cpu >= 50 && status.cpu <= 80) {
|
||||
document.getElementById("cpu_t").innerHTML = "<font color=orange>"+status.cpu+" %</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:orange\">"+status.cpu+" %</font>";
|
||||
}
|
||||
else {
|
||||
document.getElementById("cpu_t").innerHTML = "<font color=red>"+status.cpu+" %</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:red\">"+status.cpu+" %</font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.getElementById("mem_t").innerHTML = "<font color=green>0 KB</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font color=green>0 %</font>";
|
||||
document.getElementById("mem_t").innerHTML = "<font style=\"color:green\">0 KB</font>";
|
||||
document.getElementById("cpu_t").innerHTML = "<font style=\"color:green\">0 %</font>";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function ws_tmessage(event) {
|
||||
var data = JSON.parse(event.data)
|
||||
document.getElementById("upload_").innerHTML = "<font color=green>"+bytesToSize(data.up)+"/S</font>";
|
||||
document.getElementById("download_").innerHTML = "<font color=green>"+bytesToSize(data.down)+"/S</font>";
|
||||
document.getElementById("upload_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.up)+"/S</font>";
|
||||
document.getElementById("download_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.down)+"/S</font>";
|
||||
};
|
||||
|
||||
function ws_cmessage(event) {
|
||||
var data = JSON.parse(event.data)
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font color=green>"+bytesToSize(data.uploadTotal)+"</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font color=green>"+bytesToSize(data.downloadTotal)+"</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font color=green>"+Object.keys(data.connections).length+"</font>";
|
||||
document.getElementById("uploadtotal_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.uploadTotal)+"</font>";
|
||||
document.getElementById("downloadtotal_").innerHTML = "<font style=\"color:green\">"+bytesToSize(data.downloadTotal)+"</font>";
|
||||
document.getElementById("connect_t").innerHTML = "<font style=\"color:green\">"+Object.keys(data.connections).length+"</font>";
|
||||
show_sys();
|
||||
};
|
||||
|
||||
|
@ -778,7 +778,7 @@
|
|||
alert('<%:OpenClash Start Failed%> :\n\n' + status.startlog.split('msg=')[1]);
|
||||
}
|
||||
else if ( status.startlog != "\n" && status.startlog != "" ) {
|
||||
startlog.innerHTML = '<b><font color="green">'+status.startlog+'</font></b>';
|
||||
startlog.innerHTML = '<b style=color:green>'+status.startlog+'</b>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -118,67 +118,67 @@
|
|||
var arr_model = cpu_models.split(",");
|
||||
var cpu_model1 = arr_model[0];
|
||||
var cpu_model22 = arr_model[1];
|
||||
cpu_model.innerHTML = cpu_model1 ? "<b><font color=green>"+cpu_model1+"</font></b>" : "<b><font color=red><%:Model Not Found%></font></b>";
|
||||
cpu_model2.innerHTML = cpu_model22 ? "<b><font color=green>"+cpu_model22+"</font></b>" : "<b><font color=red><%:Model Not Found%></font></b>";
|
||||
cpu_model.innerHTML = cpu_model1 ? "<b style=color:green>"+cpu_model1+"</b>" : "<b style=color:red><%:Model Not Found%></b>";
|
||||
cpu_model2.innerHTML = cpu_model22 ? "<b style=color:green>"+cpu_model22+"</b>" : "<b style=color:red><%:Model Not Found%></b>";
|
||||
if ( status.upchecktime != "1" ) {
|
||||
checktime.innerHTML = "<b><font color=green>"+status.upchecktime+"</font></b>";
|
||||
checktime.innerHTML = "<b style=color:green>"+status.upchecktime+"</b>";
|
||||
}
|
||||
else {
|
||||
checktime.innerHTML = "<b><font color=red><%:Check Failed%></font></b>";
|
||||
checktime.innerHTML = "<b style=color:red><%:Check Failed%></b>";
|
||||
}
|
||||
if ( status.corecv == "0" ) {
|
||||
core_cv.innerHTML = "<b><font color=red><%:File Not Exist%></font></b>";
|
||||
core_cv.innerHTML = "<b style=color:red><%:File Not Exist%></b>";
|
||||
}
|
||||
else if (status.corecv != "") {
|
||||
core_cv.innerHTML = "<b><font color=green>"+status.corecv+"</font></b>";
|
||||
core_cv.innerHTML = "<b style=color:green>"+status.corecv+"</b>";
|
||||
}
|
||||
else {
|
||||
core_cv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
core_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
if ( status.coretuncv == "0" ) {
|
||||
core_tun_cv.innerHTML = "<b><font color=red><%:File Not Exist%></font></b>";
|
||||
core_tun_cv.innerHTML = "<b style=color:red><%:File Not Exist%></b>";
|
||||
}
|
||||
else if (status.coretuncv != "") {
|
||||
core_tun_cv.innerHTML = "<b><font color=green>"+status.coretuncv+"</font></b>";
|
||||
core_tun_cv.innerHTML = "<b style=color:green>"+status.coretuncv+"</b>";
|
||||
}
|
||||
else {
|
||||
core_tun_cv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
core_tun_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
var corelv = status.corelv;
|
||||
var arr_core = corelv.split(",");
|
||||
var corelvis = arr_core[0];
|
||||
var coretunlvis = arr_core[1];
|
||||
if (corelvis != status.corecv && corelvis != "") {
|
||||
core_lv.innerHTML = "<b><font color=green>"+corelvis+"<%:<New>%></font></b>";
|
||||
core_lv.innerHTML = "<b style=color:green>"+corelvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (corelvis != "" && corelvis == status.corecv) {
|
||||
core_lv.innerHTML = "<b><font color=green>"+corelvis+"</font></b>";
|
||||
core_lv.innerHTML = "<b style=color:green>"+corelvis+"</b>";
|
||||
}
|
||||
else {
|
||||
core_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
core_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
if (coretunlvis != status.coretuncv && coretunlvis != "") {
|
||||
core_tun_lv.innerHTML = "<b><font color=green>"+coretunlvis+"<%:<New>%></font></b>";
|
||||
core_tun_lv.innerHTML = "<b style=color:green>"+coretunlvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (coretunlvis != "" && coretunlvis == status.coretuncv) {
|
||||
core_tun_lv.innerHTML = "<b><font color=green>"+coretunlvis+"</font></b>";
|
||||
core_tun_lv.innerHTML = "<b style=color:green>"+coretunlvis+"</b>";
|
||||
}
|
||||
else {
|
||||
core_tun_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
core_tun_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
var oplv = status.oplv;
|
||||
var arr_op = oplv.split(",");
|
||||
var oplvis = arr_op[0];
|
||||
var new_op = arr_op[1];
|
||||
op_cv.innerHTML = status.opcv ? "<b><font color=green>"+status.opcv+"</font></b>" : "<b><font color=red><%:Unknown%></font></b>";
|
||||
op_cv.innerHTML = status.opcv ? "<b style=color:green>"+status.opcv+"</b>" : "<b style=color:red><%:Unknown%></b>";
|
||||
if ( new_op == "2" ) {
|
||||
op_lv.innerHTML = "<b><font color=green>"+oplvis+"<%:<New>%></font></b>";
|
||||
op_lv.innerHTML = "<b style=color:green>"+oplvis+"<%:<New>%></b>";
|
||||
}
|
||||
else if (oplvis != "") {
|
||||
op_lv.innerHTML = "<b><font color=green>"+oplvis+"</font></b>";
|
||||
op_lv.innerHTML = "<b style=color:green>"+oplvis+"</b>";
|
||||
}
|
||||
else {
|
||||
op_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
op_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -377,9 +377,9 @@
|
|||
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', status.startlog, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog != "\n" && status.startlog != "" ) {
|
||||
update_tip.innerHTML = '<b><font color="green">'+status.startlog+'</font></b>';
|
||||
update_tip.innerHTML = '<b style=color:green>'+status.startlog+'</b>';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//]]></script>
|
||||
//]]></script>
|
||||
|
|
|
@ -34,10 +34,6 @@ define Package/$(PKG_NAME)/install
|
|||
$(INSTALL_DATA) ./files/uci.defaults $(1)/etc/uci-defaults/95-default-settings
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/base_config.conf $(1)/etc/config/base_config
|
||||
$(INSTALL_DIR) $(1)/lib/wifi
|
||||
$(INSTALL_DATA) ./files/wifi-init.sh $(1)/lib/wifi/wifi-init.sh
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/wifi-init.init $(1)/etc/init.d/wifi-init
|
||||
$(INSTALL_DIR) $(1)/etc/profile.d
|
||||
$(INSTALL_BIN) ./files/sysinfo.sh $(1)/etc/profile.d/sysinfo.sh
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
|
@ -48,4 +44,3 @@ define Package/$(PKG_NAME)/install
|
|||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
|
|
|
@ -119,17 +119,14 @@ swap_info=$(LC_ALL=C free -m | grep "^Swap")
|
|||
swap_usage=$( (awk '/Swap/ { printf("%3.0f", $3/$2*100) }' <<<${swap_info} 2>/dev/null || echo 0) | tr -c -d '[:digit:]')
|
||||
swap_total=$(awk '{print $(2)}' <<<${swap_info})
|
||||
|
||||
[ ! -f /etc/config/network ] && {
|
||||
printf " System initializing please wait..."
|
||||
echo ""
|
||||
echo ""
|
||||
}
|
||||
[ -f /etc/config/network ] && {
|
||||
c=0
|
||||
while [ ! -f /etc/config/network ];do
|
||||
[ $c -eq 8 ] && break || let c++
|
||||
while [ ! -n "$(get_ip_addresses)" ];do
|
||||
[ $c -eq 7 ] && break || let c++
|
||||
sleep 1
|
||||
done
|
||||
ip_address="$(get_ip_addresses)"
|
||||
} || ip_address="10.0.0.1"
|
||||
|
||||
# display info
|
||||
display "系统负载" "${load%% *}" "${critical_load}" "0" "" "${load#* }"
|
||||
|
@ -143,7 +140,7 @@ printf "IP 地址: \x1B[92m%s\x1B[0m" "$ip_address"
|
|||
echo "" # fixed newline
|
||||
|
||||
display "系统存储" "$root_usage" "90" "1" "%" " of $root_total"
|
||||
printf "CPU 信息: \x1B[92m%s\x1B[0m\t" "$(/sbin/cpuinfo)"
|
||||
printf "CPU 信息: \x1B[92m%s\x1B[0m\t" "$(echo `/sbin/cpuinfo | cut -d '(' -f -1`)"
|
||||
echo ""
|
||||
|
||||
display "数据存储" "$data_usage" "90" "1" "%" " of $data_total"
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2020 X-WRT.COM
|
||||
|
||||
START=19
|
||||
|
||||
boot() {
|
||||
. /lib/wifi/wifi-init.sh
|
||||
|
||||
local base wifi_init
|
||||
local SSID SSID_PASSWD
|
||||
|
||||
base=`uci get base_config.@status[0].base 2>/dev/null`
|
||||
base=$((base+0))
|
||||
wifi_init=`uci get base_config.@status[0].wifi_init 2>/dev/null`
|
||||
wifi_init=$((wifi_init+0))
|
||||
|
||||
test $base -lt 1 && {
|
||||
wifi_init=1 #skip wifi_init=1 hook
|
||||
}
|
||||
|
||||
test $wifi_init -lt 1 && {
|
||||
wifi_first_init
|
||||
|
||||
wifi_init=1
|
||||
}
|
||||
|
||||
uci set base_config.@status[0].wifi_init=$wifi_init
|
||||
uci commit base_config
|
||||
|
||||
#XXX
|
||||
test -f /rom/etc/uci-defaults/96-wizard-defaults && sh /rom/etc/uci-defaults/96-wizard-defaults
|
||||
|
||||
/etc/init.d/wifi-init disable
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
wifi_setup_radio()
|
||||
{
|
||||
local radio=$1
|
||||
|
||||
uci get wireless.${radio} >/dev/null 2>&1 && {
|
||||
#FIXME hack
|
||||
local path
|
||||
if test -e /sys/kernel/debug/ieee80211/phy0/mt76/dbdc &&
|
||||
[ "$(readlink /sys/class/ieee80211/phy0/device)" = "$(readlink /sys/class/ieee80211/phy1/device)" ]; then
|
||||
path="$(uci get wireless.${radio}.path)"
|
||||
if test -z "${path#*+1}"; then
|
||||
uci set wireless.${radio}.phy='phy1'
|
||||
uci set wireless.${radio}.htmode='VHT80'
|
||||
uci set wireless.${radio}.hwmode='11a'
|
||||
else
|
||||
uci set wireless.${radio}.phy='phy0'
|
||||
uci set wireless.${radio}.htmode='HT20'
|
||||
uci set wireless.${radio}.hwmode='11g'
|
||||
fi
|
||||
uci delete wireless.${radio}.path
|
||||
fi
|
||||
|
||||
uci -q batch <<-EOT
|
||||
set wireless.${radio}.disabled='0'
|
||||
set wireless.${radio}.country='CN'
|
||||
set wireless.${radio}.channel='auto'
|
||||
EOT
|
||||
|
||||
if [ x`uci get wireless.${radio}.hwmode 2>/dev/null` = "x11a" ]; then
|
||||
uci set wireless.${radio}.txpower='23'
|
||||
else
|
||||
uci set wireless.${radio}.txpower='20'
|
||||
fi
|
||||
|
||||
obj=`uci add wireless wifi-iface`
|
||||
test -n "$obj" && {
|
||||
uci set wireless.$obj.device="${radio}"
|
||||
uci set wireless.$obj.network='lan'
|
||||
uci set wireless.$obj.mode='ap'
|
||||
if [ x`uci get wireless.${radio}.hwmode 2>/dev/null` = "x11a" ]; then
|
||||
uci set wireless.$obj.ssid="${SSID}_5G"
|
||||
else
|
||||
uci set wireless.$obj.ssid="${SSID}_2.4G"
|
||||
fi
|
||||
# uci set wireless.$obj.encryption='psk2'
|
||||
uci set wireless.$obj.skip_inactivity_poll='1'
|
||||
uci set wireless.$obj.wpa_group_rekey='0'
|
||||
uci set wireless.$obj.wpa_pair_rekey='0'
|
||||
uci set wireless.$obj.wpa_master_rekey='0'
|
||||
uci set wireless.$obj.disassoc_low_ack='0'
|
||||
# uci set wireless.$obj.key="${SSID_PASSWD}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wifi_first_init()
|
||||
{
|
||||
SSID="${SSID-$(uci get base_config.@status[0].SSID 2>/dev/null || echo OpenWrt)}"
|
||||
SSID_PASSWD="${SSID_PASSWD-$(uci get base_config.@status[0].SSID_PASSWD 2>/dev/null || echo 88888888)}"
|
||||
|
||||
while uci delete wireless.@wifi-iface[0] >/dev/null 2>&1; do :; done
|
||||
for radio in radio0 radio1 radio2 radio3 wifi0 wifi1 wifi2 wifi3; do
|
||||
wifi_setup_radio ${radio}
|
||||
done
|
||||
uci commit wireless
|
||||
|
||||
# wireless migration
|
||||
local widx=0
|
||||
local change=0
|
||||
while uci rename wireless.@wifi-iface[$widx]=wifinet$widx >/dev/null 2>&1; do widx=$((widx+1)); done
|
||||
uci changes wireless | tr ".='" " " | while read _ a b; do
|
||||
if [ "x$a" != "x$b" ]; then
|
||||
uci commit wireless
|
||||
change=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
[ "x$change" = "x0" ] && uci revert wireless
|
||||
}
|
Loading…
Reference in New Issue