From 355a48866d1a43df9443a3b559c8ec8642343f3a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 5 Nov 2019 10:18:51 +0100 Subject: [PATCH] documentation: change JS docs template Use another template for the JS api documentation which provides a better overview over the classes and methods. Signed-off-by: Jo-Philipp Wich --- documentation/jsapi/LuCI.Class.html | 2609 ++++-- documentation/jsapi/LuCI.Headers.html | 1608 +++- documentation/jsapi/LuCI.Network.Device.html | 4286 +++++---- documentation/jsapi/LuCI.Network.Hosts.html | 2831 ++++-- .../jsapi/LuCI.Network.Protocol.html | 7131 ++++++++------- .../jsapi/LuCI.Network.WifiDevice.html | 3446 +++++--- .../jsapi/LuCI.Network.WifiNetwork.html | 6521 +++++++------- documentation/jsapi/LuCI.Network.html | 7667 +++++++++-------- documentation/jsapi/LuCI.Poll.html | 2062 +++-- documentation/jsapi/LuCI.Request.html | 2958 ++++--- documentation/jsapi/LuCI.Request.poll.html | 2182 +++-- documentation/jsapi/LuCI.Response.html | 2141 +++-- documentation/jsapi/LuCI.XHR.html | 2247 +++-- documentation/jsapi/LuCI.dom.html | 4459 ++++++---- documentation/jsapi/LuCI.fs.html | 3344 ++++--- documentation/jsapi/LuCI.html | 5791 +++++++------ documentation/jsapi/LuCI.rpc.html | 3663 +++++--- documentation/jsapi/LuCI.uci.html | 5429 ++++++------ documentation/jsapi/LuCI.view.html | 2288 +++-- documentation/jsapi/index.html | 1105 ++- .../jsapi/styles/prettify-tomorrow.css | 2 +- package.json | 5 +- 22 files changed, 45093 insertions(+), 28682 deletions(-) diff --git a/documentation/jsapi/LuCI.Class.html b/documentation/jsapi/LuCI.Class.html index 7b5c3a8f7..28916f113 100644 --- a/documentation/jsapi/LuCI.Class.html +++ b/documentation/jsapi/LuCI.Class.html @@ -1,195 +1,1234 @@ - + - JSDoc: Class: Class - - - + Class: Class + + + + + - - + + + + + + + + - -
- -

Class: Class

- +
+ +
+

Class: Class

+
- +
+

+ LuCI. -

- LuCI.Class

- -

LuCI.Class is the abstract base class all LuCI classes inherit from.

+ Class + + +

LuCI.Class is the abstract base class all LuCI classes inherit from.

It provides simple means to create subclasses of given classes and implements prototypal inheritance.

- -
- -
-
- - - - - - - - - - - - - - + +
+
+ + + + +
+
+

+ + new LuCI.Class() +

+ + +
+ luci.js, line 59 +
+ +
+ +
+
+ + + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + - - - - - - - - - - - - - - - - + + + + + + + +
- - - - - - - - + + + + + +

Methods

- +
- +
+
+

+ + staticLuCI.Class.extend(properties){LuCI.Class} +

+ +
+ luci.js, line 87 +
+ +
-

(static) extend(properties) → {LuCI.Class}

+
+
- - - - -
-

Extends this base class with the properties described in +

+

Extends this base class with the properties described in properties and returns a new subclassed Class instance

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
NameTypeDescription
properties @@ -198,164 +1237,148 @@ implements prototypal inheritance.

An object describing the properties to add to the new + +

+ +

An object describing the properties to add to the new subclass.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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.

-
- - - -
-
- Type -
-
- -LuCI.Class - - -
+ +
- - - - - - - + -

(static) instantiate(params, …new_argsopt) → {LuCI.Class}

- - - - -
-

Calls the class constructor using new with the given argument -array being passed as variadic parameters to the constructor.

-
- - - - - - - - - -
Parameters:
+ + +
Returns:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + LuCI.Class + + + 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.
+ + + + +
- Attributes + +
+
+

+ + staticLuCI.Class.instantiate(params, new_args){LuCI.Class} +

+ - +
+ luci.js, line 169 +
+
- Description - - + +
+
+ + +
+

Calls the class constructor using new with the given argument +array being passed as variadic parameters to the constructor.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
NameTypeDescription
params @@ -364,30 +1387,27 @@ array being passed as variadic parameters to the constructor.

- - - - - -

An array of arbitrary values which will be passed as arguments +

+ + + + + + +

An array of arbitrary values which will be passed as arguments to the constructor function.

new_args @@ -396,172 +1416,155 @@ to the constructor function.

- - <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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns a new LuCI.Class instance extended by the given -properties with its prototype set to this base class to -enable inheritance.

-
- - - -
-
- Type -
-
- -LuCI.Class - - -
+ +
- - - - - - - + -

(static) isSubclass(classValue) → {boolean}

- - - - -
-

Checks whether the given class value is a subclass of this class.

-
- - - - - - - - - -
Parameters:
+ +
Returns:
+ + - - - + + + + + + + + + + + + +
NameTypeDescription
+ + LuCI.Class + + + Returns a new LuCI.Class instance extended by the given +properties with its prototype set to this base class to +enable inheritance.
- + + + +
+ +
+
+

+ + staticLuCI.Class.isSubclass(classValue){boolean} +

+ + +
+ luci.js, line 195 +
+ +
- Description - - + +
+
+ + +
+

Checks whether the given class value is a subclass of this class.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
classValue @@ -570,167 +1573,151 @@ enable inheritance.

The class object to test.

+ +

The class object to test.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns true when the given classValue is a subclass of this +

+ + + + + + + + + + + +
TypeDescription
+ + 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'.

- - - - -
-
- Type -
-
- -boolean - - -
-
- +a subclass of this class'.
- - - + + + +
- +
+
+

+ + staticLuCI.Class.singleton(properties, new_args){LuCI.Class} +

+ +
+ luci.js, line 145 +
+ +
-

(static) singleton(properties, …new_argsopt) → {LuCI.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:
+ + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
NameTypeAttributesDescription
NameTypeDescription
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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a new LuCI.Class instance extended by the given +

+ + + + + + + + + + + +
TypeDescription
+ + LuCI.Class + + + Returns a new LuCI.Class instance extended by the given properties with its prototype set to this base class to -enable inheritance.

- - - - -
-
- Type -
-
- -LuCI.Class - - -
-
- +enable inheritance.
- - - + + + +
- +
+
+

+ + super(key, callArgs){*|null} +

+ +
+ luci.js, line 267 +
+ +
-

super(key, callArgsopt) → {*|null}

+
+
- - - - -
-

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:
+ + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
NameTypeAttributesDescription
NameTypeDescription
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.

- - - - - - + + +
- - + + - - - - - - - - - + + + + + + +
-
Source:
-
- -
- - - - - - - - - - - - - -
Throws:
- - + +
Throws:
+ +
@@ -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:
- + + + -
-

Returns the value of the found member or the return value of +

+ + + + + + + + + + + +
TypeDescription
+ + * + | + + 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.

- - - - -
-
- Type -
-
- -* -| - -null - - -
-
- +superclass method returned null.
- - - + + + + - +
+
+

+ + varargs(args, offset, extra_args){Array.<*>} +

+ +
+ luci.js, line 225 +
+ +
-

varargs(args, offset, …extra_argsopt) → {Array.<*>}

+
+
- - - - -
-

Extract all values from the given argument array beginning from +

+

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:
+ + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + + - + - - - - - + - - - + + +
NameTypeAttributesDescription
NameTypeDescription
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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a new array consisting of the optional extra arguments +

+ + + + + + + + + + + +
TypeDescription
+ + Array.<*> + + + Returns a new array consisting of the optional extra arguments and the values extracted from the args array beginning with -offset.

- - - - -
-
- Type -
-
- -Array.<*> - - -
-
- +offset.
- - - - - + + +
+ + + + +
-
- - + -
- -
-
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
+ - - +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+
+
+ + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Headers.html b/documentation/jsapi/LuCI.Headers.html index a63017bcf..efb898bbf 100644 --- a/documentation/jsapi/LuCI.Headers.html +++ b/documentation/jsapi/LuCI.Headers.html @@ -1,194 +1,1233 @@ - + - JSDoc: Class: Headers - - - + Class: Headers + + + + + - - + + + + + + + + +
+ + +
+ + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Network.Device.html b/documentation/jsapi/LuCI.Network.Device.html index 0236f8c50..71d88df22 100644 --- a/documentation/jsapi/LuCI.Network.Device.html +++ b/documentation/jsapi/LuCI.Network.Device.html @@ -1,2010 +1,2888 @@ - + - JSDoc: Class: Device - - - + Class: Device + + + + + - - + + + + + + + + +
+ + +
+ + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Network.Hosts.html b/documentation/jsapi/LuCI.Network.Hosts.html index f98641bb7..fc392d880 100644 --- a/documentation/jsapi/LuCI.Network.Hosts.html +++ b/documentation/jsapi/LuCI.Network.Hosts.html @@ -1,194 +1,1233 @@ - + - JSDoc: Class: Hosts - - - + Class: Hosts + + + + + - - + + + + + + + + +
+ + +
+ + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Network.Protocol.html b/documentation/jsapi/LuCI.Network.Protocol.html index e23801a32..20239bce8 100644 --- a/documentation/jsapi/LuCI.Network.Protocol.html +++ b/documentation/jsapi/LuCI.Network.Protocol.html @@ -1,4627 +1,5280 @@ - + - JSDoc: Class: Protocol - - - + Class: Protocol + + + + + - - + + + + + + + + +
+ + + + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns a boolean indicating whether the underlying protocol spawns -dynamic interfaces (true) or not (false).

-
- - - -
-
- Type -
-
- -boolean - - -
+ +
- - - - - - - + -

set(opt, val)

- - - - -
-

Set the given UCI option of this network to the given value.

-
- - - - - - - - - -
Parameters:
+ +
Returns:
+ + - - - + + + + + + + + + + + + +
NameTypeDescription
+ + boolean + + + Returns a boolean indicating whether the underlying protocol spawns +dynamic interfaces (true) or not (false).
- + + + + + +
+
+

+ + set(opt, val) +

+ + +
+ network.js, line 1841 +
+ +
- Description - - + +
+
+ + +
+

Set the given UCI option of this network to the given value.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + +
NameTypeDescription
opt @@ -4630,21 +5283,21 @@ dynamic interfaces (true) or not (false).

The name of the UCI option to set.

+ +

The name of the UCI option to set.

val @@ -4659,109 +5312,83 @@ dynamic interfaces (true) or not (false).

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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + - - - - - - - - - - - - - - - - - - + + + + + + +
+ + + + + - - - + -
- -
-
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
+ - - +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+ + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Network.WifiDevice.html b/documentation/jsapi/LuCI.Network.WifiDevice.html index b050c68bc..89d050e87 100644 --- a/documentation/jsapi/LuCI.Network.WifiDevice.html +++ b/documentation/jsapi/LuCI.Network.WifiDevice.html @@ -1,1775 +1,2673 @@ - + - JSDoc: Class: WifiDevice + Class: WifiDevice + + + + + + + + + + + + + + + + + +
+ + +
+

Class: WifiDevice

+ - - - - - - - -
+
+ +
+

+ LuCI.Network. + + WifiDevice +

+ +

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.

+ +
-

Class: WifiDevice

+
+
+ + + + +
+
+

+ + new LuCI.Network.WifiDevice() +

+ + +
+ network.js, line 2957 +
+ +
+
+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + -
+ -
-

- LuCI.Network.WifiDevice

+ + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + addWifiNetwork(options){Promise.<(null|LuCI.Network.WifiNetwork)>} +

+ + +
+ network.js, line 3222 +
+ +
+ + +
+
+ + +
+

Adds a new wireless network associated with this radio device to the +configuration and sets its options to the provided values.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object.<string, (string|Array.<string>)> + + + + + + + optional + + + + + +

The options to set for the newly added wireless network.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Promise.<(null|LuCI.Network.WifiNetwork)> + + + Returns a promise resolving to a WifiNetwork instance describing +the newly added wireless network or null if the given options +were invalid.
+ + + + +
+ + + +
+
+

+ + deleteWifiNetwork(network){Promise.<boolean>} +

+ -

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.

+
+ network.js, line 3247 +
+
+ + +
+
+ + +
+

Deletes the wireless network with the given name associated with this +radio device.

+
- -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.

- - - +
- + - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - +
- -

Methods

- - - - - -

addWifiNetwork(optionsopt) → {Promise.<(null|LuCI.Network.WifiNetwork)>}

- - - - -
-

Adds a new wireless network associated with this radio device to the -configuration and sets its options to the provided values.

-
- - - - - - - - - -
Parameters:
+
Returns:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + 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.
+ + + + + - Attributes + +
+
+

+ + get(opt){null|string|Array.<string>} +

+ - +
+ network.js, line 2997 +
+
- Description - - + +
+
+ + +
+

Read the given UCI option value of this wireless device.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + + - - - - - - + - - - + + +
NameTypeDescription
optionsopt -Object.<string, (string|Array.<string>)> +string - - <optional>
- - - - - -

The options to set for the newly added wireless network.

+ +

The UCI option name to read.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns a promise resolving to a WifiNetwork instance describing -the newly added wireless network or null if the given options -were invalid.

-
- - - -
-
- Type -
-
- -Promise.<(null|LuCI.Network.WifiNetwork)> - - -
-
- - - - - - - - - + -

deleteWifiNetwork(network) → {Promise.<boolean>}

- - -
-

Deletes the wireless network with the given name associated with this -radio device.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - - - - - - - - - - - + -
NameTypeDescription
network - -string - - - + null + | + + string + | + + Array.<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 the UCI option value or null if the requested option is +not found.
+ + + +
+ + +
+
+

+ + getHTModes(){Array.<string>} +

+ + +
+ network.js, line 3075 +
+ +
+ +
+
+ + +
+

Gets a list of supported htmodes.

+

The htmode values describe the wide-frequency options supported by +the wireless phy.

+
+ - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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:
+ + - - - - - - - - - - - - - - - - - - - + -
NameTypeDescription
opt - -string - - - + Array.<string> + +

The UCI option name to read.

Returns an array of valid htmode values for this radio. Currently +known mode values are: +
    +
  • HT20 - applicable to IEEE 802.11n, 20 MHz wide channels
  • +
  • HT40 - applicable to IEEE 802.11n, 40 MHz wide channels
  • +
  • VHT20 - applicable to IEEE 802.11ac, 20 MHz wide channels
  • +
  • VHT40 - applicable to IEEE 802.11ac, 40 MHz wide channels
  • +
  • VHT80 - applicable to IEEE 802.11ac, 80 MHz wide channels
  • +
  • VHT160 - applicable to IEEE 802.11ac, 160 MHz wide channels
  • +
+ + + +
+ + +
+
+

+ + getHWModes(){Array.<string>} +

+ + +
+ network.js, line 3054 +
+ +
+ +
+
+ + +
+

Gets a list of supported hwmodes.

+

The hwmode values describe the frequency band and wireless standard +versions supported by the wireless phy.

+
+ - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- - -
-

Returns the UCI option value or null if the requested option is -not found.

-
- - - -
-
- Type -
-
+ + + -null -| - -string -| - -Array.<string> - - - - - + + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of valid hwmode values for this radio. Currently +known mode values are: +
    +
  • a - Legacy 802.11a mode, 5 GHz, up to 54 Mbit/s
  • +
  • b - Legacy 802.11b mode, 2.4 GHz, up to 11 Mbit/s
  • +
  • g - Legacy 802.11g mode, 2.4 GHz, up to 54 Mbit/s
  • +
  • n - IEEE 802.11n mode, 2.4 or 5 GHz, up to 600 Mbit/s
  • +
  • ac - IEEE 802.11ac mode, 5 GHz, up to 6770 Mbit/s
  • +
- - - + + + +
- +
+
+

+ + getI18n(){string} +

+ +
+ network.js, line 3086 +
+ +
-

getHTModes() → {Array.<string>}

+
+
- + +
+

Get a string describing the wireless radio hardware.

+
- - -
-

Gets a list of supported htmodes.

-

The htmode values describe the wide-frequency options supported by -the wireless phy.

-
- - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- - -
-

Returns an array of valid htmode values for this radio. Currently -known mode values are:

-
    -
  • HT20 - applicable to IEEE 802.11n, 20 MHz wide channels
  • -
  • HT40 - applicable to IEEE 802.11n, 40 MHz wide channels
  • -
  • VHT20 - applicable to IEEE 802.11ac, 20 MHz wide channels
  • -
  • VHT40 - applicable to IEEE 802.11ac, 40 MHz wide channels
  • -
  • VHT80 - applicable to IEEE 802.11ac, 80 MHz wide channels
  • -
  • VHT160 - applicable to IEEE 802.11ac, 160 MHz wide channels
  • -
-
- - - -
-
- Type -
-
+ + + -Array.<string> - - - - - + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the description string.
- - - + + + +
- +
+
+

+ + getName(){string} +

+ +
+ network.js, line 3035 +
+ +
-

getHWModes() → {Array.<string>}

+
+
- + +
+

Get the configuration name of this wireless radio.

+
- - -
-

Gets a list of supported hwmodes.

-

The hwmode values describe the frequency band and wireless standard -versions supported by the wireless phy.

-
- - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns an array of valid hwmode values for this radio. Currently -known mode values are:

-
    -
  • a - Legacy 802.11a mode, 5 GHz, up to 54 Mbit/s
  • -
  • b - Legacy 802.11b mode, 2.4 GHz, up to 11 Mbit/s
  • -
  • g - Legacy 802.11g mode, 2.4 GHz, up to 54 Mbit/s
  • -
  • n - IEEE 802.11n mode, 2.4 or 5 GHz, up to 600 Mbit/s
  • -
  • ac - IEEE 802.11ac mode, 5 GHz, up to 6770 Mbit/s
  • -
-
- - - -
-
- Type -
-
- -Array.<string> - - -
+ +
+ + + + + + + +
Returns:
+ - + + + + + + + + + + - + + + + +
TypeDescription
+ + 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.
-

getI18n() → {string}

- +
- - -
-

Get a string describing the wireless radio hardware.

-
- - - - - - - - - - - - - -
+ + +
+
+

+ + getScanList(){Promise.<Array.<LuCI.Network.WifiScanResult>>} +

+ + +
+ network.js, line 3147 +
+ +
- +
+
- - +
+

Trigger a wireless scan on this radio device and obtain a list of +nearby networks.

+
- - - - - - - +
- + -
Source:
-
- - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns the description string.

-
- - - -
-
- Type -
-
- -string - - -
-
- - - - - - - - - - -

getName() → {string}

- - - - -
-

Get the configuration name of this wireless radio.

-
- - - - - - - - - - - - - -
- - - - - - - - +
- - -
Source:
-
- - - +
Returns:
-
- - - - - - - - - - - - - -
Returns:
- - -
-

Returns the UCI section name (e.g. radio0) of the corresponding -radio configuration which also serves as unique logical identifier -for the wireless phy.

-
- - - -
-
- Type -
-
+ + + -string - - - - - + + + + + + + + + + + + +
TypeDescription
+ + Promise.<Array.<LuCI.Network.WifiScanResult>> + + + Returns a promise resolving to an array of scan result objects +describing the networks found in the vincinity.
- - - + + + +
- +
+
+

+ + getWifiNetwork(network){Promise.<LuCI.Network.WifiNetwork>} +

+ +
+ network.js, line 3180 +
+ +
-

getScanList() → {Promise.<Array.<LuCI.Network.WifiScanResult>>}

+
+
- + +
+

Get the wifi network of the given name belonging to this radio device

+
+ + + + + + - -
-

Trigger a wireless scan on this radio device and obtain a list of -nearby networks.

-
- - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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.

+ + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns a promise resolving to an array of scan result objects -describing the networks found in the vincinity.

-
- - - -
-
- Type -
-
- -Promise.<Array.<LuCI.Network.WifiScanResult>> - - -
-
- - - - - - - - - +
-

getWifiNetwork(network) → {Promise.<LuCI.Network.WifiNetwork>}

- - -
-

Get the wifi network of the given name belonging to this radio device

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - - - - - - - - - - - + -
NameTypeDescription
network - -string - - - + Promise.<LuCI.Network.WifiNetwork> + +

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.
- - - - - -
- - - - - +
+ + +
+
+

+ + getWifiNetworks(){Promise.<Array.<LuCI.Network.WifiNetwork>>} +

+ +
+ network.js, line 3199 +
+ +
- +
+
- - +
+

Get all wireless networks associated with this wireless radio device.

+
- - - -
Source:
-
- - - +
-
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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.

-
- - - -
-
- Type -
-
-Promise.<LuCI.Network.WifiNetwork> - - -
-
- - - - - - - - - + -

getWifiNetworks() → {Promise.<Array.<LuCI.Network.WifiNetwork>>}

- - - - -
-

Get all wireless networks associated with this wireless radio device.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - +
-
Source:
-
- -
- - - - - - - - - - - - - - + + + +
Returns:
+ -
Returns:
+ + + -
-

Returns a promise resolving to an array of Network.WifiNetwork +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<Array.<LuCI.Network.WifiNetwork>> + + + Returns a promise resolving to an array of Network.WifiNetwork instances respresenting the wireless networks associated with this -radio device.

- - - - -
-
- Type -
-
- -Promise.<Array.<LuCI.Network.WifiNetwork>> - - -
-
- +radio device.
- - - + + + +
- +
+
+

+ + isDisabled(){boolean} +

+ +
+ network.js, line 3023 +
+ +
-

isDisabled() → {boolean}

+
+
- + +
+

Checks whether this wireless radio is disabled.

+
- - -
-

Checks whether this wireless radio is disabled.

-
- - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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 - - -
+ +
+ + + + + + + +
Returns:
+ - + + + + + + + + + + - + + + + +
TypeDescription
+ + 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}

