This feature was never used, is hardly documented and appears to be designed to fiddle with the internal dispatch tree state. Given that, simply drop the related code to simplify the dispatcher class somewhat. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
220 lines
3.9 KiB
Text
220 lines
3.9 KiB
Text
---[[
|
|
LuCI web dispatcher.
|
|
]]
|
|
module "luci.dispatcher"
|
|
|
|
---[[
|
|
Build the URL relative to the server webroot from given virtual path.
|
|
|
|
@class function
|
|
@name build_url
|
|
@param ... Virtual path
|
|
@return Relative URL
|
|
]]
|
|
|
|
---[[
|
|
Check whether a dispatch node shall be visible
|
|
|
|
@class function
|
|
@name node_visible
|
|
@param node Dispatch node
|
|
@return Boolean indicating whether the node should be visible
|
|
]]
|
|
|
|
---[[
|
|
Return a sorted table of visible children within a given node
|
|
|
|
@class function
|
|
@name node_childs
|
|
@param node Dispatch node
|
|
@return Ordered table of child node names
|
|
]]
|
|
|
|
---[[
|
|
Send a 404 error code and render the "error404" template if available.
|
|
|
|
@class function
|
|
@name error404
|
|
@param message Custom error message (optional)
|
|
@return false
|
|
]]
|
|
|
|
---[[
|
|
Send a 500 error code and render the "error500" template if available.
|
|
|
|
@class function
|
|
@name error500
|
|
@param message Custom error message (optional)#
|
|
@return false
|
|
]]
|
|
|
|
---[[
|
|
Dispatch an HTTP request.
|
|
|
|
@class function
|
|
@name httpdispatch
|
|
@param request LuCI HTTP Request object
|
|
]]
|
|
|
|
---[[
|
|
Dispatches a LuCI virtual path.
|
|
|
|
@class function
|
|
@name dispatch
|
|
@param request Virtual path
|
|
]]
|
|
|
|
---[[
|
|
Generate the dispatching index using the native file-cache based strategy.
|
|
|
|
|
|
@class function
|
|
@name createindex
|
|
]]
|
|
|
|
---[[
|
|
Create the dispatching tree from the index.
|
|
|
|
Build the index before if it does not exist yet.
|
|
|
|
@class function
|
|
@name createtree
|
|
]]
|
|
|
|
---[[
|
|
Clone a node of the dispatching tree to another position.
|
|
|
|
@class function
|
|
@name assign
|
|
@param path Virtual path destination
|
|
@param clone Virtual path source
|
|
@param title Destination node title (optional)
|
|
@param order Destination node order value (optional)
|
|
@return Dispatching tree node
|
|
]]
|
|
|
|
---[[
|
|
Create a new dispatching node and define common parameters.
|
|
|
|
@class function
|
|
@name entry
|
|
@param path Virtual path
|
|
@param target Target function to call when dispatched.
|
|
@param title Destination node title
|
|
@param order Destination node order value (optional)
|
|
@return Dispatching tree node
|
|
]]
|
|
|
|
---[[
|
|
Fetch or create a dispatching node without setting the target module or
|
|
enabling the node.
|
|
|
|
@class function
|
|
@name get
|
|
@param ... Virtual path
|
|
@return Dispatching tree node
|
|
]]
|
|
|
|
---[[
|
|
Fetch or create a new dispatching node.
|
|
|
|
@class function
|
|
@name node
|
|
@param ... Virtual path
|
|
@return Dispatching tree node
|
|
]]
|
|
|
|
---[[
|
|
Lookup node in dispatching tree.
|
|
|
|
@class function
|
|
@name lookup
|
|
@param ... Virtual path
|
|
@return Node object, canonical url or nil if the path was not found.
|
|
]]
|
|
|
|
---[[
|
|
Alias the first (lowest order) page automatically
|
|
|
|
|
|
@class function
|
|
@name firstchild
|
|
]]
|
|
|
|
---[[
|
|
Create a redirect to another dispatching node.
|
|
|
|
@class function
|
|
@name alias
|
|
@param ... Virtual path destination
|
|
]]
|
|
|
|
---[[
|
|
Rewrite the first x path values of the request.
|
|
|
|
@class function
|
|
@name rewrite
|
|
@param n Number of path values to replace
|
|
@param ... Virtual path to replace removed path values with
|
|
]]
|
|
|
|
---[[
|
|
Create a function-call dispatching target.
|
|
|
|
@class function
|
|
@name call
|
|
@param name Target function of local controller
|
|
@param ... Additional parameters passed to the function
|
|
]]
|
|
|
|
---[[
|
|
Create a template render dispatching target.
|
|
|
|
@class function
|
|
@name template
|
|
@param name Template to be rendered
|
|
]]
|
|
|
|
---[[
|
|
Create a CBI model dispatching target.
|
|
|
|
@class function
|
|
@name cbi
|
|
@param model CBI model to be rendered
|
|
]]
|
|
|
|
---[[
|
|
Create a combined dispatching target for non argv and argv requests.
|
|
|
|
@class function
|
|
@name arcombine
|
|
@param trg1 Overview Target
|
|
@param trg2 Detail Target
|
|
]]
|
|
|
|
---[[
|
|
Create a CBI form model dispatching target.
|
|
|
|
@class function
|
|
@name form
|
|
@param model CBI form model tpo be rendered
|
|
]]
|
|
|
|
---[[
|
|
Access the luci.i18n translate() api.
|
|
|
|
@class function
|
|
@name translate
|
|
@param text Text to translate
|
|
]]
|
|
|
|
---[[
|
|
No-op function used to mark translation entries for menu labels.
|
|
|
|
This function does not actually translate the given argument but
|
|
is used by build/i18n-scan.pl to find translatable entries.
|
|
|
|
@class function
|
|
@name _
|
|
]]
|
|
|