Revert "luci: eliminate JS LuCI behavior"
This reverts commit aaeee88107
.
This commit is contained in:
parent
02b6dd3c8c
commit
6c0a9491f5
@ -4,7 +4,6 @@ local sys = api.sys
|
|||||||
local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist")
|
local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist")
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
s = m:section(TypedSection, "global", translate("ACLs"), "<font color='red'>" .. translate("ACLs is a tools which used to designate specific IP proxy mode.") .. "</font>")
|
s = m:section(TypedSection, "global", translate("ACLs"), "<font color='red'>" .. translate("ACLs is a tools which used to designate specific IP proxy mode.") .. "</font>")
|
||||||
s.anonymous = true
|
s.anonymous = true
|
||||||
|
@ -6,7 +6,6 @@ local has_xray = api.finded_com("xray")
|
|||||||
local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist")
|
local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist")
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
local nodes_table = {}
|
local nodes_table = {}
|
||||||
for k, e in ipairs(api.get_valid_nodes()) do
|
for k, e in ipairs(api.get_valid_nodes()) do
|
||||||
|
@ -2,7 +2,6 @@ local api = require "luci.passwall.api"
|
|||||||
local appname = api.appname
|
local appname = api.appname
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
-- [[ App Settings ]]--
|
-- [[ App Settings ]]--
|
||||||
s = m:section(TypedSection, "global_app", translate("App Update"),
|
s = m:section(TypedSection, "global_app", translate("App Update"),
|
||||||
|
@ -7,7 +7,6 @@ local has_xray = api.finded_com("xray")
|
|||||||
local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist")
|
local has_chnlist = api.fs.access("/usr/share/passwall/rules/chnlist")
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
local nodes_table = {}
|
local nodes_table = {}
|
||||||
for k, e in ipairs(api.get_valid_nodes()) do
|
for k, e in ipairs(api.get_valid_nodes()) do
|
||||||
|
@ -16,7 +16,6 @@ for k, e in ipairs(api.get_valid_nodes()) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
-- [[ Haproxy Settings ]]--
|
-- [[ Haproxy Settings ]]--
|
||||||
s = m:section(TypedSection, "global_haproxy")
|
s = m:section(TypedSection, "global_haproxy")
|
||||||
|
@ -10,7 +10,6 @@ end
|
|||||||
|
|
||||||
m = Map(appname, translate("Node Config"))
|
m = Map(appname, translate("Node Config"))
|
||||||
m.redirect = api.url()
|
m.redirect = api.url()
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
s = m:section(NamedSection, arg[1], "nodes", "")
|
s = m:section(NamedSection, arg[1], "nodes", "")
|
||||||
s.addremove = false
|
s.addremove = false
|
||||||
|
@ -4,7 +4,6 @@ local sys = api.sys
|
|||||||
local datatypes = api.datatypes
|
local datatypes = api.datatypes
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
-- [[ Other Settings ]]--
|
-- [[ Other Settings ]]--
|
||||||
s = m:section(TypedSection, "global_other")
|
s = m:section(TypedSection, "global_other")
|
||||||
|
@ -30,7 +30,6 @@ if has_trojan_go then
|
|||||||
end
|
end
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
-- [[ Subscribe Settings ]]--
|
-- [[ Subscribe Settings ]]--
|
||||||
s = m:section(TypedSection, "global_subscribe", "")
|
s = m:section(TypedSection, "global_subscribe", "")
|
||||||
|
@ -32,7 +32,6 @@ end
|
|||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
m.redirect = api.url("node_subscribe")
|
m.redirect = api.url("node_subscribe")
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
s = m:section(NamedSection, arg[1])
|
s = m:section(NamedSection, arg[1])
|
||||||
s.addremove = false
|
s.addremove = false
|
||||||
|
@ -7,7 +7,6 @@ local has_fw3 = api.is_finded("fw3")
|
|||||||
local has_fw4 = api.is_finded("fw4")
|
local has_fw4 = api.is_finded("fw4")
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
-- [[ Delay Settings ]]--
|
-- [[ Delay Settings ]]--
|
||||||
s = m:section(TypedSection, "global_delay", translate("Delay Settings"))
|
s = m:section(TypedSection, "global_delay", translate("Delay Settings"))
|
||||||
|
@ -3,8 +3,6 @@ local appname = api.appname
|
|||||||
local has_xray = api.finded_com("xray")
|
local has_xray = api.finded_com("xray")
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
-- [[ Rule Settings ]]--
|
-- [[ Rule Settings ]]--
|
||||||
s = m:section(TypedSection, "global_rules", translate("Rule status"))
|
s = m:section(TypedSection, "global_rules", translate("Rule status"))
|
||||||
s.anonymous = true
|
s.anonymous = true
|
||||||
|
@ -7,7 +7,6 @@ local path = string.format("/usr/share/%s/rules/", appname)
|
|||||||
local route_hosts_path = "/etc/"
|
local route_hosts_path = "/etc/"
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
-- [[ Rule List Settings ]]--
|
-- [[ Rule List Settings ]]--
|
||||||
s = m:section(TypedSection, "global_rules")
|
s = m:section(TypedSection, "global_rules")
|
||||||
|
@ -4,7 +4,6 @@ local datatypes = api.datatypes
|
|||||||
|
|
||||||
m = Map(appname, "Xray " .. translate("Shunt Rule"))
|
m = Map(appname, "Xray " .. translate("Shunt Rule"))
|
||||||
m.redirect = api.url()
|
m.redirect = api.url()
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
s = m:section(NamedSection, arg[1], "shunt_rules", "")
|
s = m:section(NamedSection, arg[1], "shunt_rules", "")
|
||||||
s.addremove = false
|
s.addremove = false
|
||||||
|
@ -4,7 +4,6 @@ local uci = api.uci
|
|||||||
local has_xray = api.finded_com("xray")
|
local has_xray = api.finded_com("xray")
|
||||||
|
|
||||||
m = Map(appname)
|
m = Map(appname)
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
local nodes_table = {}
|
local nodes_table = {}
|
||||||
for k, e in ipairs(api.get_valid_nodes()) do
|
for k, e in ipairs(api.get_valid_nodes()) do
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
local api = require "luci.passwall.api"
|
local api = require "luci.passwall.api"
|
||||||
|
|
||||||
m = Map("passwall_server", translate("Server-Side"))
|
m = Map("passwall_server", translate("Server-Side"))
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
t = m:section(NamedSection, "global", "global")
|
t = m:section(NamedSection, "global", "global")
|
||||||
t.anonymous = true
|
t.anonymous = true
|
||||||
|
@ -4,7 +4,6 @@ local types_dir = "/usr/lib/lua/luci/model/cbi/passwall/server/type/"
|
|||||||
|
|
||||||
m = Map("passwall_server", translate("Server Config"))
|
m = Map("passwall_server", translate("Server Config"))
|
||||||
m.redirect = api.url("server")
|
m.redirect = api.url("server")
|
||||||
api.set_apply_on_parse(m)
|
|
||||||
|
|
||||||
s = m:section(NamedSection, arg[1], "user", "")
|
s = m:section(NamedSection, arg[1], "user", "")
|
||||||
s.addremove = false
|
s.addremove = false
|
||||||
|
@ -973,22 +973,6 @@ function to_check_self()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function is_js_luci()
|
|
||||||
return sys.call('[ -f "/www/luci-static/resources/uci.js" ]') == 0
|
|
||||||
end
|
|
||||||
|
|
||||||
function set_apply_on_parse(map)
|
|
||||||
if is_js_luci() == true then
|
|
||||||
map.apply_on_parse = false
|
|
||||||
map.on_after_apply = function(self)
|
|
||||||
if self.redirect then
|
|
||||||
os.execute("sleep 1")
|
|
||||||
luci.http.redirect(self.redirect)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function luci_types(id, m, s, type_name, option_prefix)
|
function luci_types(id, m, s, type_name, option_prefix)
|
||||||
local rewrite_option_table = {}
|
local rewrite_option_table = {}
|
||||||
for key, value in pairs(s.fields) do
|
for key, value in pairs(s.fields) do
|
||||||
|
Loading…
Reference in New Issue
Block a user