- +
+ + +
+
+

+ + isUp(){boolean} +

+ + +
+ network.js, line 3158 +
+ +
- -
-

Check whether the wireless radio is marked as up in the ubus + +

+
+ + +
+

Check whether the wireless radio is marked as up in the ubus runtime state.

-
- - - - - - - - - - - - +
+ + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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:
+ +
Returns:
+ + - - - + + + + + + + + + + + + +
NameTypeDescription
+ + boolean + + + Returns true when the radio device is up, else false.
- + + + + + +
+
+

+ + set(opt, val) +

+ + +
+ network.js, line 3011 +
+ +
- Description - - + +
+
+ + +
+

Set the given UCI option of this network to the given value.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + +
NameTypeDescription
opt @@ -1778,21 +2676,21 @@ runtime state.

The name of the UCI option to set.

+ +

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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + - - - - - - - - - - - - - - - - - - + + + + + + +
+ + + + + - - - + -
- -
-
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
+ - - +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+
+ + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Network.WifiNetwork.html b/documentation/jsapi/LuCI.Network.WifiNetwork.html index 62e43aa5e..20ba7447a 100644 --- a/documentation/jsapi/LuCI.Network.WifiNetwork.html +++ b/documentation/jsapi/LuCI.Network.WifiNetwork.html @@ -1,4099 +1,4794 @@ - + - JSDoc: Class: WifiNetwork - - - + Class: WifiNetwork + + + + + - - + + + + + + + + +
+ + - -
-
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
+ - - +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+
+ + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Network.html b/documentation/jsapi/LuCI.Network.html index d0ab9f2c9..5b4d1e81b 100644 --- a/documentation/jsapi/LuCI.Network.html +++ b/documentation/jsapi/LuCI.Network.html @@ -1,132 +1,1172 @@ - + - JSDoc: Class: Network - - - + Class: Network + + + + + - - + + + + + + + + - -
- -

Class: Network

- +
+ +
+

Class: Network

+
- +
+

+ LuCI. -

- LuCI.Network

- -

The LuCI.Network class combines data from multiple ubus apis to + Network + + +

The LuCI.Network class combines data from multiple ubus apis to provide an abstraction of the current network configuration state.

It provides methods to enumerate interfaces and devices, to query current configuration details and to manipulate settings.

- -
+
+ + +
+
+

+ + new LuCI.Network() +

+ + +
+ network.js, line 628 +
+ +
+ +
+
+ + - - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + - - - - - - - - - - - - - - - - + + + + + + + +
- - - + + + + +

Classes

- +
Device
@@ -144,76 +1184,73 @@ current configuration details and to manipulate settings.

- - - - - +

Methods

- +
- +
+
+

+ + addNetwork(name, options){Promise.<(null|LuCI.Network.Protocol)>} +

+ +
+ network.js, line 884 +
+ +
-

addNetwork(name, optionsopt) → {Promise.<(null|LuCI.Network.Protocol)>}

+
+
- - - - -
-

Adds a new network of the given name and update it with the given +

+

Adds a new network of the given name and update it with the given uci option values.

If a network with the given name already exist but is empty, then this function will update its option, otherwise it will do nothing.

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
NameTypeAttributesDescription
NameTypeDescription
name @@ -222,29 +1259,26 @@ this function will update its option, otherwise it will do nothing.

- - - - - -

The name of the network to add. Must be in the format [a-zA-Z0-9_]+.

+ + + + + + +

The name of the network to add. Must be in the format [a-zA-Z0-9_]+.

options @@ -253,172 +1287,155 @@ this function will update its option, otherwise it will do nothing.

- - <optional>
- - - - - -

An object of uci option values to set on the new network or to +

+ + + optional + + + + + +

An object of uci option values to set on the new network or to update in an existing, empty network.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a promise resolving to the Protocol subclass instance +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<(null|LuCI.Network.Protocol)> + + + 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.

- - - - -
-
- Type -
-
- -Promise.<(null|LuCI.Network.Protocol)> - - -
-
- +existed.
- - - + + + +
- +
+
+

+ + addWifiNetwork(options){Promise.<(null|LuCI.Network.WifiNetwork)>} +

+ +
+ network.js, line 1352 +
+ +
-

addWifiNetwork(options) → {Promise.<(null|LuCI.Network.WifiNetwork)>}

+
+
- - - - -
-

Adds a new wireless network to the configuration and sets its options +

+

Adds a new wireless network to the configuration and sets its options to the provided values.

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
NameTypeDescription
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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a promise resolving to a WifiNetwork instance describing +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<(null|LuCI.Network.WifiNetwork)> + + + 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.

- - - - -
-
- Type -
-
- -Promise.<(null|LuCI.Network.WifiNetwork)> - - -
-
- +were invalid or if the associated radio device could not be found.
- - - + + + +
- +
+
+

+ + deleteNetwork(name){Promise.<boolean>} +

+ +
+ network.js, line 962 +
+ +
-

deleteNetwork(name) → {Promise.<boolean>}

+
+
- - - - -
-

Deletes the given network and its references from the network and +

+

Deletes the given network and its references from the network and firewall configuration.

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
NameTypeDescription
name @@ -591,159 +1594,145 @@ firewall configuration.

The name of the network to delete.

+ +

The name of the network to delete.

- - - - - - -
- - - - - - +
- + - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + 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.
- + + + +
+ +
+
+

+ + deleteWifiNetwork(netname){Promise.<boolean>} +

+ + +
+ network.js, line 1390 +
+ +
- Description - - + +
+
+ + +
+

Deletes the given wireless network from the configuration.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a promise resolving to true if the wireless network has been +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<boolean> + + + Returns a promise resolving to true if the wireless network has been successfully deleted from the configuration or false if it could not -be found.

- - - - -
-
- Type -
-
- -Promise.<boolean> - - -
-
- +be found.
- - - + + + +
- +
+
+

+ + flushCache(){Promise.<Object>} +

+ +
+ network.js, line 728 +
+ +
-

flushCache() → {Promise.<Object>}

+
+
- - - - -
-

Flushes the local network state cache and fetches updated information +

+

Flushes the local network state cache and fetches updated information from the remote ubus apis.

-
- - - - - - - - - - - - +
+ + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns a promise resolving to the internal network state object.

-
- - - -
-
- Type -
-
- -Promise.<Object> - - -
+ +
- - - - - - - + -

formatWifiEncryption(encryption) → {null|string}

- + + + +
Returns:
+ + + + + + + + + + + + + + + + + +
TypeDescription
+ + Promise.<Object> + + + Returns a promise resolving to the internal network state object.
-
-

Converts a given encryption entry -into a human readable string such as mixed WPA/WPA2 PSK (TKIP, CCMP) -or WPA3 SAE (CCMP).

-
- - - - - - - - - -
Parameters:
+ + +
- - - - - - - - + +
+
+

+ + formatWifiEncryption(encryption){null|string} +

+ - +
+ network.js, line 719 +
+
-
- - + + +
+ + +
+

Converts a given encryption entry +into a human readable string such as mixed WPA/WPA2 PSK (TKIP, CCMP) +or WPA3 SAE (CCMP).

+
+ -
+ + + + + +
NameTypeDescription
+ + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
encryption @@ -1029,162 +1994,148 @@ or WPA3 SAE (CCMP).

The wireless encryption entry to convert.

+ +

The wireless encryption entry to convert.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns the description string for the given encryption entry or -null if the given entry was invalid.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
+ +
- - - - - - - + -

getDevice(name) → {Promise.<(null|LuCI.Network.Device)>}

- - - - -
-

Get a Device instance describing the -given network device.

-
- - - - - - - - - -
Parameters:
+ + +
Returns:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + null + | + + string + + + Returns the description string for the given encryption entry or +null if the given entry was invalid.
- + + + + + +
+
+

+ + getDevice(name){Promise.<(null|LuCI.Network.Device)>} +

+ + +
+ network.js, line 1087 +
+ +
- Description - - + +
+
+ + +
+

Get a Device instance describing the +given network device.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
name @@ -1193,495 +2144,451 @@ given network device.

The name of the network device to get, e.g. eth0 or br-lan.

+ +

The name of the network device to get, e.g. eth0 or br-lan.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a promise resolving to the Device instance describing +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<(null|LuCI.Network.Device)> + + + Returns a promise resolving to the Device instance describing the network device or null if the given device name could not -be found.

- - - - -
-
- Type -
-
- -Promise.<(null|LuCI.Network.Device)> - - -
-
- +be found.
- - - + + + +
- +
+
+

+ + getDevices(){Promise.<Array.<LuCI.Network.Device>>} +

+ +
+ network.js, line 1110 +
+ +
-

getDevices() → {Promise.<Array.<LuCI.Network.Device>>}

+
+
- + +
+

Get a sorted list of all found network devices.

+
- - -
-

Get a sorted list of all found network devices.

-
- - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- - -
-

Returns a promise resolving to a sorted array of Device class -instances describing the network devices found on the system.

-
- - - -
-
- Type -
-
+ + + -Promise.<Array.<LuCI.Network.Device>> - - - - - + + + + + + + + + + + + +
TypeDescription
+ + Promise.<Array.<LuCI.Network.Device>> + + + Returns a promise resolving to a sorted array of Device class +instances describing the network devices found on the system.
- - - + + + +
- +
+
+

+ + getDSLModemType(){Promise.<(null|string)>} +

+ +
+ network.js, line 1594 +
+ +
-

getDSLModemType() → {Promise.<(null|string)>}

+
+
- + +
+

Queries the internal DSL modem type from board information.

+
- - -
-

Queries the internal DSL modem type from board information.

-
- - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- - -
-

Returns a promise resolving to the type of the internal modem -(e.g. vdsl) or to null if no internal modem is present.

-
- - - -
-
- Type -
-
+ + + -Promise.<(null|string)> - - - - - + + + + + + + + + + + + +
TypeDescription
+ + Promise.<(null|string)> + + + Returns a promise resolving to the type of the internal modem +(e.g. vdsl) or to null if no internal modem is present.
- - - + + + +
- +
+
+

+ + getHostHints(){Promise.<LuCI.Network.Hosts>} +

+ +
+ network.js, line 1611 +
+ +
-

getHostHints() → {Promise.<LuCI.Network.Hosts>}

+
+
- - - - -
-

Queries aggregated information about known hosts.

+
+

Queries aggregated information about known 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.

-
- - - - - - - - - - - - +
+ + + + + + + +
- - + - - - - - + + + + + + + + + + + +
- - -
Source:
-
- - - +
Returns:
-
- - - - - - - - - - - - - -
Returns:
- - -
-

Returns a Hosts instance describing host known on the system.

