Skip to content

Commit

Permalink
luci: optimize the controller of hidding menu
Browse files Browse the repository at this point in the history
  • Loading branch information
nftbty authored Jun 20, 2024
1 parent e2538ba commit a4793b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions luci-app-passwall/luasrc/controller/passwall.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ function index()
entry({"admin", "services", appname, "reset_config"}, call("reset_config")).leaf = true
entry({"admin", "services", appname, "show"}, call("show_menu")).leaf = true
entry({"admin", "services", appname, "hide"}, call("hide_menu")).leaf = true
if uci:get(appname, "@global[0]", "hide_from_luci") == "1" then
return
local e
if uci:get(appname, "@global[0]", "hide_from_luci") ~= "1" then
e = entry({"admin", "services", appname}, alias("admin", "services", appname, "settings"), _("Pass Wall"), -1)
else
e = entry({"admin", "services", appname}, alias("admin", "services", appname, "settings"), nil, -1)
end
e = entry({"admin", "services", appname}, alias("admin", "services", appname, "settings"), _("Pass Wall"), -1)
e.dependent = true
e.acl_depends = { "luci-app-passwall" }
--[[ Client ]]
Expand Down

0 comments on commit a4793b9

Please sign in to comment.