Skip to content

Commit

Permalink
luci: Adjust node log option logic
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaorouji committed Apr 20, 2024
1 parent ab34375 commit 4aa647d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,12 @@ o.cfgvalue = function(t, n)
end

s:tab("log", translate("Log"))
o = s:taboption("log", Flag, "close_log_tcp", translatef("%s Node Log Close", "TCP"))
o = s:taboption("log", Flag, "log_tcp", translate("Enable") .. " " .. translatef("%s Node Log", "TCP"))
o.default = "1"
o.rmempty = false

o = s:taboption("log", Flag, "close_log_udp", translatef("%s Node Log Close", "UDP"))
o = s:taboption("log", Flag, "log_udp", translate("Enable") .. " " .. translatef("%s Node Log", "UDP"))
o.default = "1"
o.rmempty = false

loglevel = s:taboption("log", ListValue, "loglevel", "Sing-Box/Xray " .. translate("Log Level"))
Expand Down
4 changes: 2 additions & 2 deletions luci-app-passwall/root/usr/share/passwall/0_default_config
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ config global
option localhost_proxy '1'
option client_proxy '1'
option acl_enable '0'
option close_log_tcp '0'
option close_log_udp '0'
option log_tcp '1'
option log_udp '1'
option loglevel 'error'
option trojan_loglevel '4'

Expand Down
4 changes: 2 additions & 2 deletions luci-app-passwall/root/usr/share/passwall/app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@ run_redir() {
local proto=$(echo $proto | tr 'A-Z' 'a-z')
local PROTO=$(echo $proto | tr 'a-z' 'A-Z')
local type=$(echo $(config_n_get $node type) | tr 'A-Z' 'a-z')
local close_log=$(config_t_get global close_log_${proto} 1)
[ "$close_log" = "1" ] && log_file="/dev/null"
local enable_log=$(config_t_get global log_${proto} 1)
[ "$enable_log" != "1" ] && log_file="/dev/null"
local remarks=$(config_n_get $node remarks)
local server_host=$(config_n_get $node address)
local port=$(config_n_get $node port)
Expand Down

0 comments on commit 4aa647d

Please sign in to comment.