-
- - - -
-
- Type -
-
+ + + -Promise.<LuCI.Network.Hosts> - - - - - + + + + + - - - - - - + - + + + + +
TypeDescription
+ + Promise.<LuCI.Network.Hosts> + + + Returns a Hosts instance describing host known on the system.
-

getIfnameOf(obj) → {null|string}

- - - - - -
-

Obtains the the network device name of the given object.

-
- - - - - - - - - -
Parameters:
+
- - - - - - - - + +
+
+

+ + getIfnameOf(obj){null|string} +

+ - +
+ network.js, line 1583 +
+
-
- - + + +
+ + +
+

Obtains the the network device name of the given object.

+
+ -
+ + + + + +
NameTypeDescription
+ + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
obj @@ -1702,162 +2609,148 @@ class instance describing the found hosts.

The object to get the device name from.

+ +

The object to get the device name from.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns a string containing the device name or null if the given -object could not be converted to a name.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
+ +
- - - - - - - + -

getNetwork(name) → {Promise.<(null|LuCI.Network.Protocol)>}

- - - - -
-

Get a Protocol instance describing -the network with the given name.

-
- - - - - - - - - -
Parameters:
+ + +
Returns:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + null + | + + string + + + Returns a string containing the device name or null if the given +object could not be converted to a name.
- + + + +
+ +
+
+

+ + getNetwork(name){Promise.<(null|LuCI.Network.Protocol)>} +

+ + +
+ network.js, line 921 +
+ +
- Description - - + +
+
+ + +
+

Get a Protocol instance describing +the network with the given name.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
name @@ -1866,276 +2759,250 @@ the network with the given name.

The logical interface name of the network get, e.g. lan or wan.

+ +

The logical interface name of the network get, e.g. lan or wan.

- - - - - - + + +
+ + + + + - - - - - - - - - + + + + + +
+ -
Source:
-
- - - -
- - - - - - - - - - - - - - +
Returns:
+ -
Returns:
+ + + -
-

Returns a promise resolving to a +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<(null|LuCI.Network.Protocol)> + + + Returns a promise resolving to a Protocol subclass instance describing -the network or null if the network did not exist.

- - - - -
-
- Type -
-
- -Promise.<(null|LuCI.Network.Protocol)> - - -
-
- +the network or null if the network did not exist.
- - - + + + +
- +
+
+

+ + getNetworks(){Promise.<Array.<LuCI.Network.Protocol>>} +

+ +
+ network.js, line 946 +
+ +
-

getNetworks() → {Promise.<Array.<LuCI.Network.Protocol>>}

+
+
- + +
+

Gets an array containing all known networks.

+
- - -
-

Gets an array containing all known networks.

-
- - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns a promise resolving to a name-sorted array of -Protocol subclass instances -describing all known networks.

-
- - - -
-
- Type -
-
- -Promise.<Array.<LuCI.Network.Protocol>> - - -
+ +
- - - - - - - + -

getProtocol(protoname, netnameopt) → {null|LuCI.Network.Protocol}

- - - - -
-

Instantiates the given Protocol backend, -optionally using the given network name.

-
- - - - - - - - - -
Parameters:
+ +
Returns:
+ + - - - + + + + + + + + + + + + +
NameTypeDescription
+ + Promise.<Array.<LuCI.Network.Protocol>> + + + Returns a promise resolving to a name-sorted array of +Protocol subclass instances +describing all known networks.
- - Attributes - + + + +
- Default + +
+
+

+ + getProtocol(protoname, netname){null|LuCI.Network.Protocol} +

+ + +
+ network.js, line 750 +
+
- Description - - + +
+
+ + +
+

Instantiates the given Protocol backend, +optionally using the given network name.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + - - - + + + - + - - - - - - - - - + + +
NameTypeDefaultDescription
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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- - -
-

Returns the instantiated protocol backend class or null if the given -protocol isn't known.

-
- - - -
-
- Type -
-
+ + + -null -| - -LuCI.Network.Protocol - - - - - + + + + + + + + + + + + +
TypeDescription
+ + null + | + + LuCI.Network.Protocol + + + Returns the instantiated protocol backend class or null if the given +protocol isn't known.
- - - + + + +
- +
+
+

+ + getProtocols(){Array.<LuCI.Network.Protocol>} +

+ +
+ network.js, line 765 +
+ +
-

getProtocols() → {Array.<LuCI.Network.Protocol>}

+
+
- - - - -
-

Obtains instances of all known Protocol +

+

Obtains instances of all known Protocol backend classes.

-
- - - - - - - - - - - - +
+ + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- - -
-

Returns an array of protocol class instances.

-
- - - -
-
- Type -
-
+ + + -Array.<LuCI.Network.Protocol> - - - - - + + + + + + + + + + + + +
TypeDescription
+ + Array.<LuCI.Network.Protocol> + + + Returns an array of protocol class instances.
- - - + + + +
- +
+
+

+ + getSwitchTopologies(){Promise.<Object.<string, LuCI.Network.SwitchTopology>>} +

+ +
+ network.js, line 1538 +
+ +
-

getSwitchTopologies() → {Promise.<Object.<string, LuCI.Network.SwitchTopology>>}

+
+
- + +
+

Returns the topologies of all swconfig switches found on the system.

+
- - -
-

Returns the topologies of all swconfig switches found on the system.

-
- - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a promise resolving to an object containing the topologies +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<Object.<string, LuCI.Network.SwitchTopology>> + + + 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.

- - - - -
-
- Type -
-
- -Promise.<Object.<string, LuCI.Network.SwitchTopology>> - - -
-
- +the layout.
- - - + + + +
- +
+
+

+ + getWAN6Networks(){Promise.<Array.<LuCI.Network.Protocol>>} +

+ +
+ network.js, line 1493 +
+ +
-

getWAN6Networks() → {Promise.<Array.<LuCI.Network.Protocol>>}

+
+
- - - - -
-

Get IPv6 wan networks.

+
+

Get IPv6 wan networks.

This function looks up all networks having a default ::/0 route and returns them as array.

-
- - - - - - - - - - - - +
+ + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- - -
-

Returns a promise resolving to an array of Protocol subclass -instances describing the found IPv6 default route interfaces.

-
- - - -
-
- Type -
-
+ + + -Promise.<Array.<LuCI.Network.Protocol>> - - - - - + + + + + + + + + + + + +
TypeDescription
+ + Promise.<Array.<LuCI.Network.Protocol>> + + + Returns a promise resolving to an array of Protocol subclass +instances describing the found IPv6 default route interfaces.
- - - + + + +
- +
+
+

+ + getWANNetworks(){Promise.<Array.<LuCI.Network.Protocol>>} +

+ +
+ network.js, line 1472 +
+ +
-

getWANNetworks() → {Promise.<Array.<LuCI.Network.Protocol>>}

+
+
- - - - -
-

Get IPv4 wan networks.

+
+

Get IPv4 wan networks.

This function looks up all networks having a default 0.0.0.0/0 route and returns them as array.

-
- - - - - - - - - - - - +
+ + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns a promise resolving to an array of Protocol subclass -instances describing the found default route interfaces.

-
- - - -
-
- Type -
-
- -Promise.<Array.<LuCI.Network.Protocol>> - - -
+ +
- - - - - - - + -

getWifiDevice(devname) → {Promise.<(null|LuCI.Network.WifiDevice)>}

- - - - -
-

Get a WifiDevice instance describing -the given wireless radio.

-
- - - - - - - - - -
Parameters:
+ + +
Returns:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + Promise.<Array.<LuCI.Network.Protocol>> + + + Returns a promise resolving to an array of Protocol subclass +instances describing the found default route interfaces.
- + + + +
+ +
+
+

+ + getWifiDevice(devname){Promise.<(null|LuCI.Network.WifiDevice)>} +

+ + +
+ network.js, line 1240 +
+ +
- Description - - + +
+
+ + +
+

Get a WifiDevice instance describing +the given wireless radio.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
devname @@ -2813,274 +3620,250 @@ the given wireless radio.

The configuration name of the wireless radio to lookup, e.g. radio0 + +

+ +

The configuration name of the wireless radio to lookup, e.g. radio0 for the first mac80211 phy on the system.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a promise resolving to the WifiDevice instance describing +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<(null|LuCI.Network.WifiDevice)> + + + Returns a promise resolving to the WifiDevice instance describing the underlying radio device or null if the wireless radio could not -be found.

- - - - -
-
- Type -
-
- -Promise.<(null|LuCI.Network.WifiDevice)> - - -
-
- +be found.
- - - + + + +
- +
+
+

+ + getWifiDevices(){Promise.<Array.<LuCI.Network.WifiDevice>>} +

+ +
+ network.js, line 1260 +
+ +
-

getWifiDevices() → {Promise.<Array.<LuCI.Network.WifiDevice>>}

+
+
- + +
+

Obtain a list of all configured radio devices.

+
- - -
-

Obtain a list of all configured radio devices.

-
- - - - - - - - - - - - - + + + + + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a promise resolving to an array of WifiDevice instances +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<Array.<LuCI.Network.WifiDevice>> + + + 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.

- - - - -
-
- Type -
-
- -Promise.<Array.<LuCI.Network.WifiDevice>> - - -
-
- +the configuration.
- - - + + + +
- +
+
+

+ + getWifiNetwork(netname){Promise.<(null|LuCI.Network.WifiNetwork)>} +

+ +
+ network.js, line 1289 +
+ +
-

getWifiNetwork(netname) → {Promise.<(null|LuCI.Network.WifiNetwork)>}

+
+
- - - - -
-

Get a WifiNetwork instance describing +

+

Get a WifiNetwork instance describing the given wireless network.

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
NameTypeDescription
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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns a promise resolving to the WifiNetwork instance describing +

+ + + + + + + + + + + +
TypeDescription
+ + Promise.<(null|LuCI.Network.WifiNetwork)> + + + Returns a promise resolving to the WifiNetwork instance describing the wireless network or null if the corresponding network could not -be found.

- - - - -
-
- Type -
-
- -Promise.<(null|LuCI.Network.WifiNetwork)> - - -
-
- +be found.
- - - + + + +
- +
+
+

+ + isIgnoredDevice(name){boolean} +

+ +
+ network.js, line 1223 +
+ +
-

isIgnoredDevice(name) → {boolean}

+
+
- - - - -
-

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:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
NameTypeDescription
name @@ -3257,162 +4026,146 @@ and which are unsuitable for use in network configuration.

The device name to test.

+ +

The device name to test.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns true if the given name is in the ignore pattern list, -else returns false.

-
- - - -
-
- Type -
-
- -boolean - - -
+ +
- - - - - - - + -

maskToPrefix(netmask, v6opt) → {null|number}

- - - - -
-

Converts the given netmask to a prefix size in bits.

-
- - - - - - - - - -
Parameters:
+ + +
Returns:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + boolean + + + Returns true if the given name is in the ignore pattern list, +else returns false.
- - Attributes - + + + +
- Default + +
+
+

+ + maskToPrefix(netmask, v6){null|number} +

+ + +
+ network.js, line 664 +
+
- Description - - + +
+
+ + +
+

Converts the given netmask to a prefix size in bits.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + - - - + + + - + - - - - - - - - - + + +
NameTypeDefaultDescription
netmask @@ -3421,33 +4174,30 @@ else returns false.

- - - - - -

The netmask to convert into a bit count.

+ + + + + + +

The netmask to convert into a bit count.

v6 @@ -3456,19 +4206,7 @@ else returns false.

- - <optional>
- - - - - -
@@ -3476,162 +4214,155 @@ else returns false.

Whether to parse the given netmask as IPv4 (false) or IPv6 (true) + +

+ + + optional + + + + + +

Whether to parse the given netmask as IPv4 (false) or IPv6 (true) address.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns the number of prefix bits contained in the netmask or null -if the given netmask value was invalid.

-
- - - -
-
- Type -
-
- -null -| - -number - - -
+ +
- - - - - - - + -

prefixToMask(bits, v6opt) → {null|string}

- - - - -
-

Converts the given prefix size in bits to a netmask.

-
- - - - - - - - - -
Parameters:
+ + +
Returns:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + null + | + + number + + + Returns the number of prefix bits contained in the netmask or null +if the given netmask value was invalid.
- - Attributes - + + + +
- Default + +
+
+

+ + prefixToMask(bits, v6){null|string} +

+ + +
+ network.js, line 646 +
+
- Description - - + +
+
+ + +
+

Converts the given prefix size in bits to a netmask.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + - - - + + + - + - - - - - - - - - + + +
NameTypeDefaultDescription
bits @@ -3640,33 +4371,30 @@ if the given netmask value was invalid.

- - - - - -

The prefix size in bits.

+ + + + + + +

The prefix size in bits.

v6 @@ -3675,19 +4403,7 @@ if the given netmask value was invalid.

- - <optional>
- - - - - -
@@ -3695,160 +4411,155 @@ if the given netmask value was invalid.

Whether to convert the bits value into an IPv4 netmask (false) or + +

+ + + optional + + + + + +

Whether to convert the bits value into an IPv4 netmask (false) or an IPv6 netmask (true).

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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:
+ - - - + + + + + + + + + + + + +
NameTypeDescription
+ + 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 +
+ +
- Description - - + +
+
+ + +
+

Registers a new human readable translation string for a Protocol +error code.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + + - + - - - - + + - - - + + +
NameTypeDescription
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.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - + +
+ + + + + + + + +
Returns:
+ - - - - - - - - - - -
Returns:
- + + + -
-

Returns true if the error code description has been added or false +

+ + + + + + + + + + + +
TypeDescription
+ + 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.

- - - - -
-
- Type -
-
- -boolean - - -
-
- +description for the given code.
- - - + + + +
- +
+
+

+ + registerPatternVirtual(pat) +

+ +
+ network.js, line 833 +
+ +
-

registerPatternVirtual(pat)

+
+
- - - - -
-

Registers a new regular expression pattern to recognize +

+

Registers a new regular expression pattern to recognize virtual interfaces.

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
NameTypeDescription
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.

- - - - - - -
- - - - +
- + - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - - + + + + + +
+ + + + + + + + + + +
- +
+
+

+ + registerProtocol(protoname, methods){LuCI.Network.Protocol} +

+ +
+ network.js, line 792 +
+ +
-

registerProtocol(protoname, methods) → {LuCI.Network.Protocol}

+
+
- - - - -
-

Registers a new Protocol subclass +

+

Registers a new Protocol subclass with the given methods and returns the resulting subclass value.

This functions internally calls Class.extend() on the Network.Protocol base class.

-
- - - - - - - - +
+ -
Parameters:
+ + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + +
NameTypeDescription
NameTypeDescription
protoname @@ -4185,21 +4861,21 @@ base class.

The name of the new protocol to register.

+ +

The name of the new protocol to register.

methods @@ -4208,158 +4884,144 @@ base class.

The member methods and values of the new Protocol subclass to + +

+ +

The member methods and values of the new Protocol subclass to be passed to Class.extend().

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns the new Protocol subclass.

-
- - - -
-
- Type -
-
- -LuCI.Network.Protocol - - -
+ +
- - - - - - - + -

renameNetwork(oldName, newName) → {Promise.<boolean>}

- - - - -
-

Rename the given network and its references to a new name.

-
- - - - - - - - - -
Parameters:
+ +
Returns:
+ + - - - + + + + + + + + + + + + +
NameTypeDescription
+ + LuCI.Network.Protocol + + + Returns the new Protocol subclass.
- + + + +
+ +
+
+

+ + renameNetwork(oldName, newName){Promise.<boolean>} +

+ + +
+ network.js, line 1026 +
+ +
- Description - - + +
+
+ + +
+

Rename the given network and its references to a new name.

+
+ - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + +
NameTypeDescription
oldName @@ -4368,21 +5030,21 @@ be passed to Class.extend().<

The current name of the network.

+ +

The current name of the network.

newName @@ -4391,171 +5053,147 @@ be passed to Class.extend().<

The name to rename the network to, must be in the format + +

+ +

The name to rename the network to, must be in the format [a-z-A-Z0-9_]+.

- - - - - - + + +
- - + - - - - - - - - - - -
Source:
-
- - - -
- - - - - - - - - - - + + +
+ + + + + + + + +
Returns:
+ -
Returns:
+ + + -
-

Returns a promise resolving to either true if the network was +

+ + + + + + + + + + + +
TypeDescription
+ + 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.

