Returns a new LuCI.Class sublassed from this class, extended
-by the given properties and with its prototype set to this base
-class to enable inheritance. The resulting value represents a
-class constructor and can be instantiated with new.
Returns a new LuCI.Class sublassed from this class, extended
+by the given properties and with its prototype set to this base
+class to enable inheritance. The resulting value represents a
+class constructor and can be instantiated with new.
Checks whether the given class value is a subclass of this class.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
classValue
-
+
@@ -570,167 +1573,151 @@ enable inheritance.
-
-
-
-
The class object to test.
+
+
+
+
The class object to test.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true when the given classValue is a subclass of this
+class or false if the given value is not a valid class or not
+a subclass of this class'.
Returns true when the given classValue is a subclass of this
-class or false if the given value is not a valid class or not
-a subclass of this class'.
Extends this base class with the properties described in
+
+
Extends this base class with the properties described in
properties, instantiates the resulting subclass using
the additional optional arguments passed to this function
and returns the resulting subclassed Class instance.
This function serves as a convenience shortcut for
Class.extend() and subsequent
new.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
properties
-
+
@@ -739,30 +1726,27 @@ and returns the resulting subclassed Class instance.
-
-
-
-
-
-
-
-
-
-
-
An object describing the properties to add to the new
+
+
+
+
+
+
+
+
An object describing the properties to add to the new
subclass.
-
-
-
+
+
+
new_args
-
+
@@ -771,134 +1755,122 @@ subclass.
-
-
-
- <optional>
-
-
-
-
-
- <repeatable>
-
-
-
-
-
Specifies arguments to be passed to the subclass constructor
+
+
+
+ optional
+
+
+
+
+ repeatable
+
+
+
Specifies arguments to be passed to the subclass constructor
as-is in order to instantiate the new subclass.
Walks up the parent class chain and looks for a class member
+
+
Walks up the parent class chain and looks for a class member
called key in any of the parent classes this class inherits
from. Returns the member value of the superclass or calls the
member as function and returns its return value when the
@@ -913,46 +1885,39 @@ parent classes.
Calls the key() method with parameters arg1 and arg2
when found within one of the parent classes.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
key
-
+
@@ -961,29 +1926,26 @@ when found within one of the parent classes.
-
-
-
-
-
-
-
-
-
-
-
The name of the superclass member to retrieve.
+
+
+
+
+
+
+
+
The name of the superclass member to retrieve.
-
-
-
+
+
+
callArgs
-
+
@@ -992,90 +1954,64 @@ when found within one of the parent classes.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
An optional array of function call parameters to use. When
+
+
+
+ optional
+
+
+
+
+
+
An optional array of function call parameters to use. When
this parameter is specified, the found member value is called
as function using the values of this array as arguments.
@@ -1084,7 +2020,6 @@ as function using the values of this array as arguments.
the found member named by key is not a function value.
-
@@ -1098,103 +2033,109 @@ the found member named by key is not a function value.
-
-
-
-
-
Returns:
-
-
-
Returns the value of the found member or the return value of
-the call to the found method. Returns null when no member
-was found in the parent class chain or when the call to the
-superclass method returned null.
Extract all values from the given argument array beginning from
-offset and prepend any further given optional parameters to
-the beginning of the resulting array copy.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
-
-
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ *
+ |
+
+ null
+
+
+
+
Returns the value of the found member or the return value of
+the call to the found method. Returns null when no member
+was found in the parent class chain or when the call to the
+superclass method returned null.
Extract all values from the given argument array beginning from
+offset and prepend any further given optional parameters to
+the beginning of the resulting array copy.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
args
-
+
@@ -1203,29 +2144,26 @@ the beginning of the resulting array copy.
-
-
-
-
-
-
-
-
-
-
-
The array to extract the values from.
+
+
+
+
+
+
+
+
The array to extract the values from.
-
-
-
+
+
+
offset
-
+
@@ -1234,30 +2172,27 @@ the beginning of the resulting array copy.
-
-
-
-
-
-
-
-
-
-
-
The offset from which to extract the values. An offset of 0
+
+
+
+
+
+
+
+
The offset from which to extract the values. An offset of 0
would copy all values till the end.
-
-
-
+
+
+
extra_args
-
+
@@ -1266,144 +2201,122 @@ would copy all values till the end.
-
-
-
- <optional>
-
-
-
-
-
- <repeatable>
-
-
-
-
-
Extra arguments to add to prepend to the resultung array.
+
+
+
+ optional
+
+
+
+
+ repeatable
+
+
+
Extra arguments to add to prepend to the resultung array.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Array.<*>
+
+
+
+
Returns a new array consisting of the optional extra arguments
+and the values extracted from the args array beginning with
+offset.
Returns a Network.Protocol instance representing the logical
interface this device is attached to or null if it is not
-assigned to any logical interface.
-
-
-
-
-
Returns an array of Network.Device instances representing the ports
(slave interfaces) of the bridge or null when this device isn't
-a Linux bridge.
-
-
-
-
-
Returns a Network.WifiNetwork instance representing the wireless
network corresponding to this network device or null if this device
-is not a wireless device.
-
-
-
-
-
The LuCI.Network.Hosts class encapsulates host information aggregated
from multiple sources and provides convenience functions to access the
host information by different criteria.
Returns the hostname associated with the given IPv6 or null if
-no matching host could be found or if no hostname is known for
-the corresponding host.
-
-
-
-
-
-
- Type
-
-
-
-null
-|
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
getHostnameByIPAddr(ipaddr) → {null|string}
-
-
-
-
Lookup the hostname associated with the given IPv4 address.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the hostname associated with the given IPv6 or null if
+no matching host could be found or if no hostname is known for
+the corresponding host.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getHostnameByIPAddr(ipaddr){null|string}
+
+
+
+
+ network.js, line 1689
+
+
+
+
+
+
+
+
+
+
+
Lookup the hostname associated with the given IPv4 address.
Returns the hostname associated with the given IPv4 or null if
-no matching host could be found or if no hostname is known for
-the corresponding host.
-
-
-
-
-
-
- Type
-
-
-
-null
-|
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
getHostnameByMACAddr(mac) → {null|string}
-
-
-
-
Lookup the hostname associated with the given MAC address.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the hostname associated with the given IPv4 or null if
+no matching host could be found or if no hostname is known for
+the corresponding host.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getHostnameByMACAddr(mac){null|string}
+
+
+
+
+ network.js, line 1644
+
+
+
+
+
+
+
+
+
+
+
Lookup the hostname associated with the given MAC address.
Returns the IPv6 address associated with the given MAC or null if
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the IPv6 address associated with the given MAC or null if
no matching host could be found or if no IPv6 address is known for
-the corresponding host.
-
-
-
-
-
-
- Type
-
-
-
-null
-|
-
-string
-
-
-
-
+the corresponding host.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ getIPAddrByMACAddr(mac){null|string}
+
+
+
+
+ network.js, line 1659
+
+
+
+
+
+
+
+
+
Lookup the IPv4 address associated with the given MAC address.
+
+
-
getIPAddrByMACAddr(mac) → {null|string}
-
-
-
-
-
-
Lookup the IPv4 address associated with the given MAC address.
Returns the IPv4 address associated with the given MAC or null if
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the IPv4 address associated with the given MAC or null if
no matching host could be found or if no IPv4 address is known for
-the corresponding host.
-
-
-
-
-
-
- Type
-
-
-
-null
-|
-
-string
-
-
-
-
+the corresponding host.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ getMACAddrByIP6Addr(ipaddr){null|string}
+
+
+
+
+ network.js, line 1743
+
+
+
+
+
+
+
+
+
Lookup the MAC address associated with the given IPv6 address.
+
+
-
getMACAddrByIP6Addr(ipaddr) → {null|string}
-
-
-
-
-
-
Lookup the MAC address associated with the given IPv6 address.
Returns the MAC address associated with the given IPv6 or null if
-no matching host could be found or if no MAC address is known for
-the corresponding host.
-
-
-
-
-
-
- Type
-
-
-
-null
-|
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
getMACAddrByIPAddr(ipaddr) → {null|string}
-
-
-
-
Lookup the MAC address associated with the given IPv4 address.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the MAC address associated with the given IPv6 or null if
+no matching host could be found or if no MAC address is known for
+the corresponding host.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getMACAddrByIPAddr(ipaddr){null|string}
+
+
+
+
+ network.js, line 1707
+
+
+
+
+
+
+
+
+
+
+
Lookup the MAC address associated with the given IPv4 address.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
ipaddr
-
+
@@ -1181,167 +2136,151 @@ the corresponding host.
-
-
-
-
The IPv4 address to lookup.
+
+
+
+
The IPv4 address to lookup.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the MAC address associated with the given IPv4 or null if
+no matching host could be found or if no MAC address is known for
+the corresponding host.
Returns the MAC address associated with the given IPv4 or null if
-no matching host could be found or if no MAC address is known for
-the corresponding host.
Return an array of (MAC address, name hint) tuples sorted by
+
+
Return an array of (MAC address, name hint) tuples sorted by
MAC address.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
Default
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
preferIp6
-
+
@@ -1350,19 +2289,7 @@ MAC address.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
@@ -1370,135 +2297,125 @@ MAC address.
-
-
Whether to prefer IPv6 addresses (true) or IPv4 addresses (false)
+
+
+
+
+ optional
+
+
+
+
+
+
Whether to prefer IPv6 addresses (true) or IPv4 addresses (false)
as name hint when no hostname is known for a specific MAC address.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Array.<Array.<string>>
+
+
+
+
Returns an array of arrays containing a name hint for each found
+MAC address on the system. The array is sorted ascending by MAC.
+Each item of the resulting array is a two element array with the
+MAC being the first element and the name hint being the second
+element. The name hint is either the hostname, an IPv4 or an IPv6
+address related to the MAC address.
+If no hostname but both IPv4 and IPv6 addresses are known, the
+preferIP6 flag specifies whether the IPv6 or the IPv4 address
+is used as hint.
Returns an array of arrays containing a name hint for each found
-MAC address on the system. The array is sorted ascending by MAC.
-
Each item of the resulting array is a two element array with the
-MAC being the first element and the name hint being the second
-element. The name hint is either the hostname, an IPv4 or an IPv6
-address related to the MAC address.
-
If no hostname but both IPv4 and IPv6 addresses are known, the
-preferIP6 flag specifies whether the IPv6 or the IPv4 address
-is used as hint.
The Network.Protocol class serves as base for protocol specific
+ Protocol
+
+
+
The Network.Protocol class serves as base for protocol specific
subclasses which describe logical UCI networks defined by config interface sections in /etc/config/network.
Add the given network device to the logical interface.
+
+
-
addDevice(device) → {boolean}
-
-
-
-
-
-
Add the given network device to the logical interface.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
device
-
+
@@ -208,162 +1247,148 @@ subclasses which describe logical UCI networks defined by config interface
-
-
-
-
The object or device name to add to the logical interface. In case the
+
+
+
+
The object or device name to add to the logical interface. In case the
given argument is not a string, it is resolved though the
Network.getIfnameOf() function.
Returns true if the device name has been added or false if any
-argument was invalid, if the device was already part of the logical
-interface or if the logical interface is virtual.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
containsDevice(device) → {boolean}
-
-
-
-
Checks whether this logical interface contains the given device
-object.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ boolean
+
+
+
+
Returns true if the device name has been added or false if any
+argument was invalid, if the device was already part of the logical
+interface or if the logical interface is virtual.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ containsDevice(device){boolean}
+
+
+
+
+ network.js, line 2552
+
+
+
+
+
+
+
+
+
+
+
Checks whether this logical interface contains the given device
+object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
device
-
+
@@ -384,160 +1409,146 @@ object.
-
-
-
-
The object or device name to check. In case the given argument is not
+
+
+
+
The object or device name to check. In case the given argument is not
a string, it is resolved though the
Network.getIfnameOf() function.
Returns true when this logical interface contains the given network
-device or false if not.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
deleteDevice(device) → {boolean}
-
-
-
-
Remove the given network device from the logical interface.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ boolean
+
+
+
+
Returns true when this logical interface contains the given network
+device or false if not.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ deleteDevice(device){boolean}
+
+
+
+
+ network.js, line 2410
+
+
+
+
+
+
+
+
+
+
+
Remove the given network device from the logical interface.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
device
-
+
@@ -558,161 +1569,147 @@ device or false if not.
-
-
-
-
The object or device name to remove from the logical interface. In case
+
+
+
+
The object or device name to remove from the logical interface. In case
the given argument is not a string, it is resolved though the
Network.getIfnameOf() function.
Returns true if the device name has been added or false if any
-argument was invalid, if the device was already part of the logical
-interface or if the logical interface is virtual.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
get(opt) → {null|string|Array.<string>}
-
-
-
-
Read the given UCI option value of this network.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ boolean
+
+
+
+
Returns true if the device name has been added or false if any
+argument was invalid, if the device was already part of the logical
+interface or if the logical interface is virtual.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ get(opt){null|string|Array.<string>}
+
+
+
+
+ network.js, line 1827
+
+
+
+
+
+
+
+
+
+
+
Read the given UCI option value of this network.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
opt
-
+
@@ -721,577 +1718,528 @@ interface or if the logical interface is virtual.
Returns an array of of Network.Device class instances representing
the sub-devices attached to this logical interface or null if the
logical interface does not support sub-devices, e.g. because it is
-virtual and not a bridge.
-
-
-
-
-
Returns an array of IPv4 DNS servers registered by the remote
-protocol backend.
-
-
-
-
-
-
- Type
-
-
-
-Array.<string>
-
-
-
-
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Array.<string>
+
+
+
+
Returns an array of IPv4 DNS servers registered by the remote
+protocol backend.
+
+
+
+
+
+
+
+
+
+
+
+
+ getErrors(){Array.<string>}
+
+
+
+
+ network.js, line 2196
+
+
+
-
+
+
-
getErrors() → {Array.<string>}
-
-
-
-
-
-
-
Query interface error messages published in ubus runtime state.
+
+
Query interface error messages published in ubus runtime state.
Interface errors are emitted by remote protocol handlers if the setup
of the underlying logical interface failed, e.g. due to bad
configuration or network connectivity issues.
@@ -1300,3328 +2248,3033 @@ messages using the descriptions registered by
Network.registerErrorCode()
and fall back to "Unknown error (%s)" where %s is replaced by the
error code in case no translation can be found.
-
Returns an array of IPv6 addresses in CIDR notation which have been
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Array.<string>
+
+
+
+
Returns an array of IPv6 addresses in CIDR notation which have been
registered by the protocol handler. The order of the resulting array
-follows the order of the addresses in ubus runtime information.
-
-
-
-
-
-
- Type
-
-
-
-Array.<string>
-
-
-
-
+follows the order of the addresses in ubus runtime information.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ getIP6Prefix(){null|string}
+
+
+
+
+ network.js, line 2171
+
+
+
+
+
+
+
+
+
Query the routed IPv6 prefix associated with the logical interface.
+
+
-
getIP6Prefix() → {null|string}
-
-
-
-
-
-
Query the routed IPv6 prefix associated with the logical interface.
Returns an array of IPv4 addresses in CIDR notation which have been
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Array.<string>
+
+
+
+
Returns an array of IPv4 addresses in CIDR notation which have been
registered by the protocol handler. The order of the resulting array
-follows the order of the addresses in ubus runtime information.
-
-
-
-
-
-
- Type
-
-
-
-Array.<string>
-
-
-
-
+follows the order of the addresses in ubus runtime information.
Returns the name of the network protocol implementation, e.g.
-static or dhcp.
-
-
-
-
-
-
- Type
-
-
-
-string
-
-
-
-
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ string
+
+
+
+
Returns the name of the network protocol implementation, e.g.
+static or dhcp.
+
+
+
+
+
+
+
+
+
+
+
+
+ getType(){null|string}
+
+
+
+
+ network.js, line 1912
+
+
+
-
+
+
-
getType() → {null|string}
-
-
-
-
-
-
-
Get the type of the underlying interface.
+
+
Get the type of the underlying interface.
This function actually is a convenience wrapper around
proto.get("type") and is mainly used by other LuCI.Network code
to check whether the interface is declared as bridge in UCI.
Returns the requested firewall zone name as published in the
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the requested firewall zone name as published in the
ubus runtime information or null if the remote protocol
-handler didn't request a zone.
-
-
-
-
-
-
- Type
-
-
-
-null
-|
-
-string
-
-
-
-
+handler didn't request a zone.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ isAlias(){null|string}
+
+
+
+
+ network.js, line 2324
+
+
+
-
+
+
-
isAlias() → {null|string}
-
-
-
-
-
-
-
Checks whether this interface is an alias interface.
+
+
Checks whether this interface is an alias interface.
Alias interfaces are interfaces layering on top of another interface
and are denoted by a special @interfacename notation in the
underlying ifname option.
Returns true when the interface is declared with option type bridge
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true when the interface is declared with option type bridge
and when the associated protocol implementation is not marked virtual
-or false when the logical interface is no bridge.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
+or false when the logical interface is no bridge.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ isDynamic(){boolean}
+
+
+
+
+ network.js, line 2309
+
+
+
-
+
+
-
isDynamic() → {boolean}
-
-
-
-
-
-
-
Checks whether this logical interface is dynamic.
+
+
Checks whether this logical interface is dynamic.
A dynamic interface is an interface which has been created at runtime,
e.g. as sub-interface of another interface, but which is not backed by
any user configuration. Such dynamic interfaces cannot be edited but
only brought down or restarted.
Returns true if this logical interface is empty, else false.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true if this logical interface is empty, else false.
+
+
+
+
+
+
+
+
+
+
+
+
+ isFloating(){boolean}
+
+
+
+
+ network.js, line 2293
+
+
+
-
+
+
-
isFloating() → {boolean}
-
-
-
-
-
-
-
Checks whether this protocol is "floating".
+
+
Checks whether this protocol is "floating".
A "floating" protocol is a protocol which spawns its own interfaces
on demand, like a virtual one but which relies on an existinf lower
level interface to initiate the connection.
An example for such a protocol is "pppoe".
This function exists for backwards compatibility with older code
but should not be used anymore.
Returns true when the interface is active or false when it is not.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true when the interface is active or false when it is not.
+
+
+
+
+
+
+
+
+
+
+
+
+ isVirtual(){boolean}
+
+
+
+
+ network.js, line 2272
+
+
+
-
+
+
-
isVirtual() → {boolean}
-
-
-
-
-
-
-
Checks whether this protocol is "virtual".
+
+
Checks whether this protocol is "virtual".
A "virtual" protocol is a protocol which spawns its own interfaces
on demand instead of using existing physical interfaces.
Examples for virtual protocols are 6in4 which gre spawn tunnel
network device on startup, examples for non-virtual protcols are
dhcp or static which apply IP configuration to existing interfaces.
This function should be overwritten by subclasses.
A Network.WifiDevice class instance represents a wireless radio device
present on the system and provides wireless capability information as
well as methods for enumerating related wireless networks.
Deletes the wireless network with the given name associated with this
+radio device.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
network
-
+
@@ -372,163 +1392,149 @@ radio device.
-
-
-
-
The name of the wireless network to lookup. This may be either an uci
+
+
+
+
The name of the wireless network to lookup. This may be either an uci
configuration section ID, a network ID in the form radio#.network#
or a Linux network device name like wlan0 which is resolved to the
corresponding configuration section through ubus runtime information.
Returns a promise resolving to true when the wireless network was
-successfully deleted from the configuration or false when the given
-network could not be found or if the found network was not associated
-with this wireless radio device.
-
-
-
-
-
-
- Type
-
-
-
-Promise.<boolean>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
get(opt) → {null|string|Array.<string>}
-
-
-
-
Read the given UCI option value of this wireless device.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ Promise.<boolean>
+
+
+
+
Returns a promise resolving to true when the wireless network was
+successfully deleted from the configuration or false when the given
+network could not be found or if the found network was not associated
+with this wireless radio device.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ get(opt){null|string|Array.<string>}
+
+
+
+
+ network.js, line 2997
+
+
+
+
+
+
+
+
+
+
+
Read the given UCI option value of this wireless device.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
opt
-
+
@@ -537,202 +1543,187 @@ with this wireless radio device.
Returns the UCI section name (e.g. radio0) of the corresponding
-radio configuration which also serves as unique logical identifier
-for the wireless phy.
Get the wifi network of the given name belonging to this radio device
-
-
-
-
-
-
-
-
-
-
-
Parameters:
-
-
-
-
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
-
-
-
network
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
-
The name of the wireless network to lookup. This may be either an uci
-configuration section ID, a network ID in the form radio#.network#
-or a Linux network device name like wlan0 which is resolved to the
-corresponding configuration section through ubus runtime information.
Returns a promise resolving to a Network.WifiNetwork instance
-representing the wireless network and rejecting with null if
-the given network could not be found or is not associated with
-this radio device.
Returns true when the wireless radio is marked as disabled in ubus
-runtime state or when the disabled option is set in the corresponding
-UCI configuration.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
isUp() → {boolean}
-
-
-
-
-
-
-
-
Check whether the wireless radio is marked as up in the ubus
-runtime state.
Returns true when the radio device is up, else false.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
set(opt, val)
-
-
-
-
-
-
-
-
Set the given UCI option of this network to the given value.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
-
-
Name
-
-
Type
-
-
-
-
-
Description
-
-
-
opt
+
+ string
+
+
+
+
Returns the description string.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getName(){string}
+
+
+
+
+ network.js, line 3035
+
+
+
+
+
+
+
+
+
+
+
Get the configuration name of this wireless radio.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ string
+
+
+
+
Returns the UCI section name (e.g. radio0) of the corresponding
+radio configuration which also serves as unique logical identifier
+for the wireless phy.
Get the wifi network of the given name belonging to this radio device
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
network
+
+
@@ -1778,21 +2220,477 @@ runtime state.
-
-
-
-
The name of the UCI option to set.
+
+
+
+
The name of the wireless network to lookup. This may be either an uci
+configuration section ID, a network ID in the form radio#.network#
+or a Linux network device name like wlan0 which is resolved to the
+corresponding configuration section through ubus runtime information.
Returns a promise resolving to a Network.WifiNetwork instance
+representing the wireless network and rejecting with null if
+the given network could not be found or is not associated with
+this radio device.
Returns a promise resolving to an array of Network.WifiNetwork
+instances respresenting the wireless networks associated with this
+radio device.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isDisabled(){boolean}
+
+
+
+
+ network.js, line 3023
+
+
+
+
+
+
+
+
+
+
+
Checks whether this wireless radio is disabled.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true when the wireless radio is marked as disabled in ubus
+runtime state or when the disabled option is set in the corresponding
+UCI configuration.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isUp(){boolean}
+
+
+
+
+ network.js, line 3158
+
+
+
+
+
+
+
+
+
+
+
Check whether the wireless radio is marked as up in the ubus
+runtime state.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true when the radio device is up, else false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ set(opt, val)
+
+
+
+
+ network.js, line 3011
+
+
+
+
+
+
+
+
+
+
+
Set the given UCI option of this network to the given value.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
opt
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
The name of the UCI option to set.
+
+
+
+
val
-
+
@@ -1807,109 +2705,83 @@ runtime state.
-
-
-
-
The value to set or null to remove the given option from the
+
+
+
+
The value to set or null to remove the given option from the
configuration.
A Network.WifiNetwork instance represents a wireless network (vif)
configured on top of a radio device and provides functions for querying
the runtime state of the network. Most radio devices support multiple
such networks in parallel.
Returns the average bit rate among all peers associated to the network
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ number
+
+
+
+
Returns the average bit rate among all peers associated to the network
as reported by ubus runtime information or null if the information
-is not available.
-
-
-
-
-
Returns a string describing this network, consisting of the
+
Type
+
Description
+
+
+
+
+
+
+
+
+ string
+
+
+
+
Returns a string describing this network, consisting of the
term Wireless Network, followed by the active operation mode,
the SSID, BSSID or internal network ID and the Linux network device
-name, depending on which information is available.
-
-
-
-
-
-
- Type
-
-
-
-string
-
-
-
-
+name, depending on which information is available.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ getID(){string}
+
+
+
+
+ network.js, line 3417
+
+
+
-
+
+
-
getID() → {string}
-
-
-
-
-
-
-
Get the internal network ID of this wireless network.
+
+
Get the internal network ID of this wireless network.
The network ID is a LuCI specific identifer in the form
radio#.network# to identify wireless networks by their corresponding
radio and network index numbers.
Returns the current Linux network device name as resolved from
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the current Linux network device name as resolved from
ubus runtime information or null if this network has no
-associated network device, e.g. when not configured or up.
-
-
-
-
-
-
- Type
-
-
-
-null
-|
-
-string
-
-
-
-
+associated network device, e.g. when not configured or up.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ getMeshID(){null|string}
+
+
+
+
+ network.js, line 3379
+
+
+
+
+
+
+
+
+
Get the configured Mesh ID of the wireless network.
+
+
-
getMeshID() → {null|string}
-
-
-
-
-
-
Get the configured Mesh ID of the wireless network.
Returns a string describing this network, consisting of the
-active operation mode, followed by either the SSID, BSSID or
-internal network ID, depending on which information is available.
Returns the calculated signal quality in percent. The value is
-calculated from the quality and quality_max indicators reported
-by ubus runtime state.
Returns the wireless network transmit power offset in dBm as reported
-by ubus runtime information or 0 if there is no offset, or if it
-cannot be determined.
Returns true when the wireless radio is marked as disabled in ubus
-runtime state or when the disabled option is set in the corresponding
-UCI configuration.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
isUp() → {boolean}
-
-
-
-
-
-
-
-
Check whether the radio network is up.
-
This function actually queries the up state of the related radio
-device and assumes this network to be up as well when the parent
-radio is up. This is due to the fact that OpenWrt does not control
-virtual interfaces individually but within one common hostapd
-instance.
Returns an array of Network.Protocol instances representing the
+logical interfaces this wireless network is attached to.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getNoise(){number}
+
+
+
+
+ network.js, line 3825
+
+
+
+
+
+
+
+
+
+
+
Query the current radio noise floor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ number
+
+
+
+
Returns the radio noise floor in dBm as reported by ubus runtime
+information or 0 if it cannot be determined.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getShortName(){string}
+
+
+
+
+ network.js, line 3915
+
+
+
+
+
+
+
+
+
+
+
Get a short description string for this wireless network.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ string
+
+
+
+
Returns a string describing this network, consisting of the
+active operation mode, followed by either the SSID, BSSID or
+internal network ID, depending on which information is available.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getSignal(){null|number}
+
+
+
+
+ network.js, line 3814
+
+
+
+
+
+
+
+
+
+
+
Query the current wireless signal.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ number
+
+
+
+
Returns the wireless signal in dBm as reported by ubus runtime
+information or null if it cannot be determined.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getSignalLevel(){number}
+
+
+
+
+ network.js, line 3874
+
+
+
+
+
+
+
+
+
+
+
Calculate the current signal.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Deprecated
Yes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ number
+
+
+
+
Returns the calculated signal level, which is the difference between
+noise and signal (SNR), divided by 5.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getSignalPercent(){number}
+
+
+
+
+ network.js, line 3897
+
+
+
+
+
+
+
+
+
+
+
Calculate the current signal quality percentage.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ number
+
+
+
+
Returns the calculated signal quality in percent. The value is
+calculated from the quality and quality_max indicators reported
+by ubus runtime state.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getSSID(){null|string}
+
+
+
+
+ network.js, line 3365
+
+
+
+
+
+
+
+
+
+
+
Get the configured SSID of the wireless network.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the configured SSID value or null when this network is
+in mesh mode.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getTXPower(){null|number}
+
+
+
+
+ network.js, line 3847
+
+
+
+
+
+
+
+
+
+
+
Query the current radio TX power.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ number
+
+
+
+
Returns the wireless network transmit power in dBm as reported by
+ubus runtime information or null if it cannot be determined.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getTXPowerOffset(){number}
+
+
+
+
+ network.js, line 3862
+
+
+
+
+
+
+
+
+
+
+
Query the radio TX power offset.
+
Some wireless radios have a fixed power offset, e.g. due to the
+use of external amplifiers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ number
+
+
+
+
Returns the wireless network transmit power offset in dBm as reported
+by ubus runtime information or 0 if there is no offset, or if it
+cannot be determined.
Returns a Network.WifiDevice instance representing the corresponding
+wifi radio device or null if the related radio device could not be
+found.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getWifiDeviceName(){null|string}
+
+
+
+
+ network.js, line 3455
+
+
+
+
+
+
+
+
+
+
+
Get the name of the corresponding wifi radio device.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns the name of the radio device this network is configured on
+or null if it cannot be determined.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isDisabled(){boolean}
+
+
+
+
+ network.js, line 3339
+
+
+
+
+
+
+
+
+
+
+
Checks whether this wireless network is disabled.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true when the wireless radio is marked as disabled in ubus
+runtime state or when the disabled option is set in the corresponding
+UCI configuration.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isUp(){boolean}
+
+
+
+
+ network.js, line 3488
+
+
+
+
+
+
+
+
+
+
+
Check whether the radio network is up.
+
This function actually queries the up state of the related radio
+device and assumes this network to be up as well when the parent
+radio is up. This is due to the fact that OpenWrt does not control
+virtual interfaces individually but within one common hostapd
+instance.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true when the network is up, else false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ set(opt, val)
+
+
+
+
+ network.js, line 3327
+
+
+
+
+
+
+
+
+
+
+
Set the given UCI option of this network to the given value.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
opt
-
+
@@ -4102,21 +4797,21 @@ instance.
-
-
-
-
The name of the UCI option to set.
+
+
+
+
The name of the UCI option to set.
-
-
-
+
+
+
val
-
+
@@ -4131,109 +4826,83 @@ instance.
-
-
-
-
The value to set or null to remove the given option from the
+
+
+
+
The value to set or null to remove the given option from the
configuration.
Returns a promise resolving to the Protocol subclass instance
-describing the added network or resolving to null if the name
-was invalid or if a non-empty network of the given name already
-existed.
Returns a promise resolving to the Protocol subclass instance
+describing the added network or resolving to null if the name
+was invalid or if a non-empty network of the given name already
+existed.
Adds a new wireless network to the configuration and sets its options
+to the provided values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
options
-
+
@@ -427,162 +1444,148 @@ to the provided values.
-
-
-
-
The options to set for the newly added wireless network. This object
+
+
+
+
The options to set for the newly added wireless network. This object
must at least contain a device property which is set to the radio
name the new network belongs to.
Returns a promise resolving to a WifiNetwork instance describing
-the newly added wireless network or null if the given options
-were invalid or if the associated radio device could not be found.
Returns a promise resolving to a WifiNetwork instance describing
+the newly added wireless network or null if the given options
+were invalid or if the associated radio device could not be found.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ deleteNetwork(name){Promise.<boolean>}
+
+
+
+
+ network.js, line 962
+
+
+
+
+
+
+
+
+
+
+
Deletes the given network and its references from the network and
+firewall configuration.
Returns a promise resolving to either true if the network and
-references to it were successfully deleted from the configuration or
-false if the given network could not be found.
-
-
-
-
-
-
- Type
-
-
-
-Promise.<boolean>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
deleteWifiNetwork(netname) → {Promise.<boolean>}
-
-
-
-
Deletes the given wireless network from the configuration.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ Promise.<boolean>
+
+
+
+
Returns a promise resolving to either true if the network and
+references to it were successfully deleted from the configuration or
+false if the given network could not be found.
Deletes the given wireless network from the configuration.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
netname
-
+
@@ -752,275 +1741,251 @@ references to it were successfully deleted from the configuration or
-
-
-
-
The name of the network to remove. This may be either a
+
+
+
+
The name of the network to remove. This may be either a
network ID in the form radio#.network# or a Linux network device
name like wlan0 which is resolved to the corresponding configuration
section through ubus runtime information.
This function aggregates information from various sources such as
-DHCP lease databases, ARP and IPv6 neighbour entries, wireless
-association list etc. and returns a Hosts
-class instance describing the found hosts.
This function aggregates information from various sources such as
+DHCP lease databases, ARP and IPv6 neighbour entries, wireless
+association list etc. and returns a Hosts
+class instance describing the found hosts.
Instantiates the given Protocol backend,
+optionally using the given network name.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
protoname
-
+
@@ -2144,33 +3011,30 @@ optionally using the given network name.
-
-
-
-
-
-
-
-
-
-
-
-
The protocol backend to use, e.g. static or dhcp.
+
+
+
+
+
+
+
+
+
The protocol backend to use, e.g. static or dhcp.
-
-
-
+
+
+
netname
-
+
@@ -2179,19 +3043,7 @@ optionally using the given network name.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
@@ -2199,612 +3051,567 @@ optionally using the given network name.
-
-
The network name to use for the instantiated protocol. This should be
+
+
+
+
+ optional
+
+
+
+
+
+
The network name to use for the instantiated protocol. This should be
usually set to one of the interfaces described in /etc/config/network
but it is allowed to omit it, e.g. to query protocol capabilities
without the need for an existing interface.
Returns a promise resolving to an object containing the topologies
-of each switch. The object keys correspond to the name of the switches
-such as switch0, the values are
-SwitchTopology objects describing
-the layout.
Returns a promise resolving to an object containing the topologies
+of each switch. The object keys correspond to the name of the switches
+such as switch0, the values are
+SwitchTopology objects describing
+the layout.
Returns a promise resolving to an array of WifiDevice instances
-describing the wireless radios configured in the system.
-The order of the array corresponds to the order of the radios in
-the configuration.
Returns a promise resolving to an array of WifiDevice instances
+describing the wireless radios configured in the system.
+The order of the array corresponds to the order of the radios in
+the configuration.
Get a WifiNetwork instance describing
+the given wireless network.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
netname
-
+
@@ -3089,166 +3872,152 @@ the given wireless network.
-
-
-
-
The name of the wireless network to lookup. This may be either an uci
+
+
+
+
The name of the wireless network to lookup. This may be either an uci
configuration section ID, a network ID in the form radio#.network#
or a Linux network device name like wlan0 which is resolved to the
corresponding configuration section through ubus runtime information.
Test if a given network device name is in the list of patterns for
+
+
Test if a given network device name is in the list of patterns for
device names to ignore.
Ignored device names are usually Linux network devices which are
spawned implicitly by kernel modules such as tunl0 or hwsim0
and which are unsuitable for use in network configuration.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
name
-
+
@@ -3257,162 +4026,146 @@ and which are unsuitable for use in network configuration.
Returns a string containing the netmask corresponding to the bit count
-or null when the given amount of bits exceeds the maximum possible
-value of 32 for IPv4 or 128 for IPv6.
-
-
-
-
-
-
- Type
-
-
-
-null
-|
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
registerErrorCode(code, message) → {boolean}
-
-
-
-
Registers a new human readable translation string for a Protocol
-error code.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ null
+ |
+
+ string
+
+
+
+
Returns a string containing the netmask corresponding to the bit count
+or null when the given amount of bits exceeds the maximum possible
+value of 32 for IPv4 or 128 for IPv6.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ registerErrorCode(code, message){boolean}
+
+
+
+
+ network.js, line 853
+
+
+
+
+
+
+
+
+
+
+
Registers a new human readable translation string for a Protocol
+error code.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
code
-
+
@@ -3857,22 +4568,22 @@ error code.
-
-
-
-
The ubus protocol error code to register a translation for, e.g.
+
+
+
+
The ubus protocol error code to register a translation for, e.g.
NO_DEVICE.
-
-
-
+
+
+
message
-
+
@@ -3881,160 +4592,146 @@ error code.
-
-
-
-
The message to use as translation for the given protocol error code.
+
+
+
+
The message to use as translation for the given protocol error code.
Returns true if the error code description has been added or false
-if either the arguments were invalid or if there already was a
-description for the given code.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
registerPatternVirtual(pat)
-
-
-
-
Registers a new regular expression pattern to recognize
-virtual interfaces.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ boolean
+
+
+
+
Returns true if the error code description has been added or false
+if either the arguments were invalid or if there already was a
+description for the given code.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ registerPatternVirtual(pat)
+
+
+
+
+ network.js, line 833
+
+
+
+
+
+
+
+
+
+
+
Registers a new regular expression pattern to recognize
+virtual interfaces.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
pat
-
+
@@ -4043,140 +4740,119 @@ virtual interfaces.
-
-
-
-
A RegExp instance to match a virtual interface name
+
+
+
+
A RegExp instance to match a virtual interface name
such as 6in4-wan or tun0.
Returns a promise resolving to either true if the network was
-successfully renamed or false if the new name was invalid, if
-a network with the new name already exists or if the network to
-rename could not be found.
-
-
-
-
-
-
- Type
-
-
-
-Promise.<boolean>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Type Definitions
-
-
-
-
SwitchTopology
-
-
-
-
-
-
Describes an swconfig switch topology by specifying the CPU
-connections and external port labels of a switch.
Rename the given network and its references to a new name.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
oldName
+
+
+
+
+
+string
-
-
+
+
+
+
+
+
+
+
The current name of the network.
+
+
+
+
+
+
+
newName
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
The name to rename the network to, must be in the format
+[a-z-A-Z0-9_]+.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
Properties:
+
+
-
+
+
+
+
+
+
Returns:
+
+
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ Promise.<boolean>
+
+
+
+
Returns a promise resolving to either true if the network was
+successfully renamed or false if the new name was invalid, if
+a network with the new name already exists or if the network to
+rename could not be found.
Describes an swconfig switch topology by specifying the CPU
+connections and external port labels of a switch.
+
+
+
+
+
+
+
+
Properties:
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
netdevs
-
+
@@ -4564,24 +5202,24 @@ connections and external port labels of a switch.
-
-
-
+
+
+
The netdevs property points to an object describing the CPU port
connections of the switch. The numeric key of the enclosed object is
the port number, the value contains the Linux network device name the
port is hardwired to.
-
-
-
+
+
+
ports
-
+
@@ -4590,11 +5228,11 @@ port is hardwired to.
-
-
-
+
+
+
The ports property points to an array describing the populated
ports of the switch in the external label order. Each array item is
an object containg the following keys:
@@ -4606,119 +5244,91 @@ an object containg the following keys:
function (CPU ports only)
Specifies whether any kind of encryption, such as WEP or WPA is
enabled. If set to false, then no encryption is active and the
corresponding network is open.
-
-
-
+
+
+
wep
-
+
@@ -4758,31 +5368,31 @@ corresponding network is open.
-
+
<optional>
-
+
-
-
+
+
When the wep property exists, the network uses WEP encryption.
In this case, the property is set to an array of active WEP modes
which might be either open, shared or both.
-
-
-
+
+
+
wpa
-
+
@@ -4791,32 +5401,32 @@ which might be either open, shared or both.
-
+
<optional>
-
+
-
-
+
+
When the wpa property exists, the network uses WPA security.
In this case, the property is set to an array containing the WPA
protocol versions used, e.g. [ 1, 2 ] for WPA/WPA2 mixed mode or
[ 3 ] for WPA3-SAE.
-
-
-
+
+
+
authentication
-
+
@@ -4825,33 +5435,33 @@ protocol versions used, e.g. [ 1, 2 ] for WPA/WPA2 mixed mode or
-
+
<optional>
-
+
-
-
+
+
The authentication property only applies to WPA encryption and
is defined when the wpa property is set as well. It points to
an array of active authentication suites used by the network, e.g.
[ "psk" ] for a WPA(2)-PSK network or [ "psk", "sae" ] for
mixed WPA2-PSK/WPA3-SAE encryption.
If either WEP or WPA encryption is active, then the ciphers
property will be set to an array describing the active encryption
ciphers used by the network, e.g. [ "tkip", "ccmp" ] for a
WPA/WPA2-PSK mixed network or [ "wep-40", "wep-104" ] for an
WEP network.
A wireless rate entry describes the properties of a wireless
+transmission rate to or from a peer.
+
+
+
+
+
+
+
+
Properties:
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
Argument
+
+
+
+
+
Description
+
+
+
+
+
+
drop_misc
-
+
@@ -5773,31 +6327,31 @@ transmission rate to or from a peer.
-
+
<optional>
-
+
-
-
+
+
The amount of received misc. packages that have been dropped, e.g.
due to corruption or missing authentication. Only applicable to
receiving rates.
-
-
-
+
+
+
packets
-
+
@@ -5806,27 +6360,27 @@ receiving rates.
-
+
-
+
-
-
+
+
The amount of packets that have been received or sent.
-
-
-
+
+
+
bytes
-
+
@@ -5835,27 +6389,27 @@ receiving rates.
-
+
-
+
-
-
+
+
The amount of bytes that have been received or sent.
-
-
-
+
+
+
failed
-
+
@@ -5864,30 +6418,30 @@ receiving rates.
-
+
<optional>
-
+
-
-
+
+
The amount of failed tranmission attempts. Only applicable to
transmit rates.
-
-
-
+
+
+
retries
-
+
@@ -5896,30 +6450,30 @@ transmit rates.
-
+
<optional>
-
+
-
-
+
+
The amount of retried transmissions. Only applicable to transmit
rates.
-
-
-
+
+
+
is_ht
-
+
@@ -5928,27 +6482,27 @@ rates.
-
+
-
+
-
-
+
+
Specifies whether this rate is an HT (IEEE 802.11n) rate.
-
-
-
+
+
+
is_vht
-
+
@@ -5957,27 +6511,27 @@ rates.
-
+
-
+
-
-
+
+
Specifies whether this rate is an VHT (IEEE 802.11ac) rate.
-
-
-
+
+
+
mhz
-
+
@@ -5986,27 +6540,27 @@ rates.
-
+
-
+
-
-
+
+
The channel width in MHz used for the transmission.
-
-
-
+
+
+
rate
-
+
@@ -6015,27 +6569,27 @@ rates.
-
+
-
+
-
-
+
+
The bitrate in bit/s of the transmission.
-
-
-
+
+
+
mcs
-
+
@@ -6044,30 +6598,30 @@ rates.
-
+
<optional>
-
+
-
-
+
+
The MCS index of the used transmission rate. Only applicable to
HT or VHT rates.
-
-
-
+
+
+
40mhz
-
+
@@ -6076,33 +6630,33 @@ HT or VHT rates.
-
+
<optional>
-
+
-
-
+
+
Specifies whether the tranmission rate used 40MHz wide channel.
Only applicable to HT or VHT rates.
Note: this option exists for backwards compatibility only and its
use is discouraged. The mhz field should be used instead to
determine the channel width.
-
-
-
+
+
+
short_gi
-
+
@@ -6111,30 +6665,30 @@ determine the channel width.
-
+
<optional>
-
+
-
-
+
+
Specifies whether a short guard interval is used for the transmission.
Only applicable to HT or VHT rates.
-
-
-
+
+
+
nss
-
+
@@ -6143,132 +6697,104 @@ Only applicable to HT or VHT rates.
-
+
<optional>
-
+
-
-
+
+
Specifies the number of spatial streams used by the transmission.
Only applicable to VHT rates.
Register an HTTP response interceptor function. Interceptor
+
+
Register an HTTP response interceptor function. Interceptor
functions are useful to perform default actions on incoming HTTP
responses, such as checking for expired authentication or for
implementing request retries before returning a failure.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
interceptorFn
-
+
@@ -206,157 +1245,143 @@ implementing request retries before returning a failure.
@@ -1472,17 +2369,17 @@ these functions have been registered.
-
+
<optional>
-
+
-
+
@@ -1490,17 +2387,17 @@ these functions have been registered.
-
+
The HTTP method to use, e.g. GET or POST.
-
-
-
+
+
+
query
-
+
@@ -1509,34 +2406,34 @@ these functions have been registered.
-
+
<optional>
-
+
-
+
-
+
Query string data to append to the URL. Non-string values of the
given object will be converted to JSON.
-
-
-
+
+
+
cache
-
+
@@ -1545,17 +2442,17 @@ given object will be converted to JSON.
-
+
<optional>
-
+
-
+
@@ -1563,17 +2460,17 @@ given object will be converted to JSON.
-
+
Specifies whether the HTTP response may be retrieved from cache.
-
-
-
+
+
+
username
-
+
@@ -1582,33 +2479,33 @@ given object will be converted to JSON.
-
+
<optional>
-
+
-
+
-
+
Provides a username for HTTP basic authentication.
-
-
-
+
+
+
password
-
+
@@ -1617,33 +2514,33 @@ given object will be converted to JSON.
-
+
<optional>
-
+
-
+
-
+
Provides a password for HTTP basic authentication.
-
-
-
+
+
+
timeout
-
+
@@ -1652,33 +2549,33 @@ given object will be converted to JSON.
-
+
<optional>
-
+
-
+
-
+
Specifies the request timeout in seconds.
-
-
-
+
+
+
credentials
-
+
@@ -1687,17 +2584,17 @@ given object will be converted to JSON.
-
+
<optional>
-
+
-
+
@@ -1705,17 +2602,17 @@ given object will be converted to JSON.
-
+
Whether to include credentials such as cookies in the request.
-
-
-
+
+
+
content
-
+
@@ -1724,37 +2621,37 @@ given object will be converted to JSON.
-
+
<optional>
-
+
-
+
-
+
Specifies the HTTP message body to send along with the request.
If the value is a function, it is invoked and the return value
used as content, if it is a FormData instance, it is used as-is,
if it is an object, it will be converted to JSON, in all other
cases it is converted to a string.
-
-
-
+
+
+
header
-
+
@@ -1763,33 +2660,33 @@ cases it is converted to a string.
-
+
<optional>
-
+
-
+
-
+
Specifies HTTP headers to set for the request.
-
-
-
+
+
+
progress
-
+
@@ -1798,103 +2695,80 @@ cases it is converted to a string.
-
+
<optional>
-
+
-
+
-
+
An optional request callback function which receives ProgressEvent
instances as sole argument during the HTTP request transfer.
The Request.poll class provides some convience wrappers around
LuCI.Poll mainly to simplify registering repeating HTTP
request calls as polling functions.
Clones the given response object, optionally overriding the content
+
+
Clones the given response object, optionally overriding the content
of the cloned instance.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
content
-
+
@@ -634,200 +1509,164 @@ of the cloned instance.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
Override the content of the cloned response. Object values will be
+
+
+
+ optional
+
+
+
+
+
+
Override the content of the cloned response. Object values will be
treated as JSON response data, all other types will be converted
using String() and treated as response text.
The LuCI.XHR class is a legacy compatibility shim for the
functionality formerly provided by xhr.js. It is registered as global
window.XHR symbol for compatibility with legacy code.
New code should use LuCI.Request instead to implement HTTP
request handling.
Returns true if the request is still running or false if it
-already completed.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true if the request is still running or false if it
+already completed.
+
+
+
+
+
+
+
+
+
+
+
+
+ cancel()
+
+
+
+
+ luci.js, line 3022
+
+
+
-
+
+
-
cancel()
-
-
-
-
-
-
-
Cancels a running request.
+
+
Cancels a running request.
This function does not actually cancel the underlying
XMLHTTPRequest request but it sets a flag which prevents the
invocation of the callback function when the request eventually
finishes or timed out.
Appends the given children data to the given node.
+
+
-
append(node, childrenopt) → {Node|null}
-
-
-
-
-
-
Appends the given children data to the given node.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
node
-
+
@@ -198,29 +1235,26 @@ manipulating DOM elements.
-
-
-
-
-
-
-
-
-
-
-
The Node argument to append the children to.
+
+
+
+
+
+
+
+
The Node argument to append the children to.
-
-
-
+
+
+
children
-
+
@@ -229,22 +1263,19 @@ manipulating DOM elements.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
The childrens to append to the given node.
+
+
+
+ optional
+
+
+
+
+
+
The childrens to append to the given node.
When children is an array, then each item of the array
will be either appended as child element or text node,
depending on whether the item is a DOM Node instance or
@@ -262,157 +1293,141 @@ appended to the given node.
converted to a string and appened to the innerHTML property
of the given node.
Returns the last children Node appended to the node or null
-if either the node argument was no valid DOM node or if the
-children was null or didn't result in further DOM nodes.
-
-
-
-
-
-
- Type
-
-
-
-Node
-|
-
-null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
attr(node, key, valopt)
-
-
-
-
Sets attributes or registers event listeners on element nodes.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ Node
+ |
+
+ null
+
+
+
+
Returns the last children Node appended to the node or null
+if either the node argument was no valid DOM node or if the
+children was null or didn't result in further DOM nodes.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ attr(node, key, val)
+
+
+
+
+ luci.js, line 2331
+
+
+
+
+
+
+
+
+
+
+
Sets attributes or registers event listeners on element nodes.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
node
-
+
@@ -421,31 +1436,28 @@ if either the node argument was no valid DOM node or i
-
-
-
-
-
-
-
-
-
-
-
The Node argument to set the attributes or add the event
+
+
+
+
+
+
+
+
The Node argument to set the attributes or add the event
listeners for. When the given node value is not a valid
DOM Node, the function returns and does nothing.
-
-
-
+
+
+
key
-
+
@@ -457,32 +1469,29 @@ DOM Node, the function returns and does nothing.
-
-
-
-
-
-
-
-
-
-
-
Specifies either the attribute or event handler name to use,
+
+
+
+
+
+
+
+
Specifies either the attribute or event handler name to use,
or an object containing multiple key, value pairs which are
each added to the node as either attribute or event handler,
depending on the respective value.
-
-
-
+
+
+
val
-
+
@@ -491,22 +1500,19 @@ depending on the respective value.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
Specifies the attribute value or event handler function to add.
+
+
+
+ optional
+
+
+
+
+
+
Specifies the attribute value or event handler function to add.
If the key parameter is an Object, this parameter will be
ignored.
When val is of type function, it will be registered as event
@@ -519,133 +1525,112 @@ as attribute name.
to the given node as-is, with the underlying setAttribute()
call implicitely turning it into a string.
Binds the given class instance ot the specified DOM Node.
+
+
Binds the given class instance ot the specified DOM Node.
This function uses the dom.data() facility to attach the
passed instance of a Class to a node. This is needed for
complex widget elements or similar where the corresponding
class instance responsible for the element must be retrieved
from DOM nodes obtained by querySelector() or similar means.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
node
-
+
@@ -654,21 +1639,21 @@ from DOM nodes obtained by querySelector() or similar means.
-
-
-
-
The DOM Node instance to bind the class to.
+
+
+
+
The DOM Node instance to bind the class to.
-
-
-
+
+
+
inst
-
+
@@ -677,78 +1662,55 @@ from DOM nodes obtained by querySelector() or similar means.
@@ -757,7 +1719,6 @@ from DOM nodes obtained by querySelector() or similar means.
a valid Class instance.
-
@@ -771,97 +1732,103 @@ a valid Class instance.
-
-
-
-
-
Returns:
-
-
-
Returns the bound class instance.
-
-
-
-
-
-
- Type
-
-
-
-Class
-
-
-
-
-
+
+
+
Returns:
-
-
-
-
-
-
-
-
-
-
callClassMethod(node, method, …params) → {*|null}
-
-
-
-
-
-
-
-
Finds a bound class instance on the given node itself or the
-first bound instance on its closest parent node and invokes
-the specified method name on the found class instance.
Finds a bound class instance on the given node itself or the
+first bound instance on its closest parent node and invokes
+the specified method name on the found class instance.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
node
-
+
@@ -870,29 +1837,26 @@ the specified method name on the found class instance.
-
-
-
-
-
-
-
-
-
-
-
The DOM Node instance to start from.
+
+
+
+
+
+
+
+
The DOM Node instance to start from.
-
-
-
+
+
+
method
-
+
@@ -901,29 +1865,26 @@ the specified method name on the found class instance.
-
-
-
-
-
-
-
-
-
-
-
The name of the method to invoke on the found class instance.
+
+
+
+
+
+
+
+
The name of the method to invoke on the found class instance.
-
-
-
+
+
+
params
-
+
@@ -932,178 +1893,159 @@ the specified method name on the found class instance.
-
-
-
-
-
-
-
- <repeatable>
-
-
-
-
-
Additional arguments to pass to the invoked method as-is.
+
+
+
+
+
+
+ repeatable
+
+
+
Additional arguments to pass to the invoked method as-is.
Returns the return value of the invoked method if a class
-instance and method has been found. Returns null if either
-no bound class instance could be found, or if the found
-instance didn't have the requested method.
-
-
-
-
-
-
- Type
-
-
-
-*
-|
-
-null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
content(node, childrenopt) → {Node|null}
-
-
-
-
Replaces the content of the given node with the given children.
-
This function first removes any children of the given DOM
-Node and then adds the given given children following the
-rules outlined below.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ *
+ |
+
+ null
+
+
+
+
Returns the return value of the invoked method if a class
+instance and method has been found. Returns null if either
+no bound class instance could be found, or if the found
+instance didn't have the requested method.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ content(node, children){Node|null}
+
+
+
+
+ luci.js, line 2283
+
+
+
+
+
+
+
+
+
+
+
Replaces the content of the given node with the given children.
+
This function first removes any children of the given DOM
+Node and then adds the given given children following the
+rules outlined below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
node
-
+
@@ -1112,29 +2054,26 @@ rules outlined below.
-
-
-
-
-
-
-
-
-
-
-
The Node argument to replace the children of.
+
+
+
+
+
+
+
+
The Node argument to replace the children of.
-
-
-
+
+
+
children
-
+
@@ -1143,22 +2082,19 @@ rules outlined below.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
The childrens to replace into the given node.
+
+
+
+ optional
+
+
+
+
+
+
The childrens to replace into the given node.
When children is an array, then each item of the array
will be either appended as child element or text node,
depending on whether the item is a DOM Node instance or
@@ -1176,162 +2112,146 @@ appended to the given node.
converted to a string and appened to the innerHTML property
of the given node.
Returns the last children Node appended to the node or null
-if either the node argument was no valid DOM node or if the
-children was null or didn't result in further DOM nodes.
-
-
-
-
-
-
- Type
-
-
-
-Node
-|
-
-null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
create(html, attropt, dataopt) → {Node}
-
-
-
-
Creates a new DOM Node from the given html, attr and
-data parameters.
-
This function has multiple signatures, it can be either invoked
-in the form create(html[, attr[, data]]) or in the form
-create(html[, data]). The used variant is determined from the
-type of the second argument.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ Node
+ |
+
+ null
+
+
+
+
Returns the last children Node appended to the node or null
+if either the node argument was no valid DOM node or if the
+children was null or didn't result in further DOM nodes.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ create(html, attr, data){Node}
+
+
+
+
+ luci.js, line 2409
+
+
+
+
+
+
+
+
+
+
+
Creates a new DOM Node from the given html, attr and
+data parameters.
+
This function has multiple signatures, it can be either invoked
+in the form create(html[, attr[, data]]) or in the form
+create(html[, data]). The used variant is determined from the
+type of the second argument.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
html
-
+
@@ -1340,20 +2260,17 @@ type of the second argument.
-
-
-
-
-
-
-
-
-
-
-
Describes the node to create.
+
+
+
+
+
+
+
+
Describes the node to create.
When the value of html is of type array, a DocumentFragment
node is created and each item of the array is first converted
to a DOM Node by passing it through create() and then added
@@ -1366,14 +2283,14 @@ be passed to dom.parse() and the resulting value is used.
to document.createElement() for creating a new DOM Node of
the given name.
-
-
-
+
+
+
attr
-
+
@@ -1382,33 +2299,30 @@ the given name.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
Specifies an Object of key, value pairs to set as attributes
+
+
+
+ optional
+
+
+
+
+
+
Specifies an Object of key, value pairs to set as attributes
or event handlers on the created node. Refer to
dom.attr() for details.
-
-
-
+
+
+
data
-
+
@@ -1417,89 +2331,63 @@ or event handlers on the created node. Refer to
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
Specifies children to append to the newly created element.
+
+
+
+ optional
+
+
+
+
+
+
Specifies children to append to the newly created element.
Refer to dom.append() for details.
@@ -1511,7 +2399,6 @@ in html contains characters which are not legal in DOM
element names, such as spaces.
-
@@ -1525,55 +2412,68 @@ element names, such as spaces.
-
+
+
+
+
Returns:
-
Returns:
-
+
+
+
-
-
Returns the newly created Node.
-
-
-
-
-
-
- Type
-
-
-
-Node
-
-
-
-
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Node
+
+
+
+
Returns the newly created Node.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ data(node, key, val){*}
+
+
+
+
+ luci.js, line 2485
+
+
+
-
+
+
-
data(node, keyopt, valopt) → {*}
-
-
-
-
-
-
-
Attaches or detaches arbitrary data to and from a DOM Node.
+
+
Attaches or detaches arbitrary data to and from a DOM Node.
This function is useful to attach non-string values or runtime
data that is not serializable to DOM nodes. To decouple data
from the DOM, values are not added directly to nodes, but
@@ -1594,46 +2494,39 @@ Clears any data associated with the node.
dom.data(node, key, null) -
Clears the given key associated with the node.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
node
-
+
@@ -1642,29 +2535,26 @@ Clears the given key associated with the node.
-
-
-
-
-
-
-
-
-
-
-
The DOM Node instance to set or retrieve the data for.
+
+
+
+
+
+
+
+
The DOM Node instance to set or retrieve the data for.
-
-
-
+
+
+
key
-
+
@@ -1676,32 +2566,29 @@ Clears the given key associated with the node.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
This is either a string specifying the key to retrieve, or
+
+
+
+ optional
+
+
+
+
+
+
This is either a string specifying the key to retrieve, or
null to unset the entire node data.
-
-
-
+
+
+
val
-
+
@@ -1713,169 +2600,152 @@ Clears the given key associated with the node.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
This is either a non-null value to set for a given key or
+
+
+
+ optional
+
+
+
+
+
+
This is either a non-null value to set for a given key or
null to remove the given key from the specified node.
Returns true if the node does not have any children or if
-any children node either has a hidden CSS class or a false
-result when testing it using the given ignoreFn.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
matches(node, selectoropt) → {boolean}
-
-
-
-
Tests whether a given Node matches the given query selector.
-
This function is a convenience wrapper around the standard
-Node.matches("selector") function with the added benefit that
-the node argument may be a non-Node value, in which case
-this function simply returns false.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ boolean
+
+
+
+
Returns true if the node does not have any children or if
+any children node either has a hidden CSS class or a false
+result when testing it using the given ignoreFn.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ matches(node, selector){boolean}
+
+
+
+
+ luci.js, line 2140
+
+
+
+
+
+
+
+
+
+
+
Tests whether a given Node matches the given query selector.
+
This function is a convenience wrapper around the standard
+Node.matches("selector") function with the added benefit that
+the node argument may be a non-Node value, in which case
+this function simply returns false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
node
-
+
@@ -2422,29 +3240,26 @@ this function simply returns false.
-
-
-
-
-
-
-
-
-
-
-
The Node argument to test the selector against.
+
+
+
+
+
+
+
+
The Node argument to test the selector against.
-
-
-
+
+
+
selector
-
+
@@ -2453,176 +3268,157 @@ this function simply returns false.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
The query selector expression to test against the given node.
+
+
+
+ optional
+
+
+
+
+
+
The query selector expression to test against the given node.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ boolean
+
+
+
+
Returns true if the given node matches the specified selector
+or false when the node argument is no valid DOM Node or the
+selector didn't match.
Returns true if the given node matches the specified selector
-or false when the node argument is no valid DOM Node or the
-selector didn't match.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ parent(node, selector){Node|null}
+
+
+
+
+ luci.js, line 2167
+
+
+
-
+
+
-
parent(node, selectoropt) → {Node|null}
-
-
-
-
-
-
-
Returns the closest parent node that matches the given query
+
+
Returns the closest parent node that matches the given query
selector expression.
This function is a convenience wrapper around the standard
Node.closest("selector") function with the added benefit that
the node argument may be a non-Node value, in which case
this function simply returns null.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
node
-
+
@@ -2631,29 +3427,26 @@ this function simply returns null.
-
-
-
-
-
-
-
-
-
-
-
The Node argument to find the closest parent for.
+
+
+
+
+
+
+
+
The Node argument to find the closest parent for.
-
-
-
+
+
+
selector
-
+
@@ -2662,172 +3455,155 @@ this function simply returns null.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
The query selector expression to test against each parent.
+
+
+
+ optional
+
+
+
+
+
+
The query selector expression to test against each parent.
Returns the closest parent node matching the selector or
-null when the node argument is no valid DOM Node or the
-selector didn't match any parent.
-
-
-
-
-
-
- Type
-
-
-
-Node
-|
-
-null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
parse(s) → {Node}
-
-
-
-
Parses a given string as HTML and returns the first child node.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ Node
+ |
+
+ null
+
+
+
+
Returns the closest parent node matching the selector or
+null when the node argument is no valid DOM Node or the
+selector didn't match any parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ parse(s){Node}
+
+
+
+
+ luci.js, line 2098
+
+
+
+
+
+
+
+
+
+
+
Parses a given string as HTML and returns the first child node.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
s
-
+
@@ -2836,170 +3612,156 @@ selector didn't match any parent.
-
-
-
-
A string containing an HTML fragment to parse. Note that only
+
+
+
+
A string containing an HTML fragment to parse. Note that only
the first result of the resulting structure is returned, so an
input value of <div>foo</div> <div>bar</div> will only return
the first div element node.
Provides high level utilities to wrap file system related RPC calls.
To import the class in views, use 'require fs', to import it in
external JavaScript, use L.require("fs").then(...).
Execute the specified command, optionally passing params and
+
+
Execute the specified command, optionally passing params and
environment variables.
Note: The command must be either the path to an executable,
or a basename without arguments in which case it will be searched
@@ -158,46 +1202,39 @@ in $PATH. If specified, the values given in params will be passed
as arguments to the command.
The key/value pairs in the optional env table are translated to
setenv() calls prior to running the command.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
command
-
+
@@ -206,29 +1243,26 @@ as arguments to the command.
-
-
-
-
-
-
-
-
-
-
-
The command to invoke.
+
+
+
+
+
+
+
+
The command to invoke.
-
-
-
+
+
+
params
-
+
@@ -237,31 +1271,28 @@ as arguments to the command.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
The arguments to pass to the command.
+
+
+
+ optional
+
+
+
+
+
+
The arguments to pass to the command.
-
-
-
+
+
+
env
-
+
@@ -270,172 +1301,155 @@ as arguments to the command.
Read the contents of the given file, trim leading and trailing white
+
+
Read the contents of the given file, trim leading and trailing white
space and return the trimmed result. In case of errors, return an empty
string instead.
Note: this function is useful to read single-value files in /sys
or /proc.
This function is guaranteed to not reject its promises, on failure,
an empty string will be returned.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
path
-
+
@@ -1251,164 +2195,148 @@ an empty string will be returned.
-
-
-
-
The file path to read.
+
+
+
+
The file path to read.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Promise.<string>
+
+
+
+
Returns a promise resolving to the file contents or the empty string
+on failure.
Test whether a particular system feature is available, such as
+
+
Test whether a particular system feature is available, such as
hostapd SAE support or an installed firewall. The features are
queried once at the beginning of the LuCI session and cached in
SessionStorage throughout the lifetime of the associated tab or
browser window.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
feature
-
+
@@ -1227,30 +2138,27 @@ browser window.
-
-
-
-
-
-
-
-
-
-
-
The feature to test. For detailed list of known feature flags,
+
+
+
+
+
+
+
+
The feature to test. For detailed list of known feature flags,
see /modules/luci-base/root/usr/libexec/rpcd/luci.
-
-
-
+
+
+
subfeature
-
+
@@ -1259,179 +2167,160 @@ see /modules/luci-base/root/usr/libexec/rpcd/luci.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
Some feature classes like hostapd provide sub-feature flags,
+
+
+
+ optional
+
+
+
+
+
+
Some feature classes like hostapd provide sub-feature flags,
such as sae or 11w support. The subfeature argument can
be used to query these.
Return true if the queried feature (and sub-feature) is available
-or false if the requested feature isn't present or known.
-Return null when a sub-feature was queried for a feature which
-has no sub-features.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-|
-
-null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
isObject(valopt) → {boolean}
-
-
-
-
Tests whether the passed argument is a JavaScript object.
-This function is meant to be an object counterpart to the
-standard Array.isArray() function.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ boolean
+ |
+
+ null
+
+
+
+
Return true if the queried feature (and sub-feature) is available
+or false if the requested feature isn't present or known.
+Return null when a sub-feature was queried for a feature which
+has no sub-features.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isObject(val){boolean}
+
+
+
+
+ luci.js, line 1765
+
+
+
+
+
+
+
+
+
+
+
Tests whether the passed argument is a JavaScript object.
+This function is meant to be an object counterpart to the
+standard Array.isArray() function.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
val
-
+
@@ -1440,283 +2329,254 @@ standard Array.isArray() function.
Construct a relative URL path from the given prefix and parts.
-The resulting URL is guaranteed to only contain the characters
-a-z, A-Z, 0-9, _, ., %, ,, ;, and - as well
-as / for the path separator.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
-
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ boolean
+
+
+
+
Returns true if the given value is of type object and
+not null, else returns false.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ location(){string}
+
+
+
+
+ luci.js, line 1745
+
+
+
+
+
+
+
+
+
+
+
Return the complete URL path to the current view.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ string
+
+
+
+
Returns the URL path to the current view.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ path(prefix, parts){string}
+
+
+
+
+ luci.js, line 1679
+
+
+
+
+
+
+
+
+
+
+
Construct a relative URL path from the given prefix and parts.
+The resulting URL is guaranteed to only contain the characters
+a-z, A-Z, 0-9, _, ., %, ,, ;, and - as well
+as / for the path separator.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
prefix
-
+
@@ -1725,32 +2585,29 @@ as / for the path separator.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
The prefix to join the given parts with. If the prefix is
+
+
+
+ optional
+
+
+
+
+
+
The prefix to join the given parts with. If the prefix is
omitted, it defaults to an empty string.
-
-
-
+
+
+
parts
-
+
@@ -1759,174 +2616,155 @@ omitted, it defaults to an empty string.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
An array of parts to join into an URL path. Parts may contain
+
+
+
+ optional
+
+
+
+
+
+
An array of parts to join into an URL path. Parts may contain
slashes and any of the other characters mentioned above.
Register a polling HTTP request that invokes the specified
+callback function. The function is a wrapper around
+Request.poll.add().
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
interval
-
+
@@ -1935,35 +2773,32 @@ callback function. The function is a wrapper around
-
-
-
-
-
-
-
-
-
-
-
-
The poll interval to use. If set to a value less than or equal
+
+
+
+
+
+
+
+
+
The poll interval to use. If set to a value less than or equal
to 0, it will default to the global poll interval configured
in LuCI.env.pollinterval.
-
-
-
+
+
+
url
-
+
@@ -1972,33 +2807,30 @@ in LuCI.env.pollinterval.
-
-
-
-
-
-
-
-
-
-
-
-
The URL to request.
+
+
+
+
+
+
+
+
+
The URL to request.
-
-
-
+
+
+
args
-
+
@@ -2007,37 +2839,34 @@ in LuCI.env.pollinterval.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
Specifies additional arguments for the request. For GET requests,
+
+
+
+
+ optional
+
+
+
+
+
+
Specifies additional arguments for the request. For GET requests,
the arguments are appended to the URL as query string, for POST
requests, they'll be added to the request body.
-
-
-
+
+
+
cb
-
+
@@ -2046,33 +2875,30 @@ requests, they'll be added to the request body.
-
-
-
-
-
-
-
-
-
-
-
-
The callback function to invoke whenever a request finishes.
+
+
+
+
+
+
+
+
+
The callback function to invoke whenever a request finishes.
-
-
-
+
+
+
post
-
+
@@ -2081,19 +2907,7 @@ requests, they'll be added to the request body.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
@@ -2101,169 +2915,162 @@ requests, they'll be added to the request body.
-
-
When set to false or not specified, poll requests will be made
+
+
+
+
+ optional
+
+
+
+
+
+
When set to false or not specified, poll requests will be made
using the GET method. When set to true, POST requests will be
issued. In case of POST requests, the request body will contain
an argument token with the current value of LuCI.env.token by
default, regardless of the parameters specified with args.
Returns the internally created function that has been passed to
-Request.poll.add(). This value can
-be passed to Poll.remove() to remove the
-polling request.
-
-
-
-
-
-
- Type
-
-
-
-function
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
post(url, argsopt, cb) → {Promise.<null>}
-
-
-
-
Issues a POST request to the given url and invokes the specified
-callback function. The function is a wrapper around
-Request.request(). The request is
-sent using application/x-www-form-urlencoded encoding and will
-contain a field token with the current value of LuCI.env.token
-by default.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ function
+
+
+
+
Returns the internally created function that has been passed to
+Request.poll.add(). This value can
+be passed to Poll.remove() to remove the
+polling request.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ post(url, args, cb){Promise.<null>}
+
+
+
+
+ luci.js, line 1946
+
+
+
+
+
+
+
+
+
+
+
Issues a POST request to the given url and invokes the specified
+callback function. The function is a wrapper around
+Request.request(). The request is
+sent using application/x-www-form-urlencoded encoding and will
+contain a field token with the current value of LuCI.env.token
+by default.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
url
-
+
@@ -2272,29 +3079,26 @@ by default.
-
-
-
-
-
-
-
-
-
-
-
The URL to request.
+
+
+
+
+
+
+
+
The URL to request.
-
-
-
+
+
+
args
-
+
@@ -2303,31 +3107,28 @@ by default.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
Additional post arguments to append to the request body.
+
+
+
+ optional
+
+
+
+
+
+
Additional post arguments to append to the request body.
-
-
-
+
+
+
cb
-
+
@@ -2336,173 +3137,154 @@ by default.
-
-
-
-
-
-
-
-
-
-
-
The callback function to invoke when the request finishes.
+
+
+
+
+
+
+
+
The callback function to invoke when the request finishes.
Returns a promise resolving to null when concluded.
-
-
-
-
-
-
- Type
-
-
-
-Promise.<null>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
raise(typeopt, fmtopt, …argsopt)
-
-
-
-
Captures the current stack trace and throws an error of the
-specified type as a new exception. Also logs the exception as
-error to the debug console if it is available.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Default
-
-
Description
-
+
+
+
+
+ Promise.<null>
+
+
+
+
Returns a promise resolving to null when concluded.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ raise(type, fmt, args)
+
+
+
+
+ luci.js, line 1234
+
+
+
+
+
+
+
+
+
+
+
Captures the current stack trace and throws an error of the
+specified type as a new exception. Also logs the exception as
+error to the debug console if it is available.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
type
-
+
@@ -2514,19 +3296,7 @@ error to the debug console if it is available.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
@@ -2534,18 +3304,27 @@ error to the debug console if it is available.
-
-
Either a string specifying the type of the error to throw or an
+
+
+
+
+ optional
+
+
+
+
+
+
Either a string specifying the type of the error to throw or an
existing Error instance to copy.
-
-
-
+
+
+
fmt
-
+
@@ -2554,19 +3333,7 @@ existing Error instance to copy.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
@@ -2574,18 +3341,27 @@ existing Error instance to copy.
-
-
A format string which is used to form the error message, together
+
+
+
+
+ optional
+
+
+
+
+
+
A format string which is used to form the error message, together
with all subsequent optional arguments.
-
-
-
+
+
+
args
-
+
@@ -2594,94 +3370,68 @@ with all subsequent optional arguments.
-
-
-
- <optional>
-
-
-
-
-
- <repeatable>
-
-
-
-
-
-
Zero or more variable arguments to the supplied format string.
+
+
+
+
+ optional
+
+
+
+
+ repeatable
+
+
+
Zero or more variable arguments to the supplied format string.
@@ -2691,7 +3441,6 @@ appended to the message and the type set to the given type
argument or copied from the given error instance.
-
@@ -2705,74 +3454,75 @@ argument or copied from the given error instance.
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ require(name){Promise.<LuCI#Class>}
+
+
+
+
+ luci.js, line 1379
+
+
+
-
+
+
-
require(name) → {Promise.<LuCI#Class>}
-
-
-
-
-
-
-
Load an additional LuCI JavaScript class and its dependencies,
+
+
Load an additional LuCI JavaScript class and its dependencies,
instantiate it and return the resulting class instance. Each
class is only loaded once. Subsequent attempts to load the same
class will return the already instantiated class.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
name
-
+
@@ -2781,81 +3531,58 @@ class will return the already instantiated class.
-
-
-
-
The name of the class to load in dotted notation. Dots will
+
+
+
+
The name of the class to load in dotted notation. Dots will
be replaced by spaces and joined with the runtime-determined
base URL of LuCI.js to form an absolute URL to load the class
file from.
Return an array of sorted object keys, optionally sorted by
+a different key or a different sorting mode.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
obj
-
+
@@ -3535,30 +4218,27 @@ a different key or a different sorting mode.
-
-
-
-
-
-
-
-
-
-
-
The object to extract the keys from. If the given value is
+
+
+
+
+
+
+
+
The object to extract the keys from. If the given value is
not an object, the function will return an empty array.
-
-
-
+
+
+
key
-
+
@@ -3567,34 +4247,31 @@ not an object, the function will return an empty array.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
Specifies the key to order by. This is mainly useful for
+
+
+
+ optional
+
+
+
+
+
+
Specifies the key to order by. This is mainly useful for
nested objects of objects or objects of arrays when sorting
shall not be performed by the primary object keys but by
some other key pointing to a value within the nested values.
-
-
-
+
+
+
sortmode
-
+
@@ -3603,169 +4280,152 @@ some other key pointing to a value within the nested values.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
May be either addr or num to override the natural
+
+
+
+ optional
+
+
+
+
+
+
May be either addr or num to override the natural
lexicographic sorting with a sorting suitable for IP/MAC style
addresses or numeric values respectively.
Returns true when the function has been removed or false if
-it could not be found.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
toArray(val) → {Array.<*>}
-
-
-
-
Converts the given value to an array. If the given value is of
-type array, it is returned as-is, values of type object are
-returned as one-element array containing the object, empty
-strings and null values are returned as empty array, all other
-values are converted using String(), trimmed, split on white
-space and returned as array.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ boolean
+
+
+
+
Returns true when the function has been removed or false if
+it could not be found.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ toArray(val){Array.<*>}
+
+
+
+
+ luci.js, line 1839
+
+
+
+
+
+
+
+
+
+
+
Converts the given value to an array. If the given value is of
+type array, it is returned as-is, values of type object are
+returned as one-element array containing the object, empty
+strings and null values are returned as empty array, all other
+values are converted using String(), trimmed, split on white
+space and returned as array.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
val
-
+
@@ -3941,163 +4587,147 @@ space and returned as array.
The request callback function is invoked whenever an HTTP
-reply to a request made using the L.get(), L.post() or
-L.poll() function is timed out or received successfully.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
-
-
Description
-
+
+
+
+
+ string
+
+
+
+
Returns the resulting URL path.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Type Definitions
+
+
+
+
+
+
+
+ LuCI.requestCallbackFn(xhr, data, duration)
+
+
+
+
+ luci.js, line 1877
+
+
+
+
+
+
+
+
+
+
+
The request callback function is invoked whenever an HTTP
+reply to a request made using the L.get(), L.post() or
+L.poll() function is timed out or received successfully.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
xhr
-
+
@@ -4284,21 +4897,21 @@ reply to a request made using the L.get(), L.post() or
-
-
-
-
The XMLHTTPRequest instance used to make the request.
+
+
+
+
The XMLHTTPRequest instance used to make the request.
-
-
-
+
+
+
data
-
+
@@ -4307,22 +4920,22 @@ reply to a request made using the L.get(), L.post() or
-
-
-
-
The response JSON if the response could be parsed as such,
+
+
+
+
The response JSON if the response could be parsed as such,
else null.
-
-
-
+
+
+
duration
-
+
@@ -4331,106 +4944,80 @@ else null.
-
-
-
-
The total duration of the request in milliseconds.
+
+
+
+
The total duration of the request in milliseconds.
Lists available remote ubus objects or the method signatures of
+
+
Lists available remote ubus objects or the method signatures of
specific objects.
This function has two signatures and is sensitive to the number of
arguments passed to it:
@@ -861,46 +1843,39 @@ Returns an array containing the names of all remote ubus objectslist("objname", ...)
Returns method signatures for each given ubus object name.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
objectNames
-
+
@@ -909,173 +1884,156 @@ Returns method signatures for each given ubus object name.
-
-
-
- <optional>
-
-
-
-
-
- <repeatable>
-
-
-
-
-
If any object names are given, this function will return the method
+
+
+
+ optional
+
+
+
+
+ repeatable
+
+
+
If any object names are given, this function will return the method
signatures of each given object.
When invoked without arguments, this function will return a promise
-resolving to an array of ubus object names. When invoked with one or
-more arguments, a promise resolving to an object describing the method
-signatures of each requested ubus object name will be returned.
When invoked without arguments, this function will return a promise
+resolving to an array of ubus object names. When invoked with one or
+more arguments, a promise resolving to an object describing the method
+signatures of each requested ubus object name will be returned.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ removeInterceptor(interceptorFn){boolean}
+
+
+
+
+ rpc.js, line 470
+
+
+
+
+
+
+
+
+
+
+
Removes a registered interceptor function.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
interceptorFn
-
+
@@ -1084,158 +2042,144 @@ signatures of each requested ubus object name will be returned.
Lists the named parameters expected by the remote ubus RPC method.
The arguments passed to the resulting generated method call function
will be mapped to named parameters in the order they appear in this
@@ -1617,14 +2509,14 @@ argument to the remote procedure and the filter function will be
invoked with filterFn(reply, [ "foo" ], "bar", "baz")
Describes the expected return data structure. The given object is
supposed to contain a single key selecting the value to use from
the returned ubus reply object. The value of the sole key within
@@ -1677,14 +2569,14 @@ a key success with a boolean value. If the reply does not contain
be returned as default instead.
-
-
-
+
+
+
filter
-
+
@@ -1693,131 +2585,111 @@ be returned as default instead.
-
+
<optional>
-
+
-
-
+
+
Specfies an optional filter function which is invoked to transform the
received reply data before it is returned to the caller.
The filter function is invoked to transform a received ubus RPC call
+
+
The filter function is invoked to transform a received ubus RPC call
reply before returning it to the caller.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
data
-
+
@@ -1826,31 +2698,28 @@ reply before returning it to the caller.
-
-
-
-
-
-
-
-
-
-
-
The received ubus reply data or a subset of it as described in the
+
+
+
+
+
+
+
+
The received ubus reply data or a subset of it as described in the
expect option of the RPC call declaration. In case of remote call
errors, data is numeric ubus error code instead.
-
-
-
+
+
+
args
-
+
@@ -1859,29 +2728,26 @@ errors, data is numeric ubus error code instead.
-
-
-
-
-
-
-
-
-
-
-
The arguments the RPC method has been invoked with.
+
+
+
+
+
+
+
+
The arguments the RPC method has been invoked with.
-
-
-
+
+
+
extraArgs
-
+
@@ -1890,131 +2756,119 @@ errors, data is numeric ubus error code instead.
-
-
-
-
-
-
-
- <repeatable>
-
-
-
-
-
All extraneous arguments passed to the RPC method exceeding the number
+
+
+
+
+
+
+ repeatable
+
+
+
All extraneous arguments passed to the RPC method exceeding the number
of arguments describes in the RPC call declaration.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ *
+
+
+
+
The return value of the filter function will be returned to the caller
+of the RPC method as-is.
The return value of the filter function will be returned to the caller
-of the RPC method as-is.
-
-
-
-
-
-
- Type
-
-
-
-*
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ interceptorFn(msg, req){Promise.<*>|*}
+
+
+
+
+ rpc.js, line 408
+
+
+
-
+
+
-
interceptorFn(msg, req) → {Promise.<*>|*}
-
-
-
-
-
-
-
Registered interceptor functions are invoked before the standard reply
+
+
Registered interceptor functions are invoked before the standard reply
parsing and handling logic.
By returning rejected promises, interceptor functions can cause the
invocation function to fail, regardless of the received reply.
@@ -2023,44 +2877,39 @@ rewrite received replies before they're processed by the standard
response handling code.
A common use case for such functions is to detect failing RPC replies
due to expired authentication in order to trigger a new login.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
msg
-
+
@@ -2069,24 +2918,24 @@ due to expired authentication in order to trigger a new login.
-
-
-
-
The unprocessed, JSON decoded remote RPC method call reply.
+
+
+
+
The unprocessed, JSON decoded remote RPC method call reply.
Since interceptors run before the standard parsing logic, the reply
data is not verified for correctness or filtered according to
expect and filter specifications in the declarations.
-
-
-
+
+
+
req
-
+
@@ -2095,173 +2944,157 @@ data is not verified for correctness or filtered according to
-
-
-
-
The related request object which is an extended variant of the
+
+
+
+
The related request object which is an extended variant of the
declaration object, allowing access to internals of the invocation
function such as filter, expect or params values.
Interceptor functions may return a promise to defer response
-processing until some delayed work completed. Any values the returned
-promise resolves to are ignored.
-
When the returned promise rejects with an error, the invocation
-function will fail too, forwarding the error to the caller.
-
-
-
-
-
-
- Type
-
-
-
-Promise.<*>
-|
-
-*
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
invokeFn(…params) → {Promise.<*>}
-
-
-
-
The generated invocation function is returned by
-rpc.declare() and encapsulates a single
-RPC method call.
-
Calling this function will execute a remote ubus HTTP call request
-using the arguments passed to it as arguments and return a promise
-resolving to the received reply values.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ Promise.<*>
+ |
+
+ *
+
+
+
+
Interceptor functions may return a promise to defer response
+processing until some delayed work completed. Any values the returned
+promise resolves to are ignored.
+When the returned promise rejects with an error, the invocation
+function will fail too, forwarding the error to the caller.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ invokeFn(params){Promise.<*>}
+
+
+
+
+ rpc.js, line 254
+
+
+
+
+
+
+
+
+
+
+
The generated invocation function is returned by
+rpc.declare() and encapsulates a single
+RPC method call.
+
Calling this function will execute a remote ubus HTTP call request
+using the arguments passed to it as arguments and return a promise
+resolving to the received reply values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
params
-
+
@@ -2270,145 +3103,123 @@ resolving to the received reply values.
-
-
-
-
-
-
-
- <repeatable>
-
-
-
-
-
The parameters to pass to the remote procedure call. The given
+
+
+
+
+
+
+ repeatable
+
+
+
The parameters to pass to the remote procedure call. The given
positional arguments will be named to named RPC parameters according
to the names specified in the params array of the method declaration.
Any additional parameters exceeding the amount of arguments in the
params declaration are passed as private extra arguments to the
declared filter function.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Promise.<*>
+
+
+
+
Returns a promise resolving to the result data of the remote ubus
+RPC method invocation, optionally substituted and filtered according
+to the expect and filter declarations.
Returns a promise resolving to the result data of the remote ubus
-RPC method invocation, optionally substituted and filtered according
-to the expect and filter declarations.
The LuCI.uci class utilizes LuCI.rpc to declare low level
remote UCI ubus procedures and implements a local caching and data
manipulation layer on top to allow for synchroneous operations on
UCI configuration data.
Returns the section ID of the newly added section which is equivalent
-to the given name for non-anonymous sections.
-
-
-
-
-
-
- Type
-
-
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
apply(timeoutopt) → {Promise.<number>}
-
-
-
-
Instructs the remote ubus UCI api to commit all saved changes with
-rollback protection and attempts to confirm the pending commit
-operation to cancel the rollback timer.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Default
-
-
Description
-
+
+
+
+
+ string
+
+
+
+
Returns the section ID of the newly added section which is equivalent
+to the given name for non-anonymous sections.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ apply(timeout){Promise.<number>}
+
+
+
+
+ uci.js, line 858
+
+
+
+
+
+
+
+
+
+
+
Instructs the remote ubus UCI api to commit all saved changes with
+rollback protection and attempts to confirm the pending commit
+operation to cancel the rollback timer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
timeout
-
+
@@ -440,19 +1452,7 @@ operation to cancel the rollback timer.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
@@ -460,267 +1460,252 @@ operation to cancel the rollback timer.
-
-
Override the confirmation timeout after which a rollback is triggered.
+
+
+
+
+ optional
+
+
+
+
+
+
Override the confirmation timeout after which a rollback is triggered.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Promise.<number>
+
+
+
+
Returns a promise resolving/rejecting with the ubus RPC status code.
Returns a promise resolving to an object containing the configuration
+names as keys and arrays of related change records as values.
+
+
+
+
+
+
+
+
+
+
+
+
+ createSID(config){string}
+
+
+
+
+ uci.js, line 88
+
+
+
-
+
+
-
createSID(config) → {string}
-
-
-
-
-
-
-
Generates a new, unique section ID for the given configuration.
+
+
Generates a new, unique section ID for the given configuration.
Note that the generated ID is temporary, it will get replaced by an
identifier in the form cfgXXXXXX once the configuration is saved
by the remote ubus UCI api.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
config
-
+
@@ -729,162 +1714,146 @@ by the remote ubus UCI api.
-
-
-
-
The configuration to generate the new section ID for.
+
+
+
+
The configuration to generate the new section ID for.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ string
+
+
+
+
A newly generated, unique section ID in the form newXXXXXX
+where X denotes a hexadecimal digit.
Gets the value of the given option or the entire section object of
-the first found section of the specified type or the first found
-section of the entire configuration if no type is specfied.
The name of the configuration to read the value from.
-
-
-
-
-
-
-
type
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
The type of the first section to find. If it is null, the first
-section of the entire config is read, otherwise the first section
-matching the given type.
-
-
-
-
-
-
-
option
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
The option name to read the value from. If the option name is
-omitted or null, the entire section is returned instead.
Gets the value of the given option or the entire section object of
+the first found section of the specified type or the first found
+section of the entire configuration if no type is specfied.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
config
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The name of the configuration to read the value from.
+
+
+
+
+
+
+
type
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
+ optional
+
+
+
+
+
+
The type of the first section to find. If it is null, the first
+section of the entire config is read, otherwise the first section
+matching the given type.
+
+
+
+
+
+
+
option
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
+ optional
+
+
+
+
+
+
The option name to read the value from. If the option name is
+omitted or null, the entire section is returned instead.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
load(config) → {Promise.<Array.<string>>}
+
+
+
+
+
+
Returns:
+
-
-
Loads the given UCI configurations from the remote ubus api.
Returns a promise resolving to the names of the configurations
-that have been successfully loaded.
-
-
-
-
-
-
- Type
-
-
-
-Promise.<Array.<string>>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
move(config, sid1, sid2opt, afteropt) → {boolean}
-
-
-
-
Move the first specified section within the given configuration
-before or after the second specified section.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
Returns:
+
+
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Default
-
-
Description
-
+
+
+
+
+ Promise.<Array.<string>>
+
+
+
+
Returns a promise resolving to the names of the configurations
+that have been successfully loaded.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ move(config, sid1, sid2, after){boolean}
+
+
+
+
+ uci.js, line 718
+
+
+
+
+
+
+
+
+
+
+
Move the first specified section within the given configuration
+before or after the second specified section.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
config
-
+
@@ -1575,33 +2480,30 @@ before or after the second specified section.
-
-
-
-
-
-
-
-
-
-
-
-
The configuration to move the section within.
+
+
+
+
+
+
+
+
+
The configuration to move the section within.
-
-
-
+
+
+
sid1
-
+
@@ -1610,33 +2512,30 @@ before or after the second specified section.
-
-
-
-
-
-
-
-
-
-
-
-
The ID of the section to move within the configuration.
+
+
+
+
+
+
+
+
+
The ID of the section to move within the configuration.
-
-
-
+
+
+
sid2
-
+
@@ -1645,26 +2544,23 @@ before or after the second specified section.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
The ID of the target section for the move operation. If the
+
+
+
+
+ optional
+
+
+
+
+
+
The ID of the target section for the move operation. If the
after argument is false or not specified, the section named by
sid1 will be moved before this target section, if the after
argument is true, the sid1 section will be moved after this
@@ -1672,14 +2568,14 @@ section.
When the sid2 argument is null, the section specified by sid1
is moved to the end of the configuration.
-
-
-
+
+
+
after
-
+
@@ -1688,19 +2584,7 @@ is moved to the end of the configuration.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
@@ -1708,318 +2592,292 @@ is moved to the end of the configuration.
-
-
When true, the section sid1 is moved after the section sid2,
+
+
+
+
+ optional
+
+
+
+
+
+
When true, the section sid1 is moved after the section sid2,
when false, the section sid1 is moved before sid2.
If sid2 is null, then this parameter has no effect and the section
sid1 is moved to the end of the configuration instead.
Removes the section with the given ID from the given configuration.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
config
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
The name of the configuration to remove the section from.
+
+
+
+
+
+
+
sid
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
The ID of the section to remove.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
resolveSID(config, sid) → {string|null}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ resolveSID(config, sid){string|null}
+
+
+
+
+ uci.js, line 119
+
+
+
-
-
Resolves a given section ID in extended notation to the internal
+
+
+
+
+
+
+
Resolves a given section ID in extended notation to the internal
section ID value.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
config
-
+
@@ -2028,21 +2886,21 @@ section ID value.
-
-
-
-
The configuration to resolve the section ID for.
+
+
+
+
The configuration to resolve the section ID for.
-
-
-
+
+
+
sid
-
+
@@ -2051,283 +2909,257 @@ section ID value.
-
-
-
-
The section ID to resolve. If the ID is in the form @typename[#],
+
+
+
+
The section ID to resolve. If the ID is in the form @typename[#],
it will get resolved to an internal anonymous ID in the forms
cfgXXXXXX/newXXXXXX or to the name of a section in case it points
to a named section. When the given ID is not in extended notation,
it will be returned as-is.
Returns the resolved section ID or the original given ID if it was
-not in extended notation. Returns null when an extended ID could
-not be resolved to existing section ID.
-
-
-
-
-
-
- Type
-
-
-
-string
-|
-
-null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
save() → {Array.<string>}
-
-
-
-
-
-
-
-
Submits all local configuration changes to the remove ubus api,
-adds, removes and reorders remote sections as needed and reloads
-all loaded configurations to resynchronize the local state with
-the remote configuration values.
Enumerates the sections of the given configuration, optionally
-filtered by type.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
-
-
Name
-
-
Type
-
-
-
Attributes
-
-
-
-
Description
-
+
+
+
+
+ string
+ |
+
+ null
+
+
+
+
Returns the resolved section ID or the original given ID if it was
+not in extended notation. Returns null when an extended ID could
+not be resolved to existing section ID.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ save(){Array.<string>}
+
+
+
+
+ uci.js, line 772
+
+
+
+
+
+
+
+
+
+
+
Submits all local configuration changes to the remove ubus api,
+adds, removes and reorders remote sections as needed and reloads
+all loaded configurations to resynchronize the local state with
+the remote configuration values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Array.<string>
+
+
+
+
Returns a promise resolving to an array of configuration names which
+have been reloaded by the save operation.
Returns a sorted array of the section objects within the given
+configuration, filtered by type of a type has been specified.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ set(config, sid, option, value)
+
+
+
+
+ uci.js, line 516
+
+
+
+
+
+
+
+
+
+
+
Sets the value of the given option within the specified section
+of the given configuration.
+
If either config, section or option is null, or if option begins
+with a dot, the function will do nothing.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
config
-
+
@@ -2574,21 +3383,21 @@ with a dot, the function will do nothing.
-
-
-
-
The name of the configuration to set the option value in.
+
+
+
+
The name of the configuration to set the option value in.
-
-
-
+
+
+
sid
-
+
@@ -2597,21 +3406,21 @@ with a dot, the function will do nothing.
-
-
-
-
The name or ID of the section to set the option value in.
+
+
+
+
The name or ID of the section to set the option value in.
-
-
-
+
+
+
option
-
+
@@ -2620,21 +3429,21 @@ with a dot, the function will do nothing.
-
-
-
-
The option name to set the value for.
+
+
+
+
The option name to set the value for.
-
-
-
+
+
+
value
-
+
@@ -2649,143 +3458,120 @@ with a dot, the function will do nothing.
-
-
-
-
The option value to set. If the value is null or an empty string,
+
+
+
+
The option value to set. If the value is null or an empty string,
the option will be removed, otherwise it will be set or overwritten
with the given value.
Sets the value of the given option within the first found section
+
+
Sets the value of the given option within the first found section
of the given configuration matching the specified type or within
the first section of the entire config when no type has is specified.
If either config, type or option is null, or if option begins
with a dot, the function will do nothing.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
config
-
+
@@ -2794,29 +3580,26 @@ with a dot, the function will do nothing.
-
-
-
-
-
-
-
-
-
-
-
The name of the configuration to set the option value in.
+
+
+
+
+
+
+
+
The name of the configuration to set the option value in.
-
-
-
+
+
+
type
-
+
@@ -2825,33 +3608,30 @@ with a dot, the function will do nothing.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
The type of the first section to find. If it is null, the first
+
+
+
+ optional
+
+
+
+
+
+
The type of the first section to find. If it is null, the first
section of the entire config is written to, otherwise the first
section matching the given type is used.
-
-
-
+
+
+
option
-
+
@@ -2860,29 +3640,26 @@ section matching the given type is used.
-
-
-
-
-
-
-
-
-
-
-
The option name to set the value for.
+
+
+
+
+
+
+
+
The option name to set the value for.
-
-
-
+
+
+
value
-
+
@@ -2897,145 +3674,121 @@ section matching the given type is used.
-
-
-
-
-
-
-
-
-
-
-
The option value to set. If the value is null or an empty string,
+
+
+
+
+
+
+
+
The option value to set. If the value is null or an empty string,
the option will be removed, otherwise it will be set or overwritten
with the given value.
Removes the given option within the first found section of the given
+
+
Removes the given option within the first found section of the given
configuration matching the specified type or within the first section
of the entire config when no type has is specified.
This function is a convenience wrapper around
uci.set_first(config, type, option, null).
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
Attributes
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
config
-
+
@@ -3377,29 +4086,26 @@ of the entire config when no type has is specified.
-
-
-
-
-
-
-
-
-
-
-
The name of the configuration to set the option value in.
+
+
+
+
+
+
+
+
The name of the configuration to set the option value in.
-
-
-
+
+
+
type
-
+
@@ -3408,33 +4114,30 @@ of the entire config when no type has is specified.
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
The type of the first section to find. If it is null, the first
+
+
+
+ optional
+
+
+
+
+
+
The type of the first section to find. If it is null, the first
section of the entire config is written to, otherwise the first
section matching the given type is used.
-
-
-
+
+
+
option
-
+
@@ -3443,155 +4146,121 @@ section matching the given type is used.
An UCI change record is a plain array containing the change operation
+
+
+
LuCI.uci.ChangeRecordArray.<string>
+
+
+
+
+
+
+
+
An UCI change record is a plain array containing the change operation
name as first element, the affected section ID as second argument
and an optional third and fourth argument whose meanings depend on
the operation.
-
-
-
-
-
Type:
-
-
-
-Array.<string>
-
-
-
-
-
-
-
-
-
-
Properties:
-
+
+
+
+
+
+
+
Properties:
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
0
-
+
@@ -3600,22 +4269,22 @@ the operation.
-
-
-
+
+
+
The operation name - may be one of add, set, remove, order,
list-add, list-del or rename.
-
-
-
+
+
+
1
-
+
@@ -3624,21 +4293,21 @@ the operation.
-
-
-
+
+
+
The section ID targeted by the operation.
-
-
-
+
+
+
2
-
+
@@ -3647,11 +4316,11 @@ the operation.
-
-
-
+
+
+
The meaning of the third element depends on the operation.
For add it is type of the section that has been added
@@ -3671,14 +4340,14 @@ a section has been renamed to if the change entry only contains
three elements.
-
-
-
+
+
+
4
-
+
@@ -3687,11 +4356,11 @@ three elements.
-
-
-
+
+
+
The meaning of the fourth element depends on the operation.
For set it is the value an option has been set to.
A section object represents the options and their corresponding values
enclosed within a configuration section, as well as some additional
meta data such as sort indexes and internal ID.
Any internal metadata fields are prefixed with a dot which is isn't
an allowed character for normal option names.
@@ -3822,22 +4463,22 @@ an allowed character for normal option names.
-
-
-
+
+
+
The .anonymous property specifies whether the configuration is
anonymous (true) or named (false).
-
-
-
+
+
+
.index
-
+
@@ -3846,21 +4487,21 @@ anonymous (true) or named (false).
-
-
-
+
+
+
The .index property specifes the sort order of the section.
-
-
-
+
+
+
.name
-
+
@@ -3869,23 +4510,23 @@ anonymous (true) or named (false).
-
-
-
+
+
+
The .name property holds the name of the section object. It may be
either an anonymous ID in the form cfgXXXXXX or newXXXXXX with X
being a hexadecimal digit or a string holding the name of the section.
-
-
-
+
+
+
.type
-
+
@@ -3894,22 +4535,22 @@ being a hexadecimal digit or a string holding the name of the section.
-
-
-
+
+
+
The .type property contains the type of the corresponding uci
section.
-
-
-
+
+
+
*
-
+
@@ -3921,125 +4562,107 @@ section.
-
-
-
+
+
+
A section object may contain an arbitrary number of further properties
representing the uci option enclosed in the section.
All option property names will be in the form [A-Za-z0-9_]+ and
either contain a string value or an array of strings, in case the
underlying option is an UCI list.
The sections callback is invoked for each section found within
+
+
The sections callback is invoked for each section found within
the given configuration and receives the section object and its
associated name as arguments.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
section
-
+
@@ -4048,21 +4671,21 @@ associated name as arguments.
-
-
-
-
The section object.
+
+
+
+
The section object.
-
-
-
+
+
+
sid
-
+
@@ -4071,106 +4694,80 @@ associated name as arguments.
Returns a DocumentFragment containing the footer bar
+
Type
+
Description
+
+
+
+
+
+
+
+
+ DocumentFragment
+
+
+
+
Returns a DocumentFragment containing the footer bar
with buttons for each corresponding handle*() action
or an empty DocumentFragment if all three handle*()
-methods are overwritten with null.
-
-
-
-
-
-
- Type
-
-
-
-DocumentFragment
-
-
-
-
+methods are overwritten with null.
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+ handleReset(ev){*|Promise.<*>}
+
+
+
+
+ luci.js, line 2871
+
+
+
-
+
+
-
handleReset(ev) → {*|Promise.<*>}
-
-
-
-
-
-
-
The handleReset function is invoked when the user clicks
+
+
The handleReset function is invoked when the user clicks
the Reset button in the page action footer.
The default implementation should be sufficient for most
views using form.Map() based forms - it
@@ -286,44 +1320,39 @@ this base class should overwrite the handleReset function
with null.
The invocation of this function is wrapped by
Promise.resolve() so it may return Promises if needed.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
ev
-
+
@@ -332,125 +1361,116 @@ with null.
-
-
-
-
The DOM event that triggered the function.
+
+
+
+
The DOM event that triggered the function.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ *
+ |
+
+ Promise.<*>
+
+
+
+
Any return values of this function are discarded, but
+passed through Promise.resolve() to ensure that any
+returned promise runs to completion before the button
+is reenabled.
Any return values of this function are discarded, but
-passed through Promise.resolve() to ensure that any
-returned promise runs to completion before the button
-is reenabled.
-
-
-
-
-
-
- Type
-
-
-
-*
-|
-
-Promise.<*>
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ handleSave(ev){*|Promise.<*>}
+
+
+
+
+ luci.js, line 2790
+
+
+
-
+
+
-
handleSave(ev) → {*|Promise.<*>}
-
-
-
-
-
-
-
The handleSave function is invoked when the user clicks
+
+
The handleSave function is invoked when the user clicks
the Save button in the page action footer.
The default implementation should be sufficient for most
views using form.Map() based forms - it
@@ -464,44 +1484,39 @@ this base class should overwrite the handleSave function
with null.
The invocation of this function is wrapped by
Promise.resolve() so it may return Promises if needed.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
ev
-
+
@@ -510,125 +1525,116 @@ with null.
-
-
-
-
The DOM event that triggered the function.
+
+
+
+
The DOM event that triggered the function.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ *
+ |
+
+ Promise.<*>
+
+
+
+
Any return values of this function are discarded, but
+passed through Promise.resolve() to ensure that any
+returned promise runs to completion before the button
+is reenabled.
Any return values of this function are discarded, but
-passed through Promise.resolve() to ensure that any
-returned promise runs to completion before the button
-is reenabled.
-
-
-
-
-
-
- Type
-
-
-
-*
-|
-
-Promise.<*>
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ handleSaveApply(ev){*|Promise.<*>}
+
+
+
+
+ luci.js, line 2834
+
+
+
-
+
+
-
handleSaveApply(ev) → {*|Promise.<*>}
-
-
-
-
-
-
-
The handleSaveApply function is invoked when the user clicks
+
+
The handleSaveApply function is invoked when the user clicks
the Save & Apply button in the page action footer.
The default implementation should be sufficient for most
views using form.Map() based forms - it
@@ -644,44 +1650,39 @@ extending this base class should overwrite the
handleSaveApply function with null.
The invocation of this function is wrapped by
Promise.resolve() so it may return Promises if needed.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
ev
-
+
@@ -690,125 +1691,116 @@ extending this base class should overwrite the
-
-
-
-
The DOM event that triggered the function.
+
+
+
+
The DOM event that triggered the function.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ *
+ |
+
+ Promise.<*>
+
+
+
+
Any return values of this function are discarded, but
+passed through Promise.resolve() to ensure that any
+returned promise runs to completion before the button
+is reenabled.
Any return values of this function are discarded, but
-passed through Promise.resolve() to ensure that any
-returned promise runs to completion before the button
-is reenabled.
-
-
-
-
-
-
- Type
-
-
-
-*
-|
-
-Promise.<*>
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ abstractload(){*|Promise.<*>}
+
+
+
+
+ luci.js, line 2725
+
+
+
-
+
+
-
(abstract) load() → {*|Promise.<*>}
-
-
-
-
-
-
-
The load function is invoked before the view is rendered.
+
+
The load function is invoked before the view is rendered.
The invocation of this function is wrapped by
Promise.resolve() so it may return Promises if needed.
The return value of the function (or the resolved values
@@ -816,119 +1808,109 @@ of the promise returned by it) will be passed as first
argument to render().
This function is supposed to be overwritten by subclasses,
the default implementation does nothing.
The render function is invoked after the
load() function and responsible
for setting up the view contents. It must return a DOM
Node or DocumentFragment holding the contents to
@@ -941,44 +1923,39 @@ main content area using
dom.append().
This function is supposed to be overwritten by subclasses,
the default implementation does nothing.
-
-
-
-
-
-
-
-
-
-
-
Parameters:
+
+
+
+
+
+
+
+
-
-
-
Name
-
-
-
Type
-
-
-
-
-
-
Description
-
-
-
-
-
-
+
+
+
Name
+
+
+
Type
+
+
+
+
Description
+
+
+
+
+
+
load_results
-
+
@@ -990,136 +1967,117 @@ the default implementation does nothing.
-
-
-
-
This function will receive the return value of the
+
+
+
+
This function will receive the return value of the
view.load() function as first
argument.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
+
+
+
Type
+
Description
+
+
+
+
+
+
+
+
+ Node
+ |
+
+ Promise.<Node>
+
+
+
+
Should return a DOM Node value or a Promise resolving
+to a Node value.