mirror of
https://github.com/bolucat/Archive.git
synced 2025-12-24 13:28:37 +08:00
Update On Wed Nov 19 19:40:07 CET 2025
This commit is contained in:
@@ -595,7 +595,7 @@ end
|
||||
function get_node()
|
||||
local id = http.formvalue("id")
|
||||
local result = {}
|
||||
local show_node_info = api.uci_get_type("@global_other[0]", "show_node_info", "0")
|
||||
local show_node_info = api.uci_get_type("global_other", "show_node_info", "0")
|
||||
|
||||
function add_is_ipv6_key(o)
|
||||
if o and o.address and show_node_info == "1" then
|
||||
|
||||
@@ -504,7 +504,7 @@ function get_domain_from_url(url)
|
||||
end
|
||||
|
||||
function get_valid_nodes()
|
||||
local show_node_info = uci_get_type("@global_other[0]", "show_node_info", "0")
|
||||
local show_node_info = uci_get_type("global_other", "show_node_info", "0")
|
||||
local nodes = {}
|
||||
uci:foreach(appname, "nodes", function(e)
|
||||
e.id = e[".name"]
|
||||
@@ -628,7 +628,15 @@ function gen_short_uuid()
|
||||
end
|
||||
|
||||
function uci_get_type(type, config, default)
|
||||
local value = uci:get(appname, type, config) or default
|
||||
local value = uci:get_first(appname, type, config, default) or sys.exec("echo -n $(uci -q get " .. appname .. ".@" .. type .."[0]." .. config .. ")")
|
||||
if (value == nil or value == "") and (default and default ~= "") then
|
||||
value = default
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
function uci_get_type_id(id, config, default)
|
||||
local value = uci:get(appname, id, config, default) or sys.exec("echo -n $(uci -q get " .. appname .. "." .. id .. "." .. config .. ")")
|
||||
if (value == nil or value == "") and (default and default ~= "") then
|
||||
value = default
|
||||
end
|
||||
@@ -644,7 +652,7 @@ local function chmod_755(file)
|
||||
end
|
||||
|
||||
function get_customed_path(e)
|
||||
return uci_get_type("@global_app[0]", e .. "_file")
|
||||
return uci_get_type("global_app", e .. "_file")
|
||||
end
|
||||
|
||||
function finded_com(e)
|
||||
@@ -703,7 +711,7 @@ end
|
||||
function get_app_path(app_name)
|
||||
if com[app_name] then
|
||||
local def_path = com[app_name].default_path
|
||||
local path = uci_get_type("@global_app[0]", app_name:gsub("%-","_") .. "_file")
|
||||
local path = uci_get_type("global_app", app_name:gsub("%-","_") .. "_file")
|
||||
path = path and (#path>0 and path or def_path) or def_path
|
||||
return path
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%
|
||||
local api = require "luci.passwall.api"
|
||||
local haproxy_enable = api.uci_get_type("@global_haproxy[0]", "balancing_enable", "0")
|
||||
local console_port = api.uci_get_type("@global_haproxy[0]", "console_port", "")
|
||||
local haproxy_enable = api.uci_get_type("global_haproxy", "balancing_enable", "0")
|
||||
local console_port = api.uci_get_type("global_haproxy", "console_port", "")
|
||||
-%>
|
||||
<p id="_status"></p>
|
||||
|
||||
|
||||
@@ -127,8 +127,8 @@ table td, .table .td {
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
let auto_detection_time = "<%=api.uci_get_type("@global_other[0]", "auto_detection_time", "0")%>"
|
||||
let show_node_info = "<%=api.uci_get_type("@global_other[0]", "show_node_info", "0")%>"
|
||||
let auto_detection_time = "<%=api.uci_get_type("global_other", "auto_detection_time", "0")%>"
|
||||
let show_node_info = "<%=api.uci_get_type("global_other", "show_node_info", "0")%>"
|
||||
|
||||
var node_list = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user