- - - - -
-
- Type -
-
- -Promise.<boolean> - - -
-
- +rename could not be found.
- - - - - + + +
+
+ +

Type Definitions

- +
-

SwitchTopology

- - - - -
-

Describes an swconfig switch topology by specifying the CPU +

+
+

LuCI.Network.SwitchTopologyObject.<string, (Object|Array)>

+
+ + +
+
+ +
+

Describes an swconfig switch topology by specifying the CPU connections and external port labels of a switch.

-
- - - -
Type:
-
    -
  • - -Object.<string, (Object|Array)> - - -
  • -
- - - - - -
Properties:
- +
+ + + +
- - - - - - - - - - - +
Properties:
+
-
- - - - - - +
NameTypeDescription
+ + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + - + - - - + + + - + + + +
NameTypeDescription
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)
+ - - - - - - -
- + - - - - - - - - - - - -
Source:
-
- - - +
- - - - + + +
-

WifiEncryption

- - - - -
-

An encryption entry describes active wireless encryption settings +

+
+

LuCI.Network.WifiEncryptionObject.<string, (boolean|Array.<(number|string)>)>

+
+ + +
+
+ +
+

An encryption entry describes active wireless encryption settings such as the used key management protocols, active ciphers and protocol versions.

-
- - - -
Type:
-
    -
  • - -Object.<string, (boolean|Array.<(number|string)>)> - - -
  • -
- - - - - -
Properties:
- +
+ + + +
- - - - - - - - - - - - - +
Properties:
+
-
- - - - - - +
NameTypeAttributesDescription
+ + + + + + + + + + + + + + + + + + + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - + + + +
NameTypeArgumentDescription
enabled @@ -4727,29 +5337,29 @@ protocol versions.

- +

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.

ciphers @@ -4860,137 +5470,109 @@ mixed WPA2-PSK/WPA3-SAE encryption.

<optional>
- +

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.

+ - - - - - - -
- + - - - - - - - - - - - -
Source:
-
- - - +
- - - - + + + -

WifiPeerEntry

- - - - -
-

A wireless peer entry describes the properties of a remote wireless +

+
+

LuCI.Network.WifiPeerEntryObject.<string, (boolean|number|string|LuCI.Network.WifiRateEntry)>

+
+ + +
+
+ +
+

A wireless peer entry describes the properties of a remote wireless peer associated with a local network.

-
- - - -
Type:
- - - - - - -
Properties:
- +
+ + + +
- - - - - - - - - - - - - +
Properties:
+
-
- - - - - - +
NameTypeAttributesDescription
+ + + + + + + + + + + + + + + + + + + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - + + + +
NameTypeArgumentDescription
mac @@ -4999,27 +5581,27 @@ peer associated with a local network.

- +

The MAC address (BSSID).

signal @@ -5028,27 +5610,27 @@ peer associated with a local network.

- +

The received signal strength.

signal_avg @@ -5057,29 +5639,29 @@ peer associated with a local network.

<optional>
- +

The average signal strength if supported by the driver.

noise @@ -5088,30 +5670,30 @@ peer associated with a local network.

<optional>
- +

The current noise floor of the radio. May be 0 or absent if not supported by the driver.

inactive @@ -5120,28 +5702,28 @@ supported by the driver.

- +

The amount of milliseconds the peer has been inactive, e.g. due to powersave.

connected_time @@ -5150,27 +5732,27 @@ to powersave.

- +

The amount of milliseconds the peer is associated to this network.

thr @@ -5179,30 +5761,30 @@ to powersave.

<optional>
- +

The estimated throughput of the peer, May be 0 or absent if not supported by the driver.

authorized @@ -5211,27 +5793,27 @@ supported by the driver.

- +

Specifies whether the peer is authorized to associate to this network.

authenticated @@ -5240,27 +5822,27 @@ supported by the driver.

- +

Specifies whether the peer completed authentication to this network.

preamble @@ -5269,27 +5851,27 @@ supported by the driver.

- +

The preamble mode used by the peer. May be long or short.

wme @@ -5298,27 +5880,27 @@ supported by the driver.

- +

Specifies whether the peer supports WME/WMM capabilities.

mfp @@ -5327,27 +5909,27 @@ supported by the driver.

- +

Specifies whether management frame protection is active.

tdls @@ -5356,27 +5938,27 @@ supported by the driver.

- +

Specifies whether TDLS is active.

mesh llid @@ -5385,30 +5967,30 @@ supported by the driver.

<optional>
- +

The mesh LLID, may be 0 or absent if not applicable or supported by the driver.

mesh plid @@ -5417,30 +5999,30 @@ by the driver.

<optional>
- +

The mesh PLID, may be 0 or absent if not applicable or supported by the driver.

mesh plink @@ -5449,19 +6031,19 @@ by the driver.

<optional>
- +

The mesh peer link state description, may be an empty string ('') or absent if not applicable or supported by the driver.

The following states are known:

@@ -5476,14 +6058,14 @@ or absent if not applicable or supported by the driver.

  • UNKNOWN
  • mesh local PS @@ -5492,19 +6074,19 @@ or absent if not applicable or supported by the driver.

    <optional>
    - +

    The local powersafe mode for the peer link, may be an empty string ('') or absent if not applicable or supported by the driver.

    @@ -5516,14 +6098,14 @@ the driver.

  • UNKNOWN
  • mesh peer PS @@ -5532,19 +6114,19 @@ the driver.

    <optional>
    - +

    The remote powersafe mode for the peer link, may be an empty string ('') or absent if not applicable or supported by the driver.

    @@ -5556,14 +6138,14 @@ the driver.

  • UNKNOWN
  • mesh non-peer PS @@ -5572,19 +6154,19 @@ the driver.

    <optional>
    - +

    The powersafe mode for all non-peer neigbours, may be an empty string ('') or absent if not applicable or supported by the driver.

    The following modes are known:

    @@ -5595,14 +6177,14 @@ string ('') or absent if not applicable or supported by the driver.
  • UNKNOWN
  • rx @@ -5611,27 +6193,27 @@ string ('') or absent if not applicable or supported by the driver. - +

    Describes the receiving wireless rate from the peer.

    tx @@ -5640,131 +6222,103 @@ string ('') or absent if not applicable or supported by the driver. - +

    Describes the transmitting wireless rate to the peer.

    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    - - - - + + + -

    WifiRateEntry

    - - - - -
    -

    A wireless rate entry describes the properties of a wireless +

    +
    +

    LuCI.Network.WifiRateEntryObject.<string, (boolean|number)>

    +
    + + +
    +
    + +
    +

    A wireless rate entry describes the properties of a wireless transmission rate to or from a peer.

    -
    - - - -
    Type:
    -
      -
    • - -Object.<string, (boolean|number)> - - -
    • -
    - - - - - -
    Properties:
    - +
    + + + +
    - - - - - - - - - - - - - +
    Properties:
    +
    -
    - - - - - - +
    NameTypeAttributesDescription
    + + + + + + + + + + + + + + + + + + + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - + + + +
    NameTypeArgumentDescription
    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.

    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    - - - - + + + -

    WifiScanResult

    - - - - -
    -

    A wireless scan result object describes a neighbouring wireless +

    +
    +

    LuCI.Network.WifiScanResultObject.<string, (number|string|LuCI.Network.WifiEncryption)>

    +
    + + +
    +
    + +
    +

    A wireless scan result object describes a neighbouring wireless network found in the vincinity.

    -
    - - - -
    Type:
    - - - - - - -
    Properties:
    - +
    + + + +
    - - - - - - - - - - - +
    Properties:
    +
    -
    - - - - - - +
    NameTypeDescription
    + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - + + + +
    NameTypeDescription
    ssid @@ -6277,21 +6803,21 @@ network found in the vincinity.

    The SSID / Mesh ID of the network.

    bssid @@ -6300,21 +6826,21 @@ network found in the vincinity.

    The BSSID if the network.

    mode @@ -6323,21 +6849,21 @@ network found in the vincinity.

    The operation mode of the network (Master, Ad-Hoc, Mesh Point).

    channel @@ -6346,21 +6872,21 @@ network found in the vincinity.

    The wireless channel of the network.

    signal @@ -6369,21 +6895,21 @@ network found in the vincinity.

    The received signal strength of the network in dBm.

    quality @@ -6392,22 +6918,22 @@ network found in the vincinity.

    The numeric quality level of the signal, can be used in conjunction with quality_max to calculate a quality percentage.

    quality_max @@ -6416,22 +6942,22 @@ with quality_max to calculate a quality percentage.

    The maximum possible quality level of the signal, can be used in conjunction with quality to calculate a quality percentage.

    encryption @@ -6440,90 +6966,67 @@ conjunction with quality to calculate a quality percentage.

    The encryption used by the wireless network.

    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    + + + - - - - - +
    + + - - - + -
    - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Poll.html b/documentation/jsapi/LuCI.Poll.html index 195fdc991..a00c9a3ac 100644 --- a/documentation/jsapi/LuCI.Poll.html +++ b/documentation/jsapi/LuCI.Poll.html @@ -1,307 +1,1336 @@ - + - JSDoc: Class: Poll - - - + Class: Poll + + + + + - - + + + + + + + + +
    + + -
    @@ -613,294 +1602,277 @@ are registered, the polling loop is implicitely stopped.

    TypeError - -
    -
    -
    - - - - - - -
    Returns:
    - - -
    -

    Returns true if the function has been removed or false if it -wasn't found.

    -
    - - - -
    -
    - Type + +
    -
    - -boolean - - -
    - - - + + + +
    Returns:
    + + + + + + + + + + + - + + + + +
    TypeDescription
    + + boolean + + + Returns true if the function has been removed or false if it +wasn't found.
    -

    start() → {boolean}

    - + + + +
    +
    +

    + + start(){boolean} +

    + + +
    + luci.js, line 1090 +
    + +
    - -
    -

    (Re)start the polling loop. Dispatches a custom poll-start event + +

    +
    + + +
    +

    (Re)start the polling loop. Dispatches a custom poll-start event to the document object upon successful start.

    -
    - - - - - - - - - - - - +
    + + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if polling has been started (or if no functions -where registered) or false when the polling loop already runs.

    -
    - - - -
    -
    - Type -
    -
    + + + -boolean - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + boolean + + + Returns true if polling has been started (or if no functions +where registered) or false when the polling loop already runs.
    - - - + + + +
    - +
    +
    +

    + + stop(){boolean} +

    + +
    + luci.js, line 1115 +
    + +
    -

    stop() → {boolean}

    +
    +
    - - - - -
    -

    Stop the polling loop. Dispatches a custom poll-stop event +

    +

    Stop the polling loop. Dispatches a custom poll-stop event to the document object upon successful stop.

    -
    - - - - - - - - - - - - +
    + + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if polling has been stopped or false if it din't -run to begin with.

    -
    - - - -
    -
    - Type -
    -
    + + + -boolean - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + boolean + + + Returns true if polling has been stopped or false if it din't +run to begin with.
    - - - - - + + +
    +
    + + + + - - - + - - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    + + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Request.html b/documentation/jsapi/LuCI.Request.html index 2028b406f..530bf9a03 100644 --- a/documentation/jsapi/LuCI.Request.html +++ b/documentation/jsapi/LuCI.Request.html @@ -1,203 +1,1242 @@ - + - JSDoc: Class: Request - - - + Class: Request + + + + + - - + + + + + + + + - -
    - -

    Class: Request

    - +
    + +
    +

    Class: Request

    +
    - +
    +

    + LuCI. -

    - LuCI.Request

    - -

    The Request class allows initiating HTTP requests and provides utilities + Request + + +

    The Request class allows initiating HTTP requests and provides utilities for dealing with responses.

    - -
    +
    + + +
    +
    +

    + + new LuCI.Request() +

    + + +
    + luci.js, line 569 +
    + +
    + +
    +
    + + - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - - - + + + + +

    Classes

    - +
    poll
    - - - - - +

    Methods

    - +
    - +
    +
    +

    + + addInterceptor(interceptorFn){LuCI.Request.interceptorFn} +

    + +
    + luci.js, line 844 +
    + +
    -

    addInterceptor(interceptorFn) → {LuCI.Request.interceptorFn}

    +
    +
    - - - - -
    -

    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:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    interceptorFn @@ -206,319 +1245,289 @@ implementing request retries before returning a failure.

    The interceptor function to register.

    + +

    The interceptor function to register.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    The registered function.

    -
    - - - -
    -
    - Type -
    -
    - -LuCI.Request.interceptorFn - - -
    + +
    - - - - - - - + -

    expandURL(url) → {string}

    - - - - -
    -

    Turn the given relative URL into an absolute URL if necessary.

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - - - - - - - - - - - - - - - - - + -
    NameTypeDescription
    url - -string - - - + LuCI.Request.interceptorFn + +

    The URL to convert.

    The registered function.
    + + + +
    + + + +
    +
    +

    + + expandURL(url){string} +

    + + +
    + luci.js, line 586 +
    + +
    + +
    +
    + + +
    +

    Turn the given relative URL into an absolute URL if necessary.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    url + + +string + + + +

    The URL to convert.

    + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    The absolute URL derived from the given one, or the original URL -if it already was absolute.

    -
    - - - -
    -
    - Type -
    -
    - -string - - -
    + +
    - - - - - - - + -

    get(target, optionsopt) → {Promise.<LuCI.Response>}

    - - - - -
    -

    Initiate an HTTP GET request to the given target.

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + string + + + The absolute URL derived from the given one, or the original URL +if it already was absolute.
    + + + + +
    - Attributes + +
    +
    +

    + + get(target, options){Promise.<LuCI.Response>} +

    + - +
    + luci.js, line 797 +
    +
    - Description - - + +
    +
    + + +
    +

    Initiate an HTTP GET request to the given target.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeDescription
    target @@ -527,29 +1536,26 @@ if it already was absolute.

    - - - - - -

    The URL to request.

    + + + + + + +

    The URL to request.

    options @@ -558,169 +1564,150 @@ if it already was absolute.

    - - <optional>
    - - - - - -

    Additional options to configure the request.

    + + + optional + + + + + +

    Additional options to configure the request.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    The resulting HTTP response.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<LuCI.Response> - - -
    + +
    - - - - - - - + -

    post(target, dataopt, optionsopt) → {Promise.<LuCI.Response>}

    - - - - -
    -

    Initiate an HTTP POST request to the given target.

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + Promise.<LuCI.Response> + + + The resulting HTTP response.
    + + + + +
    - Attributes + +
    +
    +

    + + post(target, data, options){Promise.<LuCI.Response>} +

    + - +
    + luci.js, line 818 +
    +
    - Description - - + +
    +
    + + +
    +

    Initiate an HTTP POST request to the given target.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeDescription
    target @@ -729,29 +1716,26 @@ if it already was absolute.

    - - - - - -

    The URL to request.

    + + + + + + +

    The URL to request.

    data @@ -760,31 +1744,28 @@ if it already was absolute.

    - - <optional>
    - - - - - -

    The request data to send, see LuCI.Request.RequestOptions for details.

    + + + optional + + + + + +

    The request data to send, see LuCI.Request.RequestOptions for details.

    options @@ -793,330 +1774,297 @@ if it already was absolute.

    - - <optional>
    - - - - - -

    Additional options to configure the request.

    + + + optional + + + + + +

    Additional options to configure the request.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    The resulting HTTP response.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<LuCI.Response> - - -
    + +
    - - - - - - - + -

    removeInterceptor(interceptorFn) → {boolean}

    - - - - -
    -

    Remove an HTTP response interceptor function. The passed function -value must be the very same value that was used to register the -function.

    -
    - - - - - - - - - -
    Parameters:
    + + +
    Returns:
    + - - - - - - - - - - - - - - - - - - - + -
    NameTypeDescription
    interceptorFn - -LuCI.Request.interceptorFn - - - + Promise.<LuCI.Response> + +

    The interceptor function to remove.

    The resulting HTTP response.
    - - - - - -
    - - - - - - - - - - - +
    + + +
    +
    +

    + + removeInterceptor(interceptorFn){boolean} +

    + +
    + luci.js, line 863 +
    + +
    - +
    +
    - - +
    +

    Remove an HTTP response interceptor function. The passed function +value must be the very same value that was used to register the +function.

    +
    -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - -
    -

    Returns true if any function has been removed, else false.

    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    interceptorFn + + +LuCI.Request.interceptorFn -
    -
    - Type -
    -
    + +
    + +

    The interceptor function to remove.

    + + + +
    + -boolean - + + + -
    + + + + + + + + + + + + + + +
    - - - - - - - + -

    request(target, optionsopt) → {Promise.<LuCI.Response>}

    - - - - -
    -

    Initiate an HTTP request to the given target.

    -
    - - - - - - - - - -
    Parameters:
    + + +
    Returns:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + boolean + + + Returns true if any function has been removed, else false.
    + + + + + - Attributes + +
    +
    +

    + + request(target, options){Promise.<LuCI.Response>} +

    + - +
    + luci.js, line 648 +
    +
    - Description - - + +
    +
    + + +
    +

    Initiate an HTTP request to the given target.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeDescription
    target @@ -1125,29 +2073,26 @@ function.

    - - - - - -

    The URL to request.

    + + + + + + +

    The URL to request.

    options @@ -1156,174 +2101,157 @@ function.

    - - <optional>
    - - - - - -

    Additional options to configure the request.

    + + + optional + + + + + +

    Additional options to configure the request.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    The resulting HTTP response.

    -
    - - - -
    -
    - Type -
    -
    + + + -Promise.<LuCI.Response> - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<LuCI.Response> + + + The resulting HTTP response.
    - - - - - + + +
    +
    + +

    Type Definitions

    - +
    - +
    +
    +

    + + LuCI.Request.interceptorFn(res) +

    + +
    + luci.js, line 822 +
    + +
    -

    interceptorFn(res)

    +
    +
    - - - - -
    -

    Interceptor functions are invoked whenever an HTTP reply is received, in the order +

    +

    Interceptor functions are invoked whenever an HTTP reply is received, in the order these functions have been registered.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - + + + +
    NameTypeDescription
    NameTypeDescription
    res @@ -1332,138 +2260,107 @@ these functions have been registered.

    The HTTP response object

    + +

    The HTTP response object

    + + - - - - - - - -
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    -

    RequestOptions

    - - - - - - -
    Type:
    -
      -
    • - -Object - - -
    • -
    - - - - - -
    Properties:
    - +
    +
    +

    LuCI.Request.RequestOptionsObject

    +
    + + +
    +
    + + + +
    - - - - - - - - - - - - - - - +
    Properties:
    +
    -
    - - - - - - +
    NameTypeAttributesDefaultDescription
    + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - - - + + + - + - + - + - + - + + + +
    NameTypeArgumentDefaultDescription
    method @@ -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.

    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    + + +
    - - - - - +
    + + - - - + - - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    + + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Request.poll.html b/documentation/jsapi/LuCI.Request.poll.html index 06c700dc4..656f91152 100644 --- a/documentation/jsapi/LuCI.Request.poll.html +++ b/documentation/jsapi/LuCI.Request.poll.html @@ -1,285 +1,1305 @@ - + - JSDoc: Class: poll - - - + Class: poll + + + + + - - + + + + + + + + - -
    - -

    Class: poll

    - +
    + +
    +

    Class: poll

    +
    - +
    +

    + LuCI.Request. -

    - LuCI.Request.poll

    - -

    The Request.poll class provides some convience wrappers around + poll + + +

    The Request.poll class provides some convience wrappers around LuCI.Poll mainly to simplify registering repeating HTTP request calls as polling functions.

    - -
    +
    + + +
    +
    +

    + + new LuCI.Request.poll() +

    + + +
    + luci.js, line 881 +
    + +
    + +
    +
    + + - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - - - - - - - - + + + + + +

    Methods

    - +
    - +
    +
    +

    + + active() +

    + +
    + luci.js, line 985 +
    + +
    -

    active()

    +
    +
    - + +
    +

    Alias for LuCI.Poll.active().

    +
    - - -
    -

    Alias for LuCI.Poll.active().

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - +
    +
    +

    + + add(interval, url, options, callback){function} +

    + +
    + luci.js, line 924 +
    + +
    -

    add(interval, url, optionsopt, callbackopt) → {function}

    +
    +
    - - - - -
    -

    Register a repeating HTTP request with an optional callback +

    +

    Register a repeating HTTP request with an optional callback to invoke whenever a response for the request is received.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - - - - - -
    NameTypeAttributesDescription
    NameTypeDescription
    interval @@ -288,29 +1308,26 @@ to invoke whenever a response for the request is received.

    - - - - - -

    The poll interval in seconds.

    + + + + + + +

    The poll interval in seconds.

    url @@ -319,29 +1336,26 @@ to invoke whenever a response for the request is received.

    - - - - - -

    The URL to request on each poll.

    + + + + + + +

    The URL to request on each poll.

    options @@ -350,31 +1364,28 @@ to invoke whenever a response for the request is received.

    - - <optional>
    - - - - - -

    Additional options to configure the request.

    + + + optional + + + + + +

    Additional options to configure the request.

    callback @@ -383,89 +1394,63 @@ to invoke whenever a response for the request is received.

    - - <optional>
    - - - - - -

    Callback function to -invoke for each HTTP reply.

    - - - - - - + + + + optional + + + + + +

    Callback function to +invoke for each HTTP reply.

    + + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - -
    Throws:
    - - + + + +
    Throws:
    + +
    @@ -473,7 +1458,6 @@ invoke for each HTTP reply.

    Throws TypeError when an invalid interval was passed.

    -
    @@ -487,95 +1471,103 @@ invoke for each HTTP reply.

    -
    - - - -
    Returns:
    - -
    -

    Returns the internally created poll function.

    -
    - + + +
    Returns:
    + -
    -
    - Type -
    -
    + + + -function - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + function + + + Returns the internally created poll function.
    - - - + + + +
    - +
    +
    +

    + + remove(entry){boolean} +

    + +
    + luci.js, line 961 +
    + +
    -

    remove(entry) → {boolean}

    +
    +
    - - - - -
    -

    Remove a polling request that has been previously added using add(). +

    +

    Remove a polling request that has been previously added using add(). This function is essentially a wrapper around LuCI.Poll.remove().

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    entry @@ -584,341 +1576,293 @@ This function is essentially a wrapper around

    The poll function returned by add().

    + +

    The poll function returned by add().

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if any function has been removed, else false.

    -
    - - - -
    -
    - Type -
    -
    + + + -boolean - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + boolean + + + Returns true if any function has been removed, else false.
    - - - + + + +
    - +
    +
    +

    + + start() +

    + +
    + luci.js, line 969 +
    + +
    -

    start()

    +
    +
    - + +
    +

    Alias for LuCI.Poll.start().

    +
    - - -
    -

    Alias for LuCI.Poll.start().

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + + + - - - - - - - - - - -
    Source:
    -
    - - -
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - +
    +
    +

    + + stop() +

    + +
    + luci.js, line 977 +
    + +
    -

    stop()

    +
    +
    - + +
    +

    Alias for LuCI.Poll.stop().

    +
    - - -
    -

    Alias for LuCI.Poll.stop().

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - - - + + + + + + +
    +
    + +

    Type Definitions

    - +
    - +
    +
    +

    + + callbackFn(res, data, duration) +

    + +
    + luci.js, line 882 +
    + +
    -

    callbackFn(res, data, duration)

    +
    +
    - - - - -
    -

    The callback function is invoked whenever an HTTP reply to a +

    +

    The callback function is invoked whenever an HTTP reply to a polled request is received or when the polled request timed out.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    res @@ -927,21 +1871,21 @@ out.

    The HTTP response object.

    + +

    The HTTP response object.

    data @@ -950,22 +1894,22 @@ out.

    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 @@ -974,106 +1918,80 @@ else null.

    The total duration of the request in milliseconds.

    + +

    The total duration of the request in milliseconds.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + + + +
    - - - - - - - - - - - - - - - - - +
    + + - - - + - - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    + + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Response.html b/documentation/jsapi/LuCI.Response.html index fea8f79d9..a7398ef50 100644 --- a/documentation/jsapi/LuCI.Response.html +++ b/documentation/jsapi/LuCI.Response.html @@ -1,631 +1,1506 @@ - + - JSDoc: Class: Response - - - + Class: Response + + + + + - - + + + + + + + + - -
    - -

    Class: Response

    - +
    +
    - - - - - - - + + + + +

    Members

    - +
    -

    duration :number

    - - - - -
    -

    The total duration of the HTTP request in milliseconds

    -
    - - - -
    Type:
    -
      -
    • - -number - - -
    • -
    - - - - - +
    +
    +

    durationnumber

    +
    + + +
    +
    + +
    +

    The total duration of the HTTP request in milliseconds

    +
    + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    - - - - + + +
    -

    headers :LuCI.Headers

    - - - - -
    -

    The HTTP headers of the response

    -
    - - - -
    Type:
    - - - - - - +
    +
    +

    headersLuCI.Headers

    +
    + + +
    +
    + +
    +

    The HTTP headers of the response

    +
    + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    - - - - + + +
    -

    ok :boolean

    - - - - -
    -

    Describes whether the response is successful (status codes 200..299) or not

    -
    - - - -
    Type:
    -
      -
    • - -boolean - - -
    • -
    - - - - - +
    +
    +

    okboolean

    +
    + + +
    +
    + +
    +

    Describes whether the response is successful (status codes 200..299) or not

    +
    + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    - - - - - - - -

    status :number

    - - - - -
    -

    The numeric HTTP status code of the response

    -
    - - - -
    Type:
    -
      -
    • - -number - - -
    • -
    - - - - - -
    - - +
    + + +
    +
    +

    statusnumber

    +
    - - +
    +
    - +
    +

    The numeric HTTP status code of the response

    +
    - - - +
    - + - - -
    Source:
    -
    - - - + + + + + + + + + +
    - - - - + + +
    -

    statusText :string

    - - - - -
    -

    The HTTP status description message of the response

    -
    - - - -
    Type:
    -
      -
    • - -string - - -
    • -
    - - - - - +
    +
    +

    statusTextstring

    +
    + + +
    +
    + +
    +

    The HTTP status description message of the response

    +
    + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    - - - - + + +
    -

    url :string

    - - - - -
    -

    The final URL of the request, i.e. after following redirects.

    -
    - - - -
    Type:
    -
      -
    • - -string - - -
    • -
    - - - - - +
    +
    +

    urlstring

    +
    + + +
    +
    + +
    +

    The final URL of the request, i.e. after following redirects.

    +
    + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    - - - - - - + +
    +
    + +

    Methods

    - +
    - +
    +
    +

    + + clone(content){LuCI.Response} +

    + +
    + luci.js, line 465 +
    + +
    -

    clone(contentopt) → {LuCI.Response}

    +
    +
    - - - - -
    -

    Clones the given response object, optionally overriding the content +

    +

    Clones the given response object, optionally overriding the content of the cloned instance.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    The cloned Response instance.

    -
    - - - -
    -
    - Type -
    -
    - -LuCI.Response - - -
    + +
    + + + + + + + +
    Returns:
    + - + + + + + + + + + + - + + + + +
    TypeDescription
    + + LuCI.Response + + + The cloned Response instance.
    -

    json() → {*}

    - +
    + + +
    +
    +

    + + json(){*} +

    + + +
    + luci.js, line 486 +
    + +
    + +
    +
    + + +
    +

    Access the response content as JSON data.

    +
    + -
    -

    Access the response content as JSON data.

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - -
    Throws:
    - - + + + +
    Throws:
    + +
    @@ -835,7 +1674,6 @@ using String() and treated as response text.

    Throws SyntaxError if the content isn't valid JSON.

    -
    @@ -849,176 +1687,169 @@ using String() and treated as response text.

    -
    - - - -
    Returns:
    - -
    -

    The parsed JSON data.

    -
    - + + +
    Returns:
    + -
    -
    - Type -
    -
    + + + -* - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + * + + + The parsed JSON data.
    - - - + + + +
    - +
    +
    +

    + + text(){string} +

    + +
    + luci.js, line 501 +
    + +
    -

    text() → {string}

    +
    +
    - + +
    +

    Access the response content as string.

    +
    - - -
    -

    Access the response content as string.

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    The response content.

    -
    - - - -
    -
    - Type -
    -
    + + + -string - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + string + + + The response content.
    - - - - - + + +
    +
    + + + + - - - + - - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    + + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.XHR.html b/documentation/jsapi/LuCI.XHR.html index b82f2a0fb..5a17dfa85 100644 --- a/documentation/jsapi/LuCI.XHR.html +++ b/documentation/jsapi/LuCI.XHR.html @@ -1,509 +1,1492 @@ - + - JSDoc: Class: XHR - - - + Class: XHR + + + + + - - + + + + + + + + - -
    - -

    Class: XHR

    - +
    + +
    +

    Class: XHR

    +
    - +
    +

    + LuCI. -

    - LuCI.XHR()

    - -

    The LuCI.XHR class is a legacy compatibility shim for the + XHR + + +

    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.

    - -
    +
    + + + +
    +
    +

    + + new LuCI.XHR() +

    + + +
    + luci.js, line 2943 +
    +
    -

    Constructor

    +
    +
    + -

    new XHR()

    - - - - - - - - - - - - - - - - + + + +
    + + + + + - +
    Deprecated
    • Yes
    + + + + + + + + + + + + - - +
    - -
    Deprecated:
    • Yes
    - - - - + +
    -
    Source:
    -
    + + - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Methods

    - +
    - +
    +
    +

    + + abort() +

    + +
    + luci.js, line 3046 +
    + +
    -

    abort()

    +
    +
    - - - - -
    -

    Ignored for backwards compatibility.

    +
    +

    Ignored for backwards compatibility.

    This function does nothing.

    -
    - - - - - - - - - - - - +
    + + + + + + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - +
    +
    +

    + + busy(){boolean} +

    + +
    + luci.js, line 3035 +
    + +
    -

    busy() → {boolean}

    +
    +
    - + +
    +

    Checks the running state of the request.

    +
    - - -
    -

    Checks the running state of the request.

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if the request is still running or false if it -already completed.

    -
    - - - -
    -
    - Type -
    -
    + + + -boolean - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + 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.

    -
    - - - - - - - - - - - - +
    + + + + + + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - +
    +
    +

    + + get(url, data, callback, timeout){Promise.<null>} +

    + +
    + luci.js, line 2978 +
    + +
    -

    get(url, dataopt, callbackopt, timeoutopt) → {Promise.<null>}

    +
    +
    - - - - -
    -

    This function is a legacy wrapper around +

    +

    This function is a legacy wrapper around LuCI.get().

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    url @@ -512,29 +1495,26 @@ finishes or timed out.

    - - - - - -

    The URL to request

    + + + + + + +

    The URL to request

    data @@ -543,31 +1523,28 @@ finishes or timed out.

    - - <optional>
    - - - - - -

    Additional query string data

    + + + optional + + + + + +

    Additional query string data

    callback @@ -576,31 +1553,28 @@ finishes or timed out.

    - - <optional>
    - - - - - -

    Callback function to invoke on completion

    + + + optional + + + + + +

    Callback function to invoke on completion

    timeout @@ -609,168 +1583,153 @@ finishes or timed out.

    - - <optional>
    - - - - - -

    Request timeout to use

    + + + optional + + + + + +

    Request timeout to use

    - - - - - - + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - - - -
    -
    - Type -
    -
    - -Promise.<null> - - -
    - - - - - - - + -

    post(url, dataopt, callbackopt, timeoutopt) → {Promise.<null>}

    - - - - -
    -

    This function is a legacy wrapper around -LuCI.post().

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + Promise.<null> + + +
    + + + + +
    - Attributes + +
    +
    +

    + + post(url, data, callback, timeout){Promise.<null>} +

    + - +
    + luci.js, line 3005 +
    +
    - Description - - + +
    +
    + + +
    +

    This function is a legacy wrapper around +LuCI.post().

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeDescription
    url @@ -779,29 +1738,26 @@ finishes or timed out.

    - - - - - -

    The URL to request

    + + + + + + +

    The URL to request

    data @@ -810,31 +1766,28 @@ finishes or timed out.

    - - <optional>
    - - - - - -

    Additional data to append to the request body.

    + + + optional + + + + + +

    Additional data to append to the request body.

    callback @@ -843,31 +1796,28 @@ finishes or timed out.

    - - <optional>
    - - - - - -

    Callback function to invoke on completion

    + + + optional + + + + + +

    Callback function to invoke on completion

    timeout @@ -876,199 +1826,167 @@ finishes or timed out.

    - - <optional>
    - - - - - -

    Request timeout to use

    + + + optional + + + + + +

    Request timeout to use

    - - - - - - + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - - - -
    -
    - Type -
    -
    + + + -Promise.<null> - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<null> + + +
    - - - + + + +
    - +
    +
    +

    + + send_form() +

    + +
    + luci.js, line 3061 +
    + +
    -

    send_form()

    +
    +
    - - - - -
    -

    Existing for backwards compatibility.

    +
    +

    Existing for backwards compatibility.

    This function simply throws an InternalError when invoked.

    -
    - - - - - - - - - - - - +
    + + + + + + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + - - - - - - - - - - -
    Throws:
    - - + + + +
    Throws:
    + +
    @@ -1077,7 +1995,6 @@ finishes or timed out.

    when invoked.

    -
    @@ -1091,44 +2008,40 @@ when invoked.

    -
    - - - - - - - - + + + +
    +
    + + + + - - - + - - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    + + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.dom.html b/documentation/jsapi/LuCI.dom.html index b98c8f0a6..8412eb302 100644 --- a/documentation/jsapi/LuCI.dom.html +++ b/documentation/jsapi/LuCI.dom.html @@ -1,195 +1,1232 @@ - + - JSDoc: Class: dom - - - + Class: dom + + + + + - - + + + + + + + + - -
    - -

    Class: dom

    - +
    + +
    +

    Class: dom

    +
    - +
    +

    + LuCI. -

    - LuCI.dom

    - -

    The dom class provides convenience method for creating and + dom + + +

    The dom class provides convenience method for creating and manipulating DOM elements.

    - -
    +
    + + +
    +
    +

    + + new LuCI.dom() +

    + + +
    + luci.js, line 2065 +
    + +
    + +
    +
    + + - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - - - - - - - - + + + + + +

    Methods

    - +
    - +
    +
    +

    + + append(node, children){Node|null} +

    + +
    + luci.js, line 2216 +
    + +
    -

    append(node, childrenopt) → {Node|null}

    +
    +
    - + +
    +

    Appends the given children data to the given node.

    +
    - - -
    -

    Appends the given children data to the given node.

    -
    - - - - - - - - - -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - -
    - - - - - - - - - - - - +
    - + - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    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:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + 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.
    + + + + +
    - Attributes + +
    +
    +

    + + attr(node, key, val) +

    + - +
    + luci.js, line 2331 +
    +
    - Description - - + +
    +
    + + +
    +

    Sets attributes or registers event listeners on element nodes.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - +
    +
    +

    + + bindClassInstance(node, inst){Class} +

    + +
    + luci.js, line 2565 +
    + +
    -

    bindClassInstance(node, inst) → {Class}

    +
    +
    - - - - -
    -

    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:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    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.

    The Class instance to bind to the node.

    + +

    The Class instance to bind to the node.

    - - - - - - -
    - - - - - - +
    - + - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - + + + + + + +
    + + -
    Throws:
    + - + + + +
    Throws:
    + +
    @@ -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.

    -
    - + + +
    Returns:
    + -
    -
    - Type -
    -
    + + + -Class - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Class + + + Returns the bound class instance.
    - - - + + + +
    - +
    +
    +

    + + callClassMethod(node, method, params){*|null} +

    + +
    + luci.js, line 2619 +
    + +
    -

    callClassMethod(node, method, …params) → {*|null}

    +
    +
    - - - - -
    -

    Finds a bound class instance on the given node itself or the +

    +

    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.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    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:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + * + | + + 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.
    + + + + +
    - Attributes + +
    +
    +

    + + content(node, children){Node|null} +

    + - +
    + luci.js, line 2283 +
    +
    - Description - - + +
    +
    + + +
    +

    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.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - + + + -
    -

    Returns the last children Node appended to the node or null +

    + + + + + + + + + + + +
    TypeDescription
    + + 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.

    - - - - -
    -
    - Type -
    -
    - -Node -| - -null - - -
    -
    - +children was null or didn't result in further DOM nodes.
    - - - + + + +
    - +
    +
    +

    + + create(html, attr, data){Node} +

    + +
    + luci.js, line 2409 +
    + +
    -

    create(html, attropt, dataopt) → {Node}

    +
    +
    - - - - -
    -

    Creates a new DOM Node from the given html, attr and +

    +

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - + + + + + + + +
    -
    Source:
    -
    - -
    - - - - - - - - - - - - - -
    Throws:
    - - + +
    Throws:
    + +
    @@ -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 the newly created Node.

    -
    - + + +
    Returns:
    + -
    -
    - Type -
    -
    + + + -Node - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + 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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the get or set value, or null when no value could -be found.

    -
    - - - -
    -
    - Type -
    -
    - -* - - -
    + +
    - - - - - - - + -

    elem(e) → {boolean}

    - + + + +
    Returns:
    + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + * + + + Returns the get or set value, or null when no value could +be found.
    -
    -

    Tests whether the given argument is a valid DOM Node.

    -
    - - - - - - - - - -
    Parameters:
    + + +
    - - - - - - - - + +
    +
    +

    + + elem(e){boolean} +

    + - +
    + luci.js, line 2079 +
    +
    -
    - - + + +
    + + +
    +

    Tests whether the given argument is a valid DOM Node.

    +
    + -
    + + + + + +
    NameTypeDescription
    + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    e @@ -1884,158 +2754,144 @@ be found.

    The value to test.

    + +

    The value to test.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if the value is a DOM Node, else false.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    + +
    - - - - - - - + -

    findClassInstance(node) → {Class|null}

    - - - - -
    -

    Finds a bound class instance on the given node itself or the -first bound instance on its closest parent node.

    -
    - - - - - - - - - -
    Parameters:
    + + +
    Returns:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + boolean + + + Returns true if the value is a DOM Node, else false.
    - + + + + + +
    +
    +

    + + findClassInstance(node){Class|null} +

    + + +
    + luci.js, line 2585 +
    + +
    - Description - - + +
    +
    + + +
    +

    Finds a bound class instance on the given node itself or the +first bound instance on its closest parent node.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    node @@ -2044,167 +2900,151 @@ first bound instance on its closest parent node.

    The DOM Node instance to start from.

    + +

    The DOM Node instance to start from.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the founds class instance if any or null if no bound -class could be found on the node itself or any of its parents.

    -
    - - - -
    -
    - Type -
    -
    + + + -Class -| - -null - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Class + | + + null + + + Returns the founds class instance if any or null if no bound +class could be found on the node itself or any of its parents.
    - - - + + + +
    - +
    +
    +

    + + isEmpty(node, ignoreFn){boolean} +

    + +
    + luci.js, line 2665 +
    + +
    -

    isEmpty(node, ignoreFnopt) → {boolean}

    +
    +
    - - - - -
    -

    Tests whether a given DOM Node instance is empty or appears +

    +

    Tests whether a given DOM Node instance is empty or appears empty.

    Any element child nodes which have the CSS class hidden set or for which the optionally passed ignoreFn callback function returns false are ignored.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    node @@ -2213,29 +3053,26 @@ returns false are ignored.

    - - - - - -

    The DOM Node instance to test.

    + + + + + + +

    The DOM Node instance to test.

    ignoreFn @@ -2244,176 +3081,157 @@ returns false are ignored.

    - - <optional>
    - - - - - -

    Specifies an optional function which is invoked for each child +

    + + + optional + + + + + +

    Specifies an optional function which is invoked for each child node to decide whether the child node should be ignored or not.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - + + + -
    -

    Returns true if the node does not have any children or if +

    + + + + + + + + + + + +
    TypeDescription
    + + 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.

    - - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - +result when testing it using the given ignoreFn.
    - - - + + + +
    - +
    +
    +

    + + matches(node, selector){boolean} +

    + +
    + luci.js, line 2140 +
    + +
    -

    matches(node, selectoropt) → {boolean}

    +
    +
    - - - - -
    -

    Tests whether a given Node matches the given query selector.

    +
    +

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    + + + + + - - - - - - - - - + + + + + +
    + -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - +
    Returns:
    + -
    Returns:
    + + + -
    -

    Returns true if the given node matches the specified selector +

    + + + + + + + + + + + +
    TypeDescription
    + + 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.

    - - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - +selector didn't match.
    - - - + + + +
    - +
    +
    +

    + + 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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    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:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + 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 +
    + +
    - Description - - + +
    +
    + + +
    +

    Parses a given string as HTML and returns the first child node.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the first DOM Node extracted from the HTML fragment or -null on parsing failures or if no element could be found.

    -
    - - - -
    -
    - Type -
    -
    + + + -Node - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Node + + + Returns the first DOM Node extracted from the HTML fragment or +null on parsing failures or if no element could be found.
    - - - - - + + +
    +
    + +

    Type Definitions

    - +
    - +
    +
    +

    + + ignoreCallbackFn(node){boolean} +

    + +
    + luci.js, line 2628 +
    + +
    -

    ignoreCallbackFn(node) → {boolean}

    +
    +
    - - - - -
    -

    The ignore callback function is invoked by isEmpty() for each +

    +

    The ignore callback function is invoked by isEmpty() for each child node to decide whether to ignore a child node or not.

    When this function returns false, the node passed to it is ignored, else not.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    node @@ -3008,128 +3770,109 @@ ignored, else not.

    The child node to test.

    + +

    The child node to test.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Boolean indicating whether to ignore the node or not.

    -
    - - - -
    -
    - Type -
    -
    + + + -boolean - - - - - + + + + + - - - - - + + + + + + +
    TypeDescription
    + boolean + + + Boolean indicating whether to ignore the node or not.
    - + + +
    - +
    + + + + + + -
    - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    + + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.fs.html b/documentation/jsapi/LuCI.fs.html index abae649cb..cfc0dc9ce 100644 --- a/documentation/jsapi/LuCI.fs.html +++ b/documentation/jsapi/LuCI.fs.html @@ -1,156 +1,1200 @@ - + - JSDoc: Class: fs - - - + Class: fs + + + + + - - + + + + + + + + - -
    - -

    Class: fs

    - +
    + +
    +

    Class: fs

    +
    - +
    +

    + LuCI. -

    - LuCI.fs

    - -

    Provides high level utilities to wrap file system related RPC calls. + fs + + +

    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(...).

    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - -
    - + +
    +
    - - - + +
    +
    +

    + + new LuCI.fs() +

    + +
    + fs.js, line 111 +
    + +
    - +
    +
    - - - - - -
    Source:
    -
    - - +
    + + + + + + + + + + + + + + + + + +
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - - - - - - - - + + + + + +

    Methods

    - +
    - +
    +
    +

    + + exec(command, params, env){Promise.<LuCI.fs.FileExecResult>} +

    + +
    + fs.js, line 232 +
    + +
    -

    exec(command, paramsopt, envopt) → {Promise.<LuCI.fs.FileExecResult>}

    +
    +
    - - - - -
    -

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - <optional>
    - - - - - -

    Environment variables to set.

    + + + optional + + + + + +

    Environment variables to set.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to an object describing the execution -results or rejecting with an error stating the failure reason.

    -
    - - - -
    -
    - Type -
    -
    + + + -Promise.<LuCI.fs.FileExecResult> - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<LuCI.fs.FileExecResult> + + + Returns a promise resolving to an object describing the execution +results or rejecting with an error stating the failure reason.
    - - - + + + +
    - +
    +
    +

    + + lines(path){Promise.<Array.<string>>} +

    + +
    + fs.js, line 281 +
    + +
    -

    lines(path) → {Promise.<Array.<string>>}

    +
    +
    - - - - -
    -

    Read the contents of the given file, split it into lines, trim +

    +

    Read the contents of the given file, split it into lines, trim leading and trailing white space of each line and return the resulting array.

    This function is guaranteed to not reject its promises, on failure, an empty array will be returned.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    path @@ -444,319 +1458,291 @@ an empty array will be returned.

    The file path to read.

    + +

    The file path to read.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to an array containing the stripped lines -of the given file or [] on failure.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<Array.<string>> - - -
    + +
    - - - - - - - + -

    list(path) → {Promise.<Array.<LuCI.fs.FileStatEntry>>}

    - - - - -
    -

    Obtains a listing of the specified directory.

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - - - - - - - - - - - - - - - - - + -
    NameTypeDescription
    path - -string - - - + Promise.<Array.<string>> + +

    The directory path to list.

    Returns a promise resolving to an array containing the stripped lines +of the given file or [] on failure.
    - - - - - -
    - - - - - - - - - - - +
    + + +
    +
    +

    + + list(path){Promise.<Array.<LuCI.fs.FileStatEntry>>} +

    + +
    + fs.js, line 132 +
    + +
    - +
    +
    - - +
    +

    Obtains a listing of the specified directory.

    +
    -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to an array of stat detail objects or -rejecting with an error stating the failure reason.

    -
    - - - -
    -
    - Type -
    -
    -Promise.<Array.<LuCI.fs.FileStatEntry>> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    path + + +string - - + + + +

    The directory path to list.

    + + + +
    - - - - - - - - -

    read(path) → {Promise.<string>}

    + + + + + + + + + + + + + + +
    + + + -
    -

    Read the contents of the given file and return them. -Note: this function is unsuitable for obtaining binary data.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + Promise.<Array.<LuCI.fs.FileStatEntry>> + + + Returns a promise resolving to an array of stat detail objects or +rejecting with an error stating the failure reason.
    - + + + +
    + +
    +
    +

    + + read(path){Promise.<string>} +

    + + +
    + fs.js, line 161 +
    + +
    - Description - - + +
    +
    + + +
    +

    Read the contents of the given file and return them. +Note: this function is unsuitable for obtaining binary data.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    path @@ -765,158 +1751,144 @@ Note: this function is unsuitable for obtaining binary data.

    The file path to read.

    + +

    The file path to read.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to a string containing the file contents or -rejecting with an error stating the failure reason.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<string> - - -
    + +
    - - - - - - - + -

    remove(The) → {Promise.<number>}

    - - - - -
    -

    Unlink the given file.

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + Promise.<string> + + + Returns a promise resolving to a string containing the file contents or +rejecting with an error stating the failure reason.
    - + + + +
    + +
    +
    +

    + + remove(The){Promise.<number>} +

    + + +
    + fs.js, line 203 +
    + +
    - Description - - + +
    +
    + + +
    +

    Unlink the given file.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    The @@ -925,158 +1897,144 @@ rejecting with an error stating the failure reason.

    file path to remove.

    + +

    file path to remove.

    - - - - - - -
    - - - - - - +
    - + - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to 0 or rejecting with an error stating -the failure reason.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<number> - - -
    -
    - - - - - - - - - - -

    stat(path) → {Promise.<LuCI.fs.FileStatEntry>}

    - + +
    + + + -
    -

    Return file stat information on the specified path.

    -
    - - - - - - - - - -
    Parameters:
    + + + + + +
    Returns:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + Promise.<number> + + + Returns a promise resolving to 0 or rejecting with an error stating +the failure reason.
    - + + + +
    + +
    +
    +

    + + stat(path){Promise.<LuCI.fs.FileStatEntry>} +

    + + +
    + fs.js, line 146 +
    + +
    - Description - - + +
    +
    + + +
    +

    Return file stat information on the specified path.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    path @@ -1085,164 +2043,150 @@ the failure reason.

    The filesystem path to stat.

    + +

    The filesystem path to stat.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to a stat detail object or -rejecting with an error stating the failure reason.

    -
    - - - -
    -
    - Type -
    -
    + + + -Promise.<LuCI.fs.FileStatEntry> - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<LuCI.fs.FileStatEntry> + + + Returns a promise resolving to a stat detail object or +rejecting with an error stating the failure reason.
    - - - + + + +
    - +
    +
    +

    + + trimmed(path){Promise.<string>} +

    + +
    + fs.js, line 260 +
    + +
    -

    trimmed(path) → {Promise.<string>}

    +
    +
    - - - - -
    -

    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:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    path @@ -1251,164 +2195,148 @@ an empty string will be returned.

    The file path to read.

    + +

    The file path to read.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to the file contents or the empty string -on failure.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<string> - - -
    + +
    + + + + + + + +
    Returns:
    + - + + + + + + + + + + - + + + + +
    TypeDescription
    + + Promise.<string> + + + Returns a promise resolving to the file contents or the empty string +on failure.
    -

    write(path, dataopt, modeopt) → {Promise.<number>}

    - +
    + + +
    +
    +

    + + write(path, data, mode){Promise.<number>} +

    + + +
    + fs.js, line 187 +
    + +
    - -
    -

    Write the given data to the specified file path. + +

    +
    + + +
    +

    Write the given data to the specified file path. If the specified file path does not exist, it will be created, given sufficient permissions.

    Note: data will be converted to a string using String(data) or to '' when it is null.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + + - + - - - - - + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    path @@ -1417,29 +2345,26 @@ sufficient permissions.

    - - - - - -

    The file path to write to.

    + + + + + + +

    The file path to write to.

    data @@ -1448,32 +2373,29 @@ sufficient permissions.

    - - <optional>
    - - - - - -

    The file data to write. If it is null, it will be set to an empty +

    + + + optional + + + + + +

    The file data to write. If it is null, it will be set to an empty string.

    mode @@ -1482,175 +2404,148 @@ string.

    - - <optional>
    - - - - - -

    The permissions to use on file creation. Default is 420 (0644).

    + + + optional + + + + + +

    The permissions to use on file creation. Default is 420 (0644).

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to 0 or rejecting with an error stating -the failure reason.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<number> - - -
    + +
    - - - - - - -

    Type Definitions

    - - - -

    FileExecResult

    - - - - - - -
    Type:
    -
      -
    • - -Object - - -
    • -
    - - - - - -
    Properties:
    + + + + +
    Returns:
    + - + +
    - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + Promise.<number> + + + Returns a promise resolving to 0 or rejecting with an error stating +the failure reason.
    + + + + + + + + + + +

    Type Definitions

    + +
    + +
    +
    +

    LuCI.fs.FileExecResultObject

    +
    + + +
    +
    + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - + + + +
    NameTypeArgumentDescription
    code @@ -1659,27 +2554,27 @@ the failure reason.

    - +

    The exit code of the invoked command

    stdout @@ -1688,29 +2583,29 @@ the failure reason.

    <optional>
    - +

    The stdout produced by the command, if any

    stderr @@ -1719,126 +2614,98 @@ the failure reason.

    <optional>
    - +

    The stderr produced by the command, if any

    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    - - - - + + +
    -

    FileStatEntry

    - - - - - - -
    Type:
    -
      -
    • - -Object - - -
    • -
    - - - - - -
    Properties:
    - +
    +
    +

    LuCI.fs.FileStatEntryObject

    +
    + + +
    +
    + + + +
    - - - - - - - - - - - +
    Properties:
    +
    -
    - - - - - - +
    NameTypeDescription
    + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - + + + +
    NameTypeDescription
    name @@ -1847,21 +2714,21 @@ the failure reason.

    Name of the directory entry

    type @@ -1870,21 +2737,21 @@ the failure reason.

    Type of the entry, one of block, char, directory, fifo, symlink, file, socket or unknown

    size @@ -1893,21 +2760,21 @@ the failure reason.

    Size in bytes

    mode @@ -1916,21 +2783,21 @@ the failure reason.

    Access permissions

    atime @@ -1939,21 +2806,21 @@ the failure reason.

    Last access time in seconds since epoch

    mtime @@ -1962,21 +2829,21 @@ the failure reason.

    Last modification time in seconds since epoch

    ctime @@ -1985,21 +2852,21 @@ the failure reason.

    Last change time in seconds since epoch

    inode @@ -2008,21 +2875,21 @@ the failure reason.

    Inode number

    uid @@ -2031,21 +2898,21 @@ the failure reason.

    Numeric owner id

    gid @@ -2054,90 +2921,67 @@ the failure reason.

    Numeric group id

    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    + + +
    - - - - - +
    + +
    -
    - - + -
    - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    +
    + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.html b/documentation/jsapi/LuCI.html index 44f899b35..68e2042c5 100644 --- a/documentation/jsapi/LuCI.html +++ b/documentation/jsapi/LuCI.html @@ -1,94 +1,1141 @@ - + - JSDoc: Class: LuCI - - - + Class: LuCI + + + + + - - + + + + + + + + +
    + + -
    @@ -798,75 +1745,74 @@ argument or copied from the given error instance.

    -
    + - - - - - - + + + + - +
    +
    +

    + + get(url, args, cb){Promise.<null>} +

    + +
    + luci.js, line 1918 +
    + +
    -

    get(url, argsopt, cb) → {Promise.<null>}

    +
    +
    - - - - -
    -

    Issues a GET request to the given url and invokes the specified +

    +

    Issues a GET request to the given url and invokes the specified callback function. The function is a wrapper around Request.request().

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    url @@ -875,29 +1821,26 @@ callback function. The function is a wrapper around - - - - - -

    The URL to request.

    + + + + + + +

    The URL to request.

    args @@ -906,31 +1849,28 @@ callback function. The function is a wrapper around - - <optional>
    - - - - - -

    Additional query string arguments to append to the URL.

    + + + optional + + + + + +

    Additional query string arguments to append to the URL.

    cb @@ -939,286 +1879,257 @@ callback function. The function is a wrapper around - - - - - -

    The callback function to invoke when the request finishes.

    + + + + + + +

    The callback function to invoke when the request finishes.

    - - - - - - + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to null when concluded.

    -
    - - - -
    -
    - Type -
    -
    + + + -Promise.<null> - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<null> + + + Returns a promise resolving to null when concluded.
    - - - + + + +
    - +
    +
    +

    + + halt(){boolean} +

    + +
    + luci.js, line 2040 +
    + +
    -

    halt() → {boolean}

    +
    +
    - + +
    +

    Deprecated wrapper around Poll.stop().

    +
    - - -
    -

    Deprecated wrapper around Poll.stop().

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true when the polling loop has been stopped or false -when it didn't run to begin with.

    -
    - - - -
    -
    - Type -
    -
    + + + -boolean - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + boolean + + + Returns true when the polling loop has been stopped or false +when it didn't run to begin with.
    - - - + + + +
    - +
    +
    +

    + + hasSystemFeature(feature, subfeature){boolean|null} +

    + +
    + luci.js, line 1574 +
    + +
    -

    hasSystemFeature(feature, subfeatureopt) → {boolean|null}

    +
    +
    - - - - -
    -

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - -
    - - - - - - - - - - - - - - +
    - + - - -
    Source:
    -
    - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    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:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + 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.
    + + + + +
    - Attributes + +
    +
    +

    + + isObject(val){boolean} +

    + - +
    + luci.js, line 1765 +
    +
    - Description - - + +
    +
    + + +
    +

    Tests whether the passed argument is a JavaScript object. +This function is meant to be an object counterpart to the +standard Array.isArray() function.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + +
    NameTypeDescription
    val @@ -1440,283 +2329,254 @@ standard Array.isArray() function.

    - - <optional>
    - - - - - -

    The value to test

    + + + optional + + + + + +

    The value to test

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if the given value is of type object and -not null, else returns false.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    + +
    + + + + + + + +
    Returns:
    + - + + + + + + + + + + - + + + + +
    TypeDescription
    + + boolean + + + Returns true if the given value is of type object and +not null, else returns false.
    -

    location() → {string}

    - +
    - - -
    -

    Return the complete URL path to the current view.

    -
    - - - - - - - - - - - - - -
    - + + +
    +
    +

    + + location(){string} +

    + +
    + luci.js, line 1745 +
    + +
    - +
    +
    - - +
    +

    Return the complete URL path to the current view.

    +
    - - - - - - - +
    -
    Source:
    -
    + - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the URL path to the current view.

    -
    - - - -
    -
    - Type -
    -
    - -string - - -
    + + + + + + + + + + + + + +
    - - - - - - - + -

    path(prefixopt, partsopt) → {string}

    - - - - -
    -

    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:
    + + +
    Returns:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + string + + + Returns the URL path to the current view.
    + + + + +
    - Attributes + +
    +
    +

    + + path(prefix, parts){string} +

    + - +
    + luci.js, line 1679 +
    +
    - Description - - + +
    +
    + + +
    +

    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.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Return the joined URL path.

    -
    - - - -
    -
    - Type -
    -
    - -string - - -
    + +
    - - - - - - - + -

    poll(interval, url, argsopt, cb, postopt) → {function}

    - - - - -
    -

    Register a polling HTTP request that invokes the specified -callback function. The function is a wrapper around -Request.poll.add().

    -
    - - - - - - - - - -
    Parameters:
    + + +
    Returns:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + string + + + Return the joined URL path.
    - - Attributes - + + + +
    - Default + +
    +
    +

    + + poll(interval, url, args, cb, post){function} +

    + + +
    + luci.js, line 1988 +
    +
    - Description - - + +
    +
    + + +
    +

    Register a polling HTTP request that invokes the specified +callback function. The function is a wrapper around +Request.poll.add().

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + + - - - - - + + + - + - - - - - - + + - - - + + + - + - - - - - - - - - + + + - + - - - - - - + + - - - + + + - + - - - - - - - - - + + +
    NameTypeDefaultDescription
    interval @@ -1934,36 +2772,33 @@ 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.

    - - - - - - + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - + + + -
    -

    Returns the internally created function that has been passed to +

    + + + + + + + + + + + +
    TypeDescription
    + + 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.

    - - - - -
    -
    - Type -
    -
    - -function - - -
    -
    - +polling request.
    - - - + + + +
    - +
    +
    +

    + + post(url, args, cb){Promise.<null>} +

    + +
    + luci.js, line 1946 +
    + +
    -

    post(url, argsopt, cb) → {Promise.<null>}

    +
    +
    - - - - -
    -

    Issues a POST request to the given url and invokes the specified +

    +

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - - + + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    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:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + Promise.<null> + + + Returns a promise resolving to null when concluded.
    - - Attributes - + + + +
    - Default + +
    +
    +

    + + raise(type, fmt, args) +

    + + +
    + luci.js, line 1234 +
    +
    - Description - - + +
    +
    + + +
    +

    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.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + - + - - - - - - - - - + + + - + - - - - - - + + - - - + + +
    NameTypeDefaultDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - -
    Throws:
    - - + + + +
    Throws:
    + +
    @@ -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:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
    NameTypeDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - -
    Throws:
    -
      -
    • + + + +
      Throws:
      +
        +
      • @@ -2864,7 +3591,6 @@ file from.

        circular dependencies.

        -
        @@ -2878,12 +3604,11 @@ circular dependencies.

    -
    - -
  • + +
  • @@ -2892,7 +3617,6 @@ circular dependencies.

    call failed.

    -
    @@ -2906,12 +3630,11 @@ call failed.

    -
  • - -
  • + +
  • @@ -2920,7 +3643,6 @@ call failed.

    be interpreted by eval.

    -
    @@ -2934,12 +3656,11 @@ be interpreted by eval.

    -
  • - -
  • + +
  • @@ -2949,7 +3670,6 @@ interpreted, but when invoking its code did not yield a valid class instance.

    -
    @@ -2963,94 +3683,102 @@ class instance.

    -
  • - - - -
    Returns:
    - - -
    -

    Returns the instantiated class.

    -
    - + + + +
    Returns:
    + -
    -
    - Type -
    -
    + + + -Promise.<LuCI#Class> - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<LuCI#Class> + + + Returns the instantiated class.
    - - - + + + +
    - +
    +
    +

    + + resolveDefault(value, defvalue){Promise.<*>} +

    + +
    + luci.js, line 1873 +
    + +
    -

    resolveDefault(value, defvalue) → {Promise.<*>}

    +
    +
    - - - - -
    -

    Returns a promise resolving with either the given value or or with +

    +

    Returns a promise resolving with either the given value or or with the given default in case the input value is a rejecting promise.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + +
    NameTypeDescription
    NameTypeDescription
    value @@ -3059,21 +3787,21 @@ the given default in case the input value is a rejecting promise.

    The value to resolve the promise with.

    + +

    The value to resolve the promise with.

    defvalue @@ -3082,165 +3810,149 @@ the given default in case the input value is a rejecting promise.

    The default value to resolve the promise with in case the given + +

    + +

    The default value to resolve the promise with in case the given input value is a rejecting promise.

    - - - - - - -
    - - - - - - - - - - - - - - +
    - + - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a new promise resolving either to the given input value or -to the given default value on error.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<*> - - -
    + + + + + + + + + +
    + + + + + + + +
    Returns:
    + - + + + + + + + + + + - + + + + +
    TypeDescription
    + + Promise.<*> + + + Returns a new promise resolving either to the given input value or +to the given default value on error.
    -

    resource(partsopt) → {string}

    - +
    + + +
    +
    +

    + + resource(parts){string} +

    + + +
    + luci.js, line 1732 +
    + +
    - -
    -

    Construct an URL path relative to the global static resource path + +

    +
    + + +
    +

    Construct an URL path relative to the global static resource path of the LuCI ui (usually /luci-static/resources).

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    parts @@ -3249,284 +3961,255 @@ as / for the path separator.

    - - <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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the resulting URL path.

    -
    - - - -
    -
    - Type -
    -
    + + + -string - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the resulting URL path.
    - - - + + + +
    - +
    +
    +

    + + run(){boolean} +

    + +
    + luci.js, line 2053 +
    + +
    -

    run() → {boolean}

    +
    +
    - - - - -
    -

    Deprecated wrapper around Poll.start().

    -
    - - - - - - - - - - - - - -
    - +
    +

    Deprecated wrapper around Poll.start().

    +
    - - - - - - -
    Deprecated:
    • Yes
    +
    - + - - - +
    Deprecated
    • Yes
    + + + + + + + + + + -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true when the polling loop has been started or false -when it was already running.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    - - - - - - - + -

    sortedKeys(obj, keyopt, sortmodeopt) → {Array.<string>}

    - - - - -
    -

    Return an array of sorted object keys, optionally sorted by -a different key or a different sorting mode.

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + boolean + + + Returns true when the polling loop has been started or false +when it was already running.
    + + + + +
    - Attributes + +
    +
    +

    + + sortedKeys(obj, key, sortmode){Array.<string>} +

    + - +
    + luci.js, line 1794 +
    +
    - Description - - + +
    +
    + + +
    +

    Return an array of sorted object keys, optionally sorted by +a different key or a different sorting mode.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns an array containing the sorted keys of the given object.

    -
    - - - -
    -
    - Type -
    -
    - -Array.<string> - - -
    + +
    - - - - - - - + -

    stop(entry) → {boolean}

    - - - - -
    -

    Deprecated wrapper around Poll.remove().

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + Array.<string> + + + Returns an array containing the sorted keys of the given object.
    - + + + +
    + +
    +
    +

    + + stop(entry){boolean} +

    + + +
    + luci.js, line 2027 +
    + +
    - Description - - + +
    +
    + + +
    +

    Deprecated wrapper around Poll.remove().

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    entry @@ -3774,165 +4434,151 @@ addresses or numeric values respectively.

    The polling function to remove.

    + +

    The polling function to remove.

    - - - - - - + + +
    - - + - - - +
    Deprecated
    • Yes
    + + - - -
    Deprecated:
    • Yes
    - - - - - -
    Source:
    -
    - - -
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true when the function has been removed or false if -it could not be found.

    -
    - - - -
    -
    - Type -
    -
    + + + -boolean - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + boolean + + + Returns true when the function has been removed or false if +it could not be found.
    - - - + + + +
    - +
    +
    +

    + + toArray(val){Array.<*>} +

    + +
    + luci.js, line 1839 +
    + +
    -

    toArray(val) → {Array.<*>}

    +
    +
    - - - - -
    -

    Converts the given value to an array. If the given value is of +

    +

    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:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    val @@ -3941,163 +4587,147 @@ space and returned as array.

    The value to convert into an array.

    + +

    The value to convert into an array.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the resulting array.

    -
    - - - -
    -
    - Type -
    -
    - -Array.<*> - - -
    + +
    - - - - - - - + -

    url(partsopt) → {string}

    - - - - -
    -

    Construct an URL pathrelative to the script path of the server -side LuCI application (usually /cgi-bin/luci).

    -

    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:
    + + +
    Returns:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + Array.<*> + + + Returns the resulting array.
    + + + + +
    - Attributes + +
    +
    +

    + + url(parts){string} +

    + - +
    + luci.js, line 1710 +
    +
    - Description - - + +
    +
    + + +
    +

    Construct an URL pathrelative to the script path of the server +side LuCI application (usually /cgi-bin/luci).

    +

    The resulting URL is guaranteed to only contain the characters +a-z, A-Z, 0-9, _, ., %, ,, ;, and - as well +as / for the path separator.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + +
    NameTypeDescription
    parts @@ -4106,176 +4736,159 @@ as / for the path separator.

    - - <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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the resulting URL path.

    -
    - - - -
    -
    - Type -
    -
    + + + -string - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the resulting URL path.
    - - - - - + + +
    +
    + +

    Type Definitions

    - +
    - +
    +
    +

    + + LuCI.requestCallbackFn(xhr, data, duration) +

    + +
    + luci.js, line 1877 +
    + +
    -

    requestCallbackFn(xhr, data, duration)

    +
    +
    - - - - -
    -

    The request callback function is invoked whenever an HTTP +

    +

    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:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + + + +
    - - - - - - - - - - - - - - - - - +
    + + - - - + - - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    + + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.rpc.html b/documentation/jsapi/LuCI.rpc.html index 9d548f3ad..557b97237 100644 --- a/documentation/jsapi/LuCI.rpc.html +++ b/documentation/jsapi/LuCI.rpc.html @@ -1,193 +1,1232 @@ - + - JSDoc: Class: rpc - - - + Class: rpc + + + + + - - + + + + + + + + - -
    - -

    Class: rpc

    - +
    + +
    +

    Class: rpc

    +
    - +
    +

    + LuCI. -

    - LuCI.rpc

    - -

    The LuCI.rpc class provides high level ubus JSON-RPC abstractions + rpc + + +

    The LuCI.rpc class provides high level ubus JSON-RPC abstractions and means for listing and invoking remove RPC methods.

    - -
    +
    + + +
    +
    +

    + + new LuCI.rpc() +

    + + +
    + rpc.js, line 8 +
    + +
    + +
    +
    + + - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - + + + + + + + +
    - - - - - - - - + + + + + +

    Methods

    - +
    - +
    +
    +

    + + addInterceptor(interceptorFn){LuCI.rpc~interceptorFn} +

    + +
    + rpc.js, line 454 +
    + +
    -

    addInterceptor(interceptorFn) → {LuCI.rpc~interceptorFn}

    +
    +
    - + +
    +

    Registers a new interceptor function.

    +
    - - -
    -

    Registers a new interceptor function.

    -
    - - - - - - - - - -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    interceptorFn @@ -196,158 +1235,144 @@ and means for listing and invoking remove RPC methods.

    The inteceptor function to register.

    + +

    The inteceptor function to register.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the given function value.

    -
    - - - -
    -
    - Type -
    -
    - -LuCI.rpc~interceptorFn - - -
    + +
    - - - - - - - + -

    declare(options) → {LuCI.rpc~invokeFn}

    - - - - -
    -

    Describes a remote RPC call procedure and returns a function -implementing it.

    -
    - - - - - - - - - -
    Parameters:
    + +
    Returns:
    + + - - - - - - - - + + + + + + + + + +
    NameTypeDescription
    + + LuCI.rpc~interceptorFn + + + Returns the given function value.
    + + + + +
    + + + +
    +
    +

    + + declare(options){LuCI.rpc~invokeFn} +

    + + +
    + rpc.js, line 292 +
    + +
    + + +
    +
    + + +
    +

    Describes a remote RPC call procedure and returns a function +implementing it.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
    NameTypeDescription
    options @@ -356,381 +1381,347 @@ implementing it.

    If any object names are given, this function will return the method + +

    + +

    If any object names are given, this function will return the method signatures of each given object.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a new function implementing the method call described in -options.

    -
    - - - -
    -
    - Type -
    -
    + + + -LuCI.rpc~invokeFn - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + LuCI.rpc~invokeFn + + + Returns a new function implementing the method call described in +options.
    - - - + + + +
    - +
    +
    +

    + + getBaseURL(){string} +

    + +
    + rpc.js, line 367 +
    + +
    -

    getBaseURL() → {string}

    +
    +
    - + +
    +

    Returns the current RPC base URL.

    +
    - - -
    -

    Returns the current RPC base URL.

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the RPC URL endpoint to issue requests against.

    -
    - - - -
    -
    - Type -
    -
    + + + -string - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the RPC URL endpoint to issue requests against.
    - - - + + + +
    - +
    +
    +

    + + getSessionID(){string} +

    + +
    + rpc.js, line 346 +
    + +
    -

    getSessionID() → {string}

    +
    +
    - + +
    +

    Returns the current RPC session id.

    +
    - - -
    -

    Returns the current RPC session id.

    -
    - - - - - - - - - - - - - + + + + + + +
    - - + - - - - - + + + + + + + + + + + +
    - - -
    Source:
    -
    - - - +
    Returns:
    -
    - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the 32 byte session ID string used for authenticating remote -requests.

    -
    - - - -
    -
    - Type -
    -
    + + + -string - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the 32 byte session ID string used for authenticating remote +requests.
    - - - + + + +
    - +
    +
    +

    + + getStatusText(statusCode){string} +

    + +
    + rpc.js, line 391 +
    + +
    -

    getStatusText(statusCode) → {string}

    +
    +
    - - - - -
    -

    Translates a numeric ubus error code into a human readable +

    +

    Translates a numeric ubus error code into a human readable description.

    -
    - - - - - - - - +
    + -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    statusCode @@ -739,119 +1730,110 @@ description.

    The numeric status code.

    + +

    The numeric status code.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the textual description of the code.

    -
    - - - -
    -
    - Type -
    -
    + + + -string - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the textual description of the code.
    - - - + + + +
    - +
    +
    +

    + + list(objectNames){Promise.<(Array.<string>|Object.<string, Object.<string, Object.<string, string>>>)>} +

    + +
    + rpc.js, line 140 +
    + +
    -

    list(…objectNamesopt) → {Promise.<(Array.<string>|Object.<string, Object.<string, Object.<string, string>>>)>}

    +
    +
    - - - - -
    -

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - -
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + + + + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - + + + -
    -

    When invoked without arguments, this function will return a promise +

    + + + + + + + + + + + +
    TypeDescription
    + + Promise.<(Array.<string>|Object.<string, Object.<string, Object.<string, string>>>)> + + + 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.

    - - - - -
    -
    - Type -
    -
    - -Promise.<(Array.<string>|Object.<string, Object.<string, Object.<string, string>>>)> - - -
    -
    - +signatures of each requested ubus object name will be returned.
    - - - + + + +
    - +
    +
    +

    + + removeInterceptor(interceptorFn){boolean} +

    + +
    + rpc.js, line 470 +
    + +
    -

    removeInterceptor(interceptorFn) → {boolean}

    +
    +
    - + +
    +

    Removes a registered interceptor function.

    +
    - - -
    -

    Removes a registered interceptor function.

    -
    - - - - - - - - - -
    Parameters:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    interceptorFn @@ -1084,158 +2042,144 @@ signatures of each requested ubus object name will be returned.

    The inteceptor function to remove.

    + +

    The inteceptor function to remove.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if the given function has been removed or false -if it has not been found.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    + +
    - - - - - - - + -

    setBaseURL(sid)

    - - - - -
    -

    Set the RPC base URL to use.

    -
    - - - - - - - - - -
    Parameters:
    + + +
    Returns:
    + - - - + + + + + + + + + + + + +
    NameTypeDescription
    + + boolean + + + Returns true if the given function has been removed or false +if it has not been found.
    - + + + +
    + +
    +
    +

    + + setBaseURL(sid) +

    + + +
    + rpc.js, line 377 +
    + +
    - Description - - + +
    +
    + + +
    +

    Set the RPC base URL to use.

    +
    + - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - + + + +
    NameTypeDescription
    sid @@ -1244,135 +2188,114 @@ if it has not been found.

    Sets the RPC URL endpoint to issue requests against.

    + +

    Sets the RPC URL endpoint to issue requests against.

    + + - - - - - - - -
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    - - - - - - - - - - - - - - - - - - - - - + + -

    setSessionID(sid)

    - - - - -
    -

    Set the RPC session id to use.

    -
    - - - - - - - - - -
    Parameters:
    + + + +
    - - - - - - - - + +
    +
    +

    + + setSessionID(sid) +

    + - +
    + rpc.js, line 357 +
    +
    -
    - - + + +
    + + +
    +

    Set the RPC session id to use.

    +
    + -
    + + + + + +
    NameTypeDescription
    + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
    NameTypeDescription
    sid @@ -1381,143 +2304,112 @@ if it has not been found.

    Sets the 32 byte session ID string used for authenticating remote + +

    + +

    Sets the 32 byte session ID string used for authenticating remote requests.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + - - - - - - - - - - - - - - - - - - + + + + + + +
    +
    + +

    Type Definitions

    - +
    -

    DeclareOptions

    - - - - - - -
    Type:
    -
      -
    • - -Object - - -
    • -
    - - - - - -
    Properties:
    - +
    +
    +

    LuCI.rpc.DeclareOptionsObject

    +
    + + +
    +
    + + + +
    - - - - - - - - - - - - - +
    Properties:
    +
    -
    - - - - - - +
    NameTypeAttributesDescription
    + + + + + + + + + + + + + + + + + + + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - - - - + + + + + - + - + - - + + - + + + +
    NameTypeArgumentDescription
    object @@ -1526,27 +2418,27 @@ requests.

    - +

    The name of the remote ubus object to invoke.

    method @@ -1555,27 +2447,27 @@ requests.

    - +

    The name of the remote ubus method to invoke.

    params @@ -1584,19 +2476,19 @@ requests.

    <optional>
    - +

    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")

    expect @@ -1633,19 +2525,19 @@ invoked with filterFn(reply, [ "foo" ], "bar", "b <optional>
    - +

    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 @@ -1675,16 +2567,16 @@ This requires the received ubus reply to be an object containing a key success with a boolean value. If the reply does not contain success or if reply.success is not a boolean value, false will 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.

    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    - - - - + + +
    - +
    +
    +

    + + filterFn(data, args, extraArgs){*} +

    + +
    + rpc.js, line 231 +
    + +
    -

    filterFn(data, args, …extraArgs) → {*}

    +
    +
    - - - - -
    -

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - + - - - + + + - + - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - - -
    -

    The return value of the filter function will be returned to the caller -of the RPC method as-is.

    -
    - - - -
    -
    - Type -
    -
    + + + -* - - - - - + + + + + + + + + + + + +
    TypeDescription
    + + * + + + The return value of the filter function will be returned to the caller +of the RPC method as-is.
    - - - + + + +
    - +
    +
    +

    + + 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:
    +
    - - - - - - - - - - - - - - - - - - + + + + + +
    NameTypeDescription
    + + + + + + + + + + + + + + + + + - + - - - - - - - + + + - + - - - - - - - + + +
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - + + + -
    -

    Interceptor functions may return a promise to defer response +

    + + + + + + + + + + + +
    TypeDescription
    + + 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.

    - - - - -
    -
    - Type -
    -
    - -Promise.<*> -| - -* - - -
    -
    - +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 +
    + +
    -

    invokeFn(…params) → {Promise.<*>}

    +
    +
    - - - - -
    -

    The generated invocation function is returned by +

    +

    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:
    + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    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.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + +
    Returns:
    + - - - - - - - - - - -
    Returns:
    - + + + -
    -

    Returns a promise resolving to the result data of the remote ubus +

    + + + + + + + + + + + +
    TypeDescription
    + + 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.

    - - - - -
    -
    - Type -
    -
    - -Promise.<*> - - -
    -
    - +to the expect and filter declarations.
    + + + +
    - - - - +
    + +
    -
    - - + -
    - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    +
    + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.uci.html b/documentation/jsapi/LuCI.uci.html index 8a0e3e98f..32e34eacb 100644 --- a/documentation/jsapi/LuCI.uci.html +++ b/documentation/jsapi/LuCI.uci.html @@ -1,198 +1,1235 @@ - + - JSDoc: Class: uci - - - + Class: uci + + + + + - - + + + + + + + + +
    + +
    +
    + +

    Type Definitions

    - +
    -

    ChangeRecord

    - - - - -
    -

    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:
    +
    -
    - - - - - - +
    NameTypeDescription
    + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - + + + +
    NameTypeDescription
    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.
    • @@ -3701,119 +4370,91 @@ list option. renamed.
    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    - - - - + + +
    -

    SectionObject

    - - - - -
    -

    A section object represents the options and their corresponding values +

    +
    +

    LuCI.uci.SectionObjectObject.<string, (boolean|number|string|Array.<string>)>

    +
    + + +
    +
    + +
    +

    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.

    -
    - - - -
    Type:
    -
      -
    • - -Object.<string, (boolean|number|string|Array.<string>)> - - -
    • -
    - - - - - -
    Properties:
    - +
    + + + +
    - - - - - - - - - - - +
    Properties:
    +
    -
    - - - - - - +
    NameTypeDescription
    + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - + + + +
    NameTypeDescription
    .anonymous @@ -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.

    + - - - - - - -
    - + - - - - - - - - - - - -
    Source:
    -
    - - - +
    - - - - + + +
    - +
    +
    +

    + + sectionsFn(section, sid) +

    + +
    + uci.js, line 352 +
    + +
    -

    sectionsFn(section, sid)

    +
    +
    - - - - -
    -

    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:
    + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    section @@ -4048,21 +4671,21 @@ associated name as arguments.

    The section object.

    + +

    The section object.

    sid @@ -4071,106 +4694,80 @@ associated name as arguments.

    The name or ID of the section.

    + +

    The name or ID of the section.

    - - - - - - + + +
    - - + - - - - - - - - - - -
    Source:
    -
    - - - + +
    + + + + + + + + + + +
    - - - - - - - - - - - - - - - - - +
    + + - - - + - - -
    -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    + - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    + + + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.view.html b/documentation/jsapi/LuCI.view.html index 4a7209ceb..59b34cfd8 100644 --- a/documentation/jsapi/LuCI.view.html +++ b/documentation/jsapi/LuCI.view.html @@ -1,155 +1,1199 @@ - + - JSDoc: Class: view - - - + Class: view + + + + + - - + + + + + + + + +
    + + +
    + + \ No newline at end of file diff --git a/documentation/jsapi/index.html b/documentation/jsapi/index.html index d6997c8d8..550ed9bc8 100644 --- a/documentation/jsapi/index.html +++ b/documentation/jsapi/index.html @@ -1,26 +1,1070 @@ - + - JSDoc: Home - - - + Index + + + + + - - + + + + + + + + - -
    - -

    Home

    - +
    + +
    +

    Index

    + @@ -35,16 +1079,14 @@ - -
    -

    OpenWrt luci feed

    -

    Translation status

    +

    OpenWrt luci feed

    +

    Translation status

    Description

    This is the OpenWrt "luci"-feed containing LuCI - OpenWrt Configuration Interface.

    Usage

    @@ -56,15 +1098,19 @@ ./scripts/feeds install -a -p luci

    API Reference

    -

    You can browse the generated API documentation directly on Github.

    +

    You can browse the generated API documentation directly on Github.

    +

    Development

    -

    Documentation for developing and extending LuCI can be found in the Wiki

    +

    Documentation for developing and extending LuCI can be found in the Wiki

    License

    See LICENSE file.

    Package Guidelines

    See CONTRIBUTING.md file.

    Translation status

    -

    Translation status

    +

    Translation status

    @@ -72,19 +1118,14 @@ -
    - - - -
    + -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
    - - - +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    +
    + + \ No newline at end of file diff --git a/documentation/jsapi/styles/prettify-tomorrow.css b/documentation/jsapi/styles/prettify-tomorrow.css index b6f92a78d..aa2908c25 100644 --- a/documentation/jsapi/styles/prettify-tomorrow.css +++ b/documentation/jsapi/styles/prettify-tomorrow.css @@ -98,7 +98,7 @@ /* pre.prettyprint { background: white; - font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-family: Menlo, Monaco, Consolas, monospace; font-size: 12px; line-height: 1.5; border: 1px solid #ccc; diff --git a/package.json b/package.json index 30ad4264b..5a847add8 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "scripts": { - "doc": "jsdoc -c jsdoc.conf.json" + "doc": "jsdoc -c jsdoc.conf.json -t node_modules/jaguarjs-jsdoc" }, "devDependencies": { - "jsdoc": "^3.6.3" + "jsdoc": "^3.6.3", + "jaguarjs-jsdoc": "^1.1.0" } } -- 2.25.1