diff --git a/documentation/jsapi/LuCI.Class.html b/documentation/jsapi/LuCI.Class.html index 7b5c3a8f74..28916f113e 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.Class

- -

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

+
+

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

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

+ + new LuCI.Class() +

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

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

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

+ + +
+ luci.js, line 169 +
+ +
+ + +
+
+ + +
+

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

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.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
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'.
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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

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

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

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

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

- - - - - - -
-

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

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

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

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.

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

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

Returns a new array consisting of the optional extra arguments -and the values extracted from the args array beginning with -offset.

-
- - - -
-
- Type -
-
- -Array.<*> - - -
-
- - - - - - - - - - - + + + + + +
- - - -
- - - - - + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Headers.html b/documentation/jsapi/LuCI.Headers.html index a63017bcf6..efb898bbf4 100644 --- a/documentation/jsapi/LuCI.Headers.html +++ b/documentation/jsapi/LuCI.Headers.html @@ -1,194 +1,1233 @@ - + - JSDoc: Class: Headers - - - + Class: Headers + + + + + - - - - - -
- -

Class: Headers

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

Class: Headers

+
- +
+

+ LuCI. -

- LuCI.Headers

- -

The Headers class is an internal utility class exposed in HTTP + Headers + + +

The Headers class is an internal utility class exposed in HTTP response objects using the response.headers property.

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

+ + new LuCI.Headers() +

+ +
+ luci.js, line 324 +
+
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
- +
+ + + + + + + + + + + - -

Methods

- +
+
+
+

+ + get(name){string|null} +

+ + +
+ luci.js, line 363 +
+ +
- +
+
-

get(name) → {string|null}

- - - - - -
-

Returns the value of the given header name. +

+

Returns the value of the given header name. Note: Header-Names are case-insensitive.

-
- - - - - - - - - -
Parameters:
+
+ + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
NameTypeDescription
name @@ -197,161 +1236,147 @@ Note: Header-Names are case-insensitive.

The header name to read

+ +

The header name to read

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

The value of the given header name or null if the header isn't present.

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

has(name) → {boolean}

- - -
-

Checks whether the given header name is present. -Note: Header-Names are case-insensitive.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + string + | + + null + + + The value of the given header name or null if the header isn't present.
+ + + +
+ + + +
+
+

+ + has(name){boolean} +

+ + +
+ luci.js, line 347 +
+ +
+ + +
+
+ + +
+

Checks whether the given header name is present. +Note: Header-Names are case-insensitive.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + +
NameTypeDescription
name @@ -360,130 +1385,111 @@ Note: Header-Names are case-insensitive.

The header name to check

+ +

The header name to check

+ + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true if the header name is present, false otherwise
- - - - - -
- - - +
+
- - - - - - - - - - - - - - - -
Source:
-
- - - - - - - - - - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns true if the header name is present, false otherwise

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - -
-
+ + + + +
+ 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.Device.html b/documentation/jsapi/LuCI.Network.Device.html index 0236f8c503..71d88df22f 100644 --- a/documentation/jsapi/LuCI.Network.Device.html +++ b/documentation/jsapi/LuCI.Network.Device.html @@ -1,2010 +1,2888 @@ - + - JSDoc: Class: Device - - - + Class: Device + + + + + - - - - - -
- -

Class: Device

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

Class: Device

+
- +
+

+ LuCI.Network. -

- LuCI.Network.Device

- -

A Network.Device class instance represents an underlying Linux network + Device + + +

A Network.Device class instance represents an underlying Linux network device and allows querying device details such as packet statistics or MTU.

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

+ + new LuCI.Network.Device() +

+ +
+ network.js, line 2593 +
+
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
- +
+ + + + + + + + + + + - -

Methods

+ +
+ +
+
+

+ + getBridgeID(){null|string} +

+ + +
+ network.js, line 2800 +
+ +
+ + +
+
+ + +
+

Get the bridge ID

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the ID of this network bridge or null if this network +device is not a Linux bridge.
+ + + + +
+
+
+

+ + getBridgeSTP(){boolean} +

+ + +
+ network.js, line 2812 +
+ +
+
+
+ + +
+

Get the bridge STP setting

+
+ -

getBridgeID() → {null|string}

- - - - -
-

Get the bridge ID

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

Returns the ID of this network bridge or null if this network -device is not a Linux bridge.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when this device is a Linux bridge and has stp +enabled, else false.
+ + + +
+
+
+

+ + getI18n(){string} +

+ + +
+ network.js, line 2727 +
+ +
+
+
+ + +
+

Get a long description string for the device.

+
+ -

getBridgeSTP() → {boolean}

- - - - -
-

Get the bridge STP setting

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

Returns true when this device is a Linux bridge and has stp -enabled, else false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns a string containing the type description and device name +for non-wifi devices or operation mode and ssid for wifi ones.
+ + + +
+
+
+

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

+ + +
+ network.js, line 2671 +
+ +
+
+
+ + +
+

Get the IPv6 addresses configured on the device.

+
+ -

getI18n() → {string}

- - - - -
-

Get a long description string for the device.

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

Returns a string containing the type description and device name -for non-wifi devices or operation mode and ssid for wifi ones.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of IPv6 address strings.
+ + + +
+
+
+

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

+ + +
+ network.js, line 2660 +
+ +
+
+
+ + +
+

Get the IPv4 addresses configured on the device.

+
+ -

getIP6Addrs() → {Array.<string>}

- - - - -
-

Get the IPv6 addresses configured on the device.

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

Returns an array of IPv6 address strings.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of IPv4 address strings.
+ + + +
+
+
+

+ + getMAC(){null|string} +

+ + +
+ network.js, line 2639 +
+ +
+
+
+ + +
+

Get the MAC address of the device.

+
+ -

getIPAddrs() → {Array.<string>}

- - - - -
-

Get the IPv4 addresses configured on the device.

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

Returns an array of IPv4 address strings.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the MAC address of the device or null if not applicable, +e.g. for non-ethernet tunnel devices.
+ + + +
+
+
+

+ + getMTU(){number} +

+ + +
+ network.js, line 2650 +
+ +
+
+
+ + +
+

Get the MTU of the device.

+
+ -

getMAC() → {null|string}

- - - - -
-

Get the MAC address of the device.

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

Returns the MAC address of the device or null if not applicable, -e.g. for non-ethernet tunnel devices.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the MTU of the device.
+ + + +
+
+
+

+ + getName(){string} +

+ + +
+ network.js, line 2628 +
+ +
+
+
+ + +
+

Get the name of the network device.

+
+ -

getMTU() → {number}

- - - - -
-

Get the MTU of the device.

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

Returns the MTU of the device.

-
- - - -
-
- Type -
-
- -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the name of the device, e.g. eth0 or wlan0.
+ + + +
- - - - -

getName() → {string}

- - - - - - -
-

Get the name of the network device.

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

Returns the name of the device, e.g. eth0 or wlan0.

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

+ getNetwork(){null|LuCI.Network.Protocol} +

+ + +
+ network.js, line 2907 +
+ +
+
+
+ + +
+

Get the primary logical interface this device is assigned to.

+
+ -

getNetwork() → {null|LuCI.Network.Protocol}

- - - - -
-

Get the primary logical interface this device is assigned to.

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

Returns a Network.Protocol instance representing the logical +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + LuCI.Network.Protocol + + + Returns a Network.Protocol instance representing the logical interface this device is attached to or null if it is not -assigned to any logical interface.

- - - - -
-
- Type -
-
- -null -| - -LuCI.Network.Protocol - - -
-
+assigned to any logical interface.
- - - - + + +
+
+
+

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

+ + +
+ network.js, line 2918 +
+ +
+
+
+ + +
+

Get the logical interfaces this device is assigned to.

+
+ -

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

- - - - -
-

Get the logical interfaces this device is assigned to.

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

Returns an array of Network.Protocol instances representing the -logical interfaces this device is assigned to.

-
- - - -
-
- Type -
-
- -Array.<LuCI.Network.Protocol> - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<LuCI.Network.Protocol> + + + Returns an array of Network.Protocol instances representing the +logical interfaces this device is assigned to.
+ + + +
+
+
+

+ + getPorts(){null|Array.<LuCI.Network.Device>} +

+ + +
+ network.js, line 2778 +
+ +
+
+
+ + +
+

Get the associated bridge ports of the device.

+
+ -

getPorts() → {null|Array.<LuCI.Network.Device>}

- - - - -
-

Get the associated bridge ports of the device.

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

Returns an array of Network.Device instances representing the ports +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + Array.<LuCI.Network.Device> + + + Returns an array of Network.Device instances representing the ports (slave interfaces) of the bridge or null when this device isn't -a Linux bridge.

- - - - -
-
- Type -
-
- -null -| - -Array.<LuCI.Network.Device> - - -
-
+a Linux bridge.
- - - - + + +
+
+
+

+ + getRXBytes(){number} +

+ + +
+ network.js, line 2872 +
+ +
+
+
+ + +
+

Get the amount of received bytes.

+
+ -

getRXBytes() → {number}

- - - - -
-

Get the amount of received bytes.

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

Returns the amount of bytes received by the network device.

-
- - - -
-
- Type -
-
- -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the amount of bytes received by the network device.
+ + + +
+
+
+

+ + getRXPackets(){number} +

+ + +
+ network.js, line 2894 +
+ +
+
+
+ + +
+

Get the amount of received packets.

+
+ -

getRXPackets() → {number}

- - - - -
-

Get the amount of received packets.

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

Returns the amount of packets received by the network device.

-
- - - -
-
- Type -
-
- -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the amount of packets received by the network device.
+ + + +
+
+
+

+ + getShortName(){string} +

+ + +
+ network.js, line 2713 +
+ +
+
+
+ + +
+

Get a short description string for the device.

+
+ -

getShortName() → {string}

- - - - -
-

Get a short description string for the device.

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

Returns the device name for non-wifi devices or a string containing -the operation mode and SSID for wifi devices.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the device name for non-wifi devices or a string containing +the operation mode and SSID for wifi devices.
+ + + +
+
+
+

+ + getTXBytes(){number} +

+ + +
+ network.js, line 2861 +
+ +
+
+
+ + +
+

Get the amount of transmitted bytes.

+
+ -

getTXBytes() → {number}

- - - - -
-

Get the amount of transmitted bytes.

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

Returns the amount of bytes transmitted by the network device.

-
- - - -
-
- Type -
-
- -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the amount of bytes transmitted by the network device.
+ + + +
+
+
+

+ + getTXPackets(){number} +

+ + +
+ network.js, line 2883 +
+ +
+
+
+ + +
+

Get the amount of transmitted packets.

+
+ -

getTXPackets() → {number}

- - - - -
-

Get the amount of transmitted packets.

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

Returns the amount of packets transmitted by the network device.

-
- - - -
-
- Type -
-
- -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the amount of packets transmitted by the network device.
+ + + +
+
+
+

+ + getType(){string} +

+ + +
+ network.js, line 2689 +
+ +
+
+
+ + +
+

Get the type of the device..

+
+ -

getType() → {string}

- - - - -
-

Get the type of the device..

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

Returns a string describing the type of the network device:

+
+ + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns a string describing the type of the network device:
  • alias if it is an abstract alias device (@ notation)
  • wifi if it is a wireless interface (e.g. wlan0)
  • @@ -2013,614 +2891,550 @@ the operation mode and SSID for wifi devices.

  • vlan if it is a vlan device (e.g. eth0.1)
  • switch if it is a switch device (e.g.eth1 connected to switch0)
  • ethernet for all other device types
  • -
- - - - -
-
- Type -
-
- -string - - -
-
+
- - - - + + +
+
+
+

+ + getTypeI18n(){string} +

+ + +
+ network.js, line 2745 +
+ +
+
+
+ + +
+

Get a string describing the device type.

+
+ -

getTypeI18n() → {string}

- - - - -
-

Get a string describing the device type.

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

Returns a string describing the type, e.g. "Wireless Adapter" or -"Bridge".

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns a string describing the type, e.g. "Wireless Adapter" or +"Bridge".
+ + + +
+
+
+

+ + getWifiNetwork(){null|LuCI.Network.WifiNetwork} +

+ + +
+ network.js, line 2942 +
+ +
+
+
+ + +
+

Get the related wireless network this device is related to.

+
+ -

getWifiNetwork() → {null|LuCI.Network.WifiNetwork}

- - - - -
-

Get the related wireless network this device is related to.

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

Returns a Network.WifiNetwork instance representing the wireless +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + LuCI.Network.WifiNetwork + + + Returns a Network.WifiNetwork instance representing the wireless network corresponding to this network device or null if this device -is not a wireless device.

- - - - -
-
- Type -
-
- -null -| - -LuCI.Network.WifiNetwork - - -
-
+is not a wireless device.
- - - - + + +
+
+
+

+ + isBridge(){boolean} +

+ + +
+ network.js, line 2840 +
+ +
+
+
+ + +
+

Checks whether this device is a Linux bridge.

+
+ -

isBridge() → {boolean}

- - - - -
-

Checks whether this device is a Linux bridge.

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

Returns true when the network device is present and a Linux bridge, -else false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when the network device is present and a Linux bridge, +else false.
+ + + +
+
+
+

+ + isBridgePort(){boolean} +

+ + +
+ network.js, line 2851 +
+ +
+
+
+ + +
+

Checks whether this device is part of a Linux bridge.

+
+ -

isBridgePort() → {boolean}

- - - - -
-

Checks whether this device is part of a Linux bridge.

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

Returns true when this network device is part of a bridge, -else false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when this network device is part of a bridge, +else false.
+ + + +
+
+
+

+ + isUp(){boolean} +

+ + +
+ network.js, line 2824 +
+ +
+
+
+ + +
+

Checks whether this device is up.

+
+ -

isUp() → {boolean}

- - - - -
-

Checks whether this device is up.

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

Returns true when the associated device is running pr false -when it is down or absent.

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + - - - - - + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when the associated device is running pr false +when it is down or absent.
+ + + + +
+ +
+ + + +
-
+ + + + +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+
- - - -
- -
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
- - - + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Network.Hosts.html b/documentation/jsapi/LuCI.Network.Hosts.html index f98641bb74..fc392d8802 100644 --- a/documentation/jsapi/LuCI.Network.Hosts.html +++ b/documentation/jsapi/LuCI.Network.Hosts.html @@ -1,194 +1,1233 @@ - + - JSDoc: Class: Hosts - - - + Class: Hosts + + + + + - - - - - -
- -

Class: Hosts

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

Class: Hosts

+
- -
-

- LuCI.Network.Hosts

- -

The LuCI.Network.Hosts class encapsulates host information aggregated +

+

+ LuCI.Network. + + Hosts +

+ +

The LuCI.Network.Hosts class encapsulates host information aggregated from multiple sources and provides convenience functions to access the host information by different criteria.

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

+ + new LuCI.Network.Hosts() +

+ +
+ network.js, line 1628 +
+
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
- +
+ + + + + + + + + + + - -

Methods

- +
+
+
+

+ + getHostnameByIP6Addr(ipaddr){null|string} +

+ + +
+ network.js, line 1725 +
+ +
+
+
+ + +
+

Lookup the hostname associated with the given IPv6 address.

+
+ -

getHostnameByIP6Addr(ipaddr) → {null|string}

- - - - -
-

Lookup the hostname associated with the given IPv6 address.

-
- - - - - - - - - -
Parameters:
+ + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
NameTypeDescription
ipaddr @@ -197,162 +1236,148 @@ host information by different criteria.

The IPv6 address to lookup.

+ +

The IPv6 address to lookup.

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

Returns the hostname associated with the given IPv6 or null if -no matching host could be found or if no hostname is known for -the corresponding host.

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

getHostnameByIPAddr(ipaddr) → {null|string}

- - -
-

Lookup the hostname associated with the given IPv4 address.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + null + | + + string + + + Returns the hostname associated with the given IPv6 or null if +no matching host could be found or if no hostname is known for +the corresponding host.
+ + + +
+ + + +
+
+

+ + getHostnameByIPAddr(ipaddr){null|string} +

+ + +
+ network.js, line 1689 +
+ +
+ + +
+
+ + +
+

Lookup the hostname associated with the given IPv4 address.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
ipaddr @@ -361,162 +1386,148 @@ the corresponding host.

The IPv4 address to lookup.

+ +

The IPv4 address to lookup.

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

Returns the hostname associated with the given IPv4 or null if -no matching host could be found or if no hostname is known for -the corresponding host.

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

getHostnameByMACAddr(mac) → {null|string}

- - -
-

Lookup the hostname associated with the given MAC address.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + null + | + + string + + + Returns the hostname associated with the given IPv4 or null if +no matching host could be found or if no hostname is known for +the corresponding host.
+ + + +
+ + + +
+
+

+ + getHostnameByMACAddr(mac){null|string} +

+ + +
+ network.js, line 1644 +
+ +
+ + +
+
+ + +
+

Lookup the hostname associated with the given MAC address.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
mac @@ -525,162 +1536,148 @@ the corresponding host.

The MAC address to lookup.

+ +

The MAC address to lookup.

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

Returns the hostname associated with the given MAC or null if -no matching host could be found or if no hostname is known for -the corresponding host.

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

getIP6AddrByMACAddr(mac) → {null|string}

- - -
-

Lookup the IPv6 address associated with the given MAC address.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + null + | + + string + + + Returns the hostname associated with the given MAC or null if +no matching host could be found or if no hostname is known for +the corresponding host.
+ + + +
+ + + +
+
+

+ + getIP6AddrByMACAddr(mac){null|string} +

+ + +
+ network.js, line 1674 +
+ +
+ + +
+
+ + +
+

Lookup the IPv6 address associated with the given MAC address.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
mac @@ -689,162 +1686,148 @@ the corresponding host.

The MAC address to lookup.

+ +

The MAC address to lookup.

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

Returns the IPv6 address associated with the given MAC or null if +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the IPv6 address associated with the given MAC or null if no matching host could be found or if no IPv6 address is known for -the corresponding host.

- - - - -
-
- Type -
-
- -null -| - -string - - -
-
+the corresponding host.
- - - - + + +
+
+
+

+ + getIPAddrByMACAddr(mac){null|string} +

+ + +
+ network.js, line 1659 +
+ +
+
+
+ + +
+

Lookup the IPv4 address associated with the given MAC address.

+
+ -

getIPAddrByMACAddr(mac) → {null|string}

- - - - -
-

Lookup the IPv4 address associated with the given MAC address.

-
- - - - - - - - - -
Parameters:
+ + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
NameTypeDescription
mac @@ -853,162 +1836,148 @@ the corresponding host.

The MAC address to lookup.

+ +

The MAC address to lookup.

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

Returns the IPv4 address associated with the given MAC or null if +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the IPv4 address associated with the given MAC or null if no matching host could be found or if no IPv4 address is known for -the corresponding host.

- - - - -
-
- Type -
-
- -null -| - -string - - -
-
+the corresponding host.
- - - - + + +
+
+
+

+ + getMACAddrByIP6Addr(ipaddr){null|string} +

+ + +
+ network.js, line 1743 +
+ +
+
+
+ + +
+

Lookup the MAC address associated with the given IPv6 address.

+
+ -

getMACAddrByIP6Addr(ipaddr) → {null|string}

- - - - -
-

Lookup the MAC address associated with the given IPv6 address.

-
- - - - - - - - - -
Parameters:
+ + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
NameTypeDescription
NameTypeDescription
ipaddr @@ -1017,162 +1986,148 @@ the corresponding host.

The IPv6 address to lookup.

+ +

The IPv6 address to lookup.

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

Returns the MAC address associated with the given IPv6 or null if -no matching host could be found or if no MAC address is known for -the corresponding host.

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

getMACAddrByIPAddr(ipaddr) → {null|string}

- - -
-

Lookup the MAC address associated with the given IPv4 address.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + null + | + + string + + + Returns the MAC address associated with the given IPv6 or null if +no matching host could be found or if no MAC address is known for +the corresponding host.
+ + + +
+ + + +
+
+

+ + getMACAddrByIPAddr(ipaddr){null|string} +

+ + +
+ network.js, line 1707 +
+ +
+ + +
+
+ + +
+

Lookup the MAC address associated with the given IPv4 address.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + +
NameTypeDescription
ipaddr @@ -1181,167 +2136,151 @@ the corresponding host.

The IPv4 address to lookup.

+ +

The IPv4 address to lookup.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the MAC address associated with the given IPv4 or null if +no matching host could be found or if no MAC address is known for +the corresponding host.
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns the MAC address associated with the given IPv4 or null if -no matching host could be found or if no MAC address is known for -the corresponding host.

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

+ + getMACHints(preferIp6){Array.<Array.<string>>} +

+ + +
+ network.js, line 1771 +
+ +
- +
+
-

getMACHints(preferIp6opt) → {Array.<Array.<string>>}

- - - - - -
-

Return an array of (MAC address, name hint) tuples sorted by +

+

Return an array of (MAC address, name hint) tuples sorted by MAC address.

-
- - - - - - - - - -
Parameters:
+
+ + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - - - - - + + + +
NameTypeAttributesDefaultDescription
NameTypeDefaultDescription
preferIp6 @@ -1350,19 +2289,7 @@ MAC address.

- - <optional>
- - - - - -
@@ -1370,135 +2297,125 @@ MAC address.

Whether to prefer IPv6 addresses (true) or IPv4 addresses (false) + +

+ + + optional + + + + + +

Whether to prefer IPv6 addresses (true) or IPv4 addresses (false) as name hint when no hostname is known for a specific MAC address.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<Array.<string>> + + + Returns an array of arrays containing a name hint for each found +MAC address on the system. The array is sorted ascending by MAC. +Each item of the resulting array is a two element array with the +MAC being the first element and the name hint being the second +element. The name hint is either the hostname, an IPv4 or an IPv6 +address related to the MAC address. +If no hostname but both IPv4 and IPv6 addresses are known, the +preferIP6 flag specifies whether the IPv6 or the IPv4 address +is used as hint.
- - - - - -
- - - +
+
- - - - - - - - - - - - - - - -
Source:
-
- - - - - - - - - - - - - - - - - - - - - - - -
Returns:
- - -
-

Returns an array of arrays containing a name hint for each found -MAC address on the system. The array is sorted ascending by MAC.

-

Each item of the resulting array is a two element array with the -MAC being the first element and the name hint being the second -element. The name hint is either the hostname, an IPv4 or an IPv6 -address related to the MAC address.

-

If no hostname but both IPv4 and IPv6 addresses are known, the -preferIP6 flag specifies whether the IPv6 or the IPv4 address -is used as hint.

-
- - - -
-
- Type -
-
- -Array.<Array.<string>> - - -
-
- - - - - - - - - -
-
+ + + + +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+
- - - -
- -
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 GMT+0100 (Central European Standard Time) -
- - - + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.Network.Protocol.html b/documentation/jsapi/LuCI.Network.Protocol.html index e23801a32b..20239bce80 100644 --- a/documentation/jsapi/LuCI.Network.Protocol.html +++ b/documentation/jsapi/LuCI.Network.Protocol.html @@ -1,193 +1,1232 @@ - + - JSDoc: Class: Protocol - - - + Class: Protocol + + + + + - - - - - -
- -

Class: Protocol

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

Class: Protocol

+
- +
+

+ LuCI.Network. -

- LuCI.Network.Protocol

- -

The Network.Protocol class serves as base for protocol specific + Protocol + + +

The Network.Protocol class serves as base for protocol specific subclasses which describe logical UCI networks defined by config interface sections in /etc/config/network.

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

+ + new LuCI.Network.Protocol() +

+ +
+ network.js, line 1794 +
+
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
- +
+ + + + + + + + + + + - -

Methods

- +
+
+
+

+ + addDevice(device){boolean} +

+ + +
+ network.js, line 2383 +
+ +
+
+
+ + +
+

Add the given network device to the logical interface.

+
+ -

addDevice(device) → {boolean}

- - - - -
-

Add the given network device to the logical interface.

-
- - - - - - - - - -
Parameters:
+ + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
NameTypeDescription
device @@ -208,162 +1247,148 @@ subclasses which describe logical UCI networks defined by config interface

The object or device name to add to the logical interface. In case the + +

+ +

The object or device name to add to the logical interface. In case the given argument is not a string, it is resolved though the Network.getIfnameOf() function.

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

Returns true if the device name has been added or false if any -argument was invalid, if the device was already part of the logical -interface or if the logical interface is virtual.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - -

containsDevice(device) → {boolean}

- - -
-

Checks whether this logical interface contains the given device -object.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + boolean + + + Returns true if the device name has been added or false if any +argument was invalid, if the device was already part of the logical +interface or if the logical interface is virtual.
+ + + +
+ + + +
+
+

+ + containsDevice(device){boolean} +

+ + +
+ network.js, line 2552 +
+ +
+ + +
+
+ + +
+

Checks whether this logical interface contains the given device +object.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
device @@ -384,160 +1409,146 @@ object.

The object or device name to check. In case the given argument is not + +

+ +

The object or device name to check. In case the given argument is not a string, it is resolved though the Network.getIfnameOf() function.

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

Returns true when this logical interface contains the given network -device or false if not.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - -

deleteDevice(device) → {boolean}

- - -
-

Remove the given network device from the logical interface.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + boolean + + + Returns true when this logical interface contains the given network +device or false if not.
+ + + +
+ + + +
+
+

+ + deleteDevice(device){boolean} +

+ + +
+ network.js, line 2410 +
+ +
+ + +
+
+ + +
+

Remove the given network device from the logical interface.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
device @@ -558,161 +1569,147 @@ device or false if not.

The object or device name to remove from the logical interface. In case + +

+ +

The object or device name to remove from the logical interface. In case the given argument is not a string, it is resolved though the Network.getIfnameOf() function.

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

Returns true if the device name has been added or false if any -argument was invalid, if the device was already part of the logical -interface or if the logical interface is virtual.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - -

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

- - -
-

Read the given UCI option value of this network.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + boolean + + + Returns true if the device name has been added or false if any +argument was invalid, if the device was already part of the logical +interface or if the logical interface is virtual.
+ + + +
+ + + +
+
+

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

+ + +
+ network.js, line 1827 +
+ +
+ + +
+
+ + +
+

Read the given UCI option value of this network.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + +
NameTypeDescription
opt @@ -721,577 +1718,528 @@ interface or if the logical interface is virtual.

The UCI option name to read.

+ +

The UCI option name to read.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + | + + Array.<string> + + + Returns the UCI option value or null if the requested option is +not found.
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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

-
- - - -
-
- Type -
-
- -null -| - -string -| - -Array.<string> - - -
-
- - - - - - +
+
+
+

+ + getDevice(){LuCI.Network.Device} +

+ + +
+ network.js, line 2437 +
+ +
- +
+
-

getDevice() → {LuCI.Network.Device}

- - - - - -
-

Returns the Linux network device associated with this logical +

+

Returns the Linux network device associated with this logical interface.

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

Returns a Network.Device class instance representing the -expected Linux network device according to the configuration.

-
- - - -
-
- Type -
-
- -LuCI.Network.Device - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + LuCI.Network.Device + + + Returns a Network.Device class instance representing the +expected Linux network device according to the configuration.
+ + + +
+
+
+

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

+ + +
+ network.js, line 2498 +
+ +
- +
+
-

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

- - - - - -
-

Returns a list of network sub-devices associated with this logical +

+

Returns a list of network sub-devices associated with this logical interface.

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

Returns an array of of Network.Device class instances representing +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + Array.<LuCI.Network.Device> + + + Returns an array of of Network.Device class instances representing the sub-devices attached to this logical interface or null if the logical interface does not support sub-devices, e.g. because it is -virtual and not a bridge.

- - - - -
-
- Type -
-
- -null -| - -Array.<LuCI.Network.Device> - - -
-
+virtual and not a bridge.
- - - - + + +
+
+
+

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

+ + +
+ network.js, line 2152 +
+ +
+
+
+ + +
+

Query the IPv6 DNS servers associated with the logical interface.

+
+ -

getDNS6Addrs() → {Array.<string>}

- - - - -
-

Query the IPv6 DNS servers associated with the logical interface.

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

Returns an array of IPv6 DNS servers registered by the remote -protocol backend.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of IPv6 DNS servers registered by the remote +protocol backend.
+ + + +
+
+
+

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

+ + +
+ network.js, line 2064 +
+ +
+
+
+ + +
+

Query the IPv4 DNS servers associated with the logical interface.

+
+ -

getDNSAddrs() → {Array.<string>}

- - - - -
-

Query the IPv4 DNS servers associated with the logical interface.

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

Returns an array of IPv4 DNS servers registered by the remote -protocol backend.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of IPv4 DNS servers registered by the remote +protocol backend.
+ + + +
+
+
+

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

+ + +
+ network.js, line 2196 +
+ +
- +
+
-

getErrors() → {Array.<string>}

- - - - - -
-

Query interface error messages published in ubus runtime state.

+
+

Query interface error messages published in ubus runtime state.

Interface errors are emitted by remote protocol handlers if the setup of the underlying logical interface failed, e.g. due to bad configuration or network connectivity issues.

@@ -1300,3328 +2248,3033 @@ messages using the descriptions registered by Network.registerErrorCode() and fall back to "Unknown error (%s)" where %s is replaced by the error code in case no translation can be found.

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

Returns an array of translated interface error messages.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of translated interface error messages.
+ + + +
+
+
+

+ + getExpiry(){number} +

+ + +
+ network.js, line 1947 +
+ +
- +
+
-

getExpiry() → {number}

- - - - - -
-

Get the logical interface expiry time in seconds.

+
+

Get the logical interface expiry time in seconds.

For protocols that have a concept of a lease, such as DHCP or DHCPv6, this function returns the remaining time in seconds until the lease expires.

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

Returns the amount of seconds until the lease expires or -1 -if it isn't applicable to the associated protocol.

-
- - - -
-
- Type -
-
- -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the amount of seconds until the lease expires or -1 +if it isn't applicable to the associated protocol.
+ + + +
+
+
+

+ + getGateway6Addr(){string} +

+ + +
+ network.js, line 2132 +
+ +
- +
+
-

getGateway6Addr() → {string}

- - - - - -
-

Query the gateway (nexthop) of the IPv6 default route associated with +

+

Query the gateway (nexthop) of the IPv6 default route associated with this logical interface.

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

Returns a string containing the IPv6 nexthop address of the associated -default route or null if no default route was found.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns a string containing the IPv6 nexthop address of the associated +default route or null if no default route was found.
+ + + +
+
+
+

+ + getGatewayAddr(){string} +

+ + +
+ network.js, line 2044 +
+ +
- +
+
-

getGatewayAddr() → {string}

- - - - - -
-

Query the gateway (nexthop) of the default route associated with +

+

Query the gateway (nexthop) of the default route associated with this logical interface.

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

Returns a string containing the IPv4 nexthop address of the associated -default route or null if no default route was found.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns a string containing the IPv4 nexthop address of the associated +default route or null if no default route was found.
+ + + +
+
+
+

+ + abstractgetI18n(){string} +

+ + +
+ network.js, line 1892 +
+ +
- +
+
-

(abstract) getI18n() → {string}

- - - - - -
-

Return a human readable description for the protcol, such as +

+

Return a human readable description for the protcol, such as Static address or DHCP client.

This function should be overwritten by subclasses.

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

Returns the description string.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the description string.
+ + + +
+
+
+

+ + getIfname(){null|string} +

+ + +
+ network.js, line 1852 +
+ +
+
+
+ + +
+

Get the associared Linux network device of this network.

+
+ -

getIfname() → {null|string}

- - - - -
-

Get the associared Linux network device of this network.

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

Returns the name of the associated network device or null if -it could not be determined.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the name of the associated network device or null if +it could not be determined.
+ + + +
+
+
+

+ + getIP6Addr(){null|string} +

+ + +
+ network.js, line 2083 +
+ +
+
+
+ + +
+

Query the first (primary) IPv6 address of the logical interface.

+
+ -

getIP6Addr() → {null|string}

- - - - -
-

Query the first (primary) IPv6 address of the logical interface.

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

Returns the primary IPv6 address registered by the protocol handler -in CIDR notation or null if no IPv6 addresses were set.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the primary IPv6 address registered by the protocol handler +in CIDR notation or null if no IPv6 addresses were set.
+ + + +
+
+
+

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

+ + +
+ network.js, line 2105 +
+ +
+
+
+ + +
+

Query all IPv6 addresses of the logical interface.

+
+ -

getIP6Addrs() → {Array.<string>}

- - - - -
-

Query all IPv6 addresses of the logical interface.

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

Returns an array of IPv6 addresses in CIDR notation which have been +

+ + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of IPv6 addresses in CIDR notation which have been registered by the protocol handler. The order of the resulting array -follows the order of the addresses in ubus runtime information.

- - - - -
-
- Type -
-
- -Array.<string> - - -
-
+follows the order of the addresses in ubus runtime information.
- - - - + + +
+
+
+

+ + getIP6Prefix(){null|string} +

+ + +
+ network.js, line 2171 +
+ +
+
+
+ + +
+

Query the routed IPv6 prefix associated with the logical interface.

+
+ -

getIP6Prefix() → {null|string}

- - - - -
-

Query the routed IPv6 prefix associated with the logical interface.

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

Returns the routed IPv6 prefix registered by the remote protocol -handler or null if no prefix is present.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the routed IPv6 prefix registered by the remote protocol +handler or null if no prefix is present.
+ + + +
+
+
+

+ + getIPAddr(){null|string} +

+ + +
+ network.js, line 1999 +
+ +
+
+
+ + +
+

Query the first (primary) IPv4 address of the logical interface.

+
+ -

getIPAddr() → {null|string}

- - - - -
-

Query the first (primary) IPv4 address of the logical interface.

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

Returns the primary IPv4 address registered by the protocol handler -or null if no IPv4 addresses were set.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the primary IPv4 address registered by the protocol handler +or null if no IPv4 addresses were set.
+ + + +
+
+
+

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

+ + +
+ network.js, line 2012 +
+ +
+
+
+ + +
+

Query all IPv4 addresses of the logical interface.

+
+ -

getIPAddrs() → {Array.<string>}

- - - - -
-

Query all IPv4 addresses of the logical interface.

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

Returns an array of IPv4 addresses in CIDR notation which have been +

+ + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of IPv4 addresses in CIDR notation which have been registered by the protocol handler. The order of the resulting array -follows the order of the addresses in ubus runtime information.

- - - - -
-
- Type -
-
- -Array.<string> - - -
-
+follows the order of the addresses in ubus runtime information.
- - - - + + +
+
+
+

+ + getL2Device(){LuCI.Network.Device} +

+ + +
+ network.js, line 2470 +
+ +
- +
+
-

getL2Device() → {LuCI.Network.Device}

- - - - - -
-

Returns the layer 2 linux network device currently associated +

+

Returns the layer 2 linux network device currently associated with this logical interface.

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

Returns a Network.Device class instance representing the Linux -network device currently associated with the logical interface.

-
- - - -
-
- Type -
-
- -LuCI.Network.Device - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + LuCI.Network.Device + + + Returns a Network.Device class instance representing the Linux +network device currently associated with the logical interface.
+ + + +
+
+
+

+ + getL3Device(){LuCI.Network.Device} +

+ + +
+ network.js, line 2483 +
+ +
- +
+
-

getL3Device() → {LuCI.Network.Device}

- - - - - -
-

Returns the layer 3 linux network device currently associated +

+

Returns the layer 3 linux network device currently associated with this logical interface.

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

Returns a Network.Device class instance representing the Linux -network device currently associated with the logical interface.

-
- - - -
-
- Type -
-
- -LuCI.Network.Device - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + LuCI.Network.Device + + + Returns a Network.Device class instance representing the Linux +network device currently associated with the logical interface.
+ + + +
+
+
+

+ + getMetric(){number} +

+ + +
+ network.js, line 1967 +
+ +
+
+
+ + +
+

Get the metric value of the logical interface.

+
+ -

getMetric() → {number}

- - - - -
-

Get the metric value of the logical interface.

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

Returns the current metric value used for device and network -routes spawned by the associated logical interface.

-
- - - -
-
- Type -
-
- -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the current metric value used for device and network +routes spawned by the associated logical interface.
+ + + +
+
+
+

+ + getName(){string} +

+ + +
+ network.js, line 1922 +
+ +
+
+
+ + +
+

Get the name of the associated logical interface.

+
+ -

getName() → {string}

- - - - -
-

Get the name of the associated logical interface.

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

Returns the logical interface name, such as lan or wan.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the logical interface name, such as lan or wan.
+ + + +
+
+
+

+ + getNetmask(){null|string} +

+ + +
+ network.js, line 2030 +
+ +
+
+
+ + +
+

Query the first (primary) IPv4 netmask of the logical interface.

+
+ -

getNetmask() → {null|string}

- - - - -
-

Query the first (primary) IPv4 netmask of the logical interface.

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

Returns the netmask of the primary IPv4 address registered by the -protocol handler or null if no IPv4 addresses were set.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the netmask of the primary IPv4 address registered by the +protocol handler or null if no IPv4 addresses were set.
+ + + +
+
+
+

+ + abstractgetOpkgPackage(){string} +

+ + +
+ network.js, line 2236 +
+ +
- +
+
-

(abstract) getOpkgPackage() → {string}

- - - - - -
-

Get the name of the opkg package providing the protocol functionality.

+
+

Get the name of the opkg package providing the protocol functionality.

This function should be overwritten by protocol specific subclasses.

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

Returns the name of the opkg package required for the protocol to -function, e.g. odhcp6c for the dhcpv6 prototocol.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the name of the opkg package required for the protocol to +function, e.g. odhcp6c for the dhcpv6 prototocol.
+ + + +
+
+
+

+ + abstractgetProtocol(){string} +

+ + +
+ network.js, line 1878 +
+ +
- +
+
-

(abstract) getProtocol() → {string}

- - - - - -
-

Get the name of this network protocol class.

+
+

Get the name of this network protocol class.

This function will be overwritten by subclasses created by Network.registerProtocol().

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

Returns the name of the network protocol implementation, e.g. -static or dhcp.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the name of the network protocol implementation, e.g. +static or dhcp.
+ + + +
+
+
+

+ + getType(){null|string} +

+ + +
+ network.js, line 1912 +
+ +
- +
+
-

getType() → {null|string}

- - - - - -
-

Get the type of the underlying interface.

+
+

Get the type of the underlying interface.

This function actually is a convenience wrapper around proto.get("type") and is mainly used by other LuCI.Network code to check whether the interface is declared as bridge in UCI.

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

Returns the value of the type option of the associated logical -interface or null if no type option is set.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the value of the type option of the associated logical +interface or null if no type option is set.
+ + + +
+
+
+

+ + getUptime(){number} +

+ + +
+ network.js, line 1932 +
+ +
+
+
+ + +
+

Get the uptime of the logical interface.

+
+ -

getUptime() → {number}

- - - - -
-

Get the uptime of the logical interface.

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

Returns the uptime of the associated interface in seconds.

-
- - - -
-
- Type -
-
- -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the uptime of the associated interface in seconds.
+ + + +
+
+
+

+ + getZoneName(){null|string} +

+ + +
+ network.js, line 1983 +
+ +
- +
+
-

getZoneName() → {null|string}

- - - - - -
-

Get the requested firewall zone name of the logical interface.

+
+

Get the requested firewall zone name of the logical interface.

Some protocol implementations request a specific firewall zone to trigger inclusion of their resulting network devices into the firewall rule set.

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

Returns the requested firewall zone name as published in the +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the requested firewall zone name as published in the ubus runtime information or null if the remote protocol -handler didn't request a zone.

- - - - -
-
- Type -
-
- -null -| - -string - - -
-
+handler didn't request a zone.
- - - - + + +
+
+
+

+ + isAlias(){null|string} +

+ + +
+ network.js, line 2324 +
+ +
- +
+
-

isAlias() → {null|string}

- - - - - -
-

Checks whether this interface is an alias interface.

+
+

Checks whether this interface is an alias interface.

Alias interfaces are interfaces layering on top of another interface and are denoted by a special @interfacename notation in the underlying ifname option.

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

Returns the name of the parent interface if this logical interface -is an alias or null if it is not an alias interface.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the name of the parent interface if this logical interface +is an alias or null if it is not an alias interface.
+ + + +
+
+
+

+ + isBridge(){boolean} +

+ + +
+ network.js, line 2221 +
+ +
+
+
+ + +
+

Checks whether the underlying logical interface is declared as bridge.

+
+ -

isBridge() → {boolean}

- - - - -
-

Checks whether the underlying logical interface is declared as bridge.

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

Returns true when the interface is declared with option type bridge +

+ + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when the interface is declared with option type bridge and when the associated protocol implementation is not marked virtual -or false when the logical interface is no bridge.

- - - - -
-
- Type -
-
- -boolean - - -
-
+or false when the logical interface is no bridge.
- - - - + + +
+
+
+

+ + isDynamic(){boolean} +

+ + +
+ network.js, line 2309 +
+ +
- +
+
-

isDynamic() → {boolean}

- - - - - -
-

Checks whether this logical interface is dynamic.

+
+

Checks whether this logical interface is dynamic.

A dynamic interface is an interface which has been created at runtime, e.g. as sub-interface of another interface, but which is not backed by any user configuration. Such dynamic interfaces cannot be edited but only brought down or restarted.

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

Returns a boolean indicating whether this interface is dynamic (true) -or not (false).

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns a boolean indicating whether this interface is dynamic (true) +or not (false).
+ + + +
+
+
+

+ + isEmpty(){boolean} +

+ + +
+ network.js, line 2344 +
+ +
- +
+
-

isEmpty() → {boolean}

- - - - - -
-

Checks whether this logical interface is "empty", meaning that ut +

+

Checks whether this logical interface is "empty", meaning that ut has no network devices attached.

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

Returns true if this logical interface is empty, else false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true if this logical interface is empty, else false.
+ + + +
+
+
+

+ + isFloating(){boolean} +

+ + +
+ network.js, line 2293 +
+ +
- +
+
-

isFloating() → {boolean}

- - - - - -
-

Checks whether this protocol is "floating".

+
+

Checks whether this protocol is "floating".

A "floating" protocol is a protocol which spawns its own interfaces on demand, like a virtual one but which relies on an existinf lower level interface to initiate the connection.

An example for such a protocol is "pppoe".

This function exists for backwards compatibility with older code but should not be used anymore.

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

Returns a boolean indicating whether this protocol is floating (true) -or not (false).

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns a boolean indicating whether this protocol is floating (true) +or not (false).
+ + + +
+
+
+

+ + abstractisInstalled(){boolean} +

+ + +
+ network.js, line 2252 +
+ +
- +
+
-

(abstract) isInstalled() → {boolean}

- - - - - -
-

Checks whether the protocol functionality is installed.

+
+

Checks whether the protocol functionality is installed.

This function exists for compatibility with old code, it always returns true.

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

Returns true if the protocol support is installed, else false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true if the protocol support is installed, else false.
+ + + +
+
+
+

+ + isUp(){boolean} +

+ + +
+ network.js, line 2366 +
+ +
+
+
+ + +
+

Checks whether this logical interface is configured and running.

+
+ -

isUp() → {boolean}

- - - - -
-

Checks whether this logical interface is configured and running.

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

Returns true when the interface is active or false when it is not.

-
- - - -
-
- Type -
-
- -boolean - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when the interface is active or false when it is not.
+ + + +
+
+
+

+ + isVirtual(){boolean} +

+ + +
+ network.js, line 2272 +
+ +
- +
+
-

isVirtual() → {boolean}

- - - - - -
-

Checks whether this protocol is "virtual".

+
+

Checks whether this protocol is "virtual".

A "virtual" protocol is a protocol which spawns its own interfaces on demand instead of using existing physical interfaces.

Examples for virtual protocols are 6in4 which gre spawn tunnel network device on startup, examples for non-virtual protcols are dhcp or static which apply IP configuration to existing interfaces.

This function should be overwritten by subclasses.

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

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 10:17:12 GMT+0100 (Central European Standard Time) +
+
- - - -
- -
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 b050c68bc8..89d050e87d 100644 --- a/documentation/jsapi/LuCI.Network.WifiDevice.html +++ b/documentation/jsapi/LuCI.Network.WifiDevice.html @@ -1,197 +1,1234 @@ - + - JSDoc: Class: WifiDevice - - - + Class: WifiDevice + + + + + - - - - - -
- -

Class: WifiDevice

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

Class: WifiDevice

+
- -
-

- LuCI.Network.WifiDevice

- -

A Network.WifiDevice class instance represents a wireless radio device +

+

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

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

+ + new LuCI.Network.WifiDevice() +

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

Methods

- +
+
+
+

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

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

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

- - - - - -
-

Adds a new wireless network associated with this radio device to the +

+

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

-
- - - - - - - - - -
Parameters:
+
+ + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + +
NameTypeAttributesDescription
NameTypeDescription
options @@ -200,170 +1237,153 @@ configuration and sets its options to the provided values.

- - <optional>
- - - - - -

The options to set for the newly added wireless network.

+ + + optional + + + + + +

The options to set for the newly added wireless network.

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

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

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

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
network @@ -372,163 +1392,149 @@ radio device.

The name of the wireless network to lookup. This may be either an uci + +

+ +

The name of the wireless network to lookup. This may be either an uci configuration section ID, a network ID in the form radio#.network# or a Linux network device name like wlan0 which is resolved to the corresponding configuration section through ubus runtime information.

- - - - - - + + +
- + + + + - - - - - - - - - - - -
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
+ + Promise.<boolean> + + + Returns a promise resolving to true when the wireless network was +successfully deleted from the configuration or false when the given +network could not be found or if the found network was not associated +with this wireless radio device.
+ + + +
+ + + +
+
+

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

+ + +
+ network.js, line 2997 +
+ +
+ + +
+
+ + +
+

Read the given UCI option value of this wireless device.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + +
NameTypeDescription
opt @@ -537,202 +1543,187 @@ with this wireless radio device.

The UCI option name to read.

+ +

The UCI option name to read.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + | + + Array.<string> + + + Returns the UCI option value or null if the requested option is +not found.
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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

-
- - - -
-
- Type -
-
- -null -| - -string -| - -Array.<string> - - -
-
- - - - - - +
+
+
+

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

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

getHTModes() → {Array.<string>}

- - - - - -
-

Gets a list of supported htmodes.

+
+

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:

+
+ + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + 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
  • @@ -740,1036 +1731,487 @@ known mode values are:

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

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

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

getHWModes() → {Array.<string>}

- - - - - -
-

Gets a list of supported hwmodes.

+
+

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 an array of valid hwmode values for this radio. Currently -known mode values are:

+
+ + + + + + + + + -
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
  • -
- - - - -
-
- Type -
-
- -Array.<string> - - -
-
- - - - - - - - - - - - - -

getI18n() → {string}

- - - - - - -
-

Get a string describing the wireless radio hardware.

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

Returns the description string.

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

getName() → {string}

- - - - - - -
-

Get the configuration name of this wireless radio.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
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 - - -
-
- - - - - - - - - - - - - -

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

- - - - - - -
-

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

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

+ getI18n(){string} +

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

Get a string describing the wireless radio hardware.

+
+ -

isDisabled() → {boolean}

- - - - -
-

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

isUp() → {boolean}

- - - - - - -
-

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

-
- - - - - - - - - - - - - -
- - + + + + +
Returns:
- - - - - - - - - - - - - - - - - -
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:
- - - - - - - - - - - - + + + + + +
NameTypeDescription
opt + string + + + Returns the description string.
+ + + +
+ + + +
+
+

+ + getName(){string} +

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

Get the configuration name of this wireless radio.

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

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

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

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

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + +
NameTypeDescription
network @@ -1778,21 +2220,477 @@ runtime state.

The name of the UCI option to set.

+ +

The name of the wireless network to lookup. This may be either an uci +configuration section ID, a network ID in the form radio#.network# +or a Linux network device name like wlan0 which is resolved to the +corresponding configuration section through ubus runtime information.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Promise.<LuCI.Network.WifiNetwork> + + + 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.

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

+ + isDisabled(){boolean} +

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

Checks whether this wireless radio is disabled.

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

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

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

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when the radio device is up, else false.
+ + + + +
+ + + +
+
+

+ + set(opt, val) +

+ + +
+ network.js, line 3011 +
+ +
+ + +
+
+ + +
+

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

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
NameTypeDescription
opt + + +string + + + + + +

The name of the UCI option to set.

val @@ -1807,109 +2705,83 @@ runtime state.

The value to set or null to remove the given option from the + +

+ +

The value to set or null to remove the given option from the configuration.

- - - - - - + + +
- + + + + - - - - - - - - - - - -
Source:
-
- - - -
+ + + + + + + + + + +
+ + + + + + + + - - - - - - - - - + - - - - - - - - - - - +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+ - - - -
- -
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 62e43aa5ec..20ba7447a6 100644 --- a/documentation/jsapi/LuCI.Network.WifiNetwork.html +++ b/documentation/jsapi/LuCI.Network.WifiNetwork.html @@ -1,195 +1,1234 @@ - + - JSDoc: Class: WifiNetwork - - - + Class: WifiNetwork + + + + + - - - - - -
- -

Class: WifiNetwork

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

Class: WifiNetwork

+
- -
-

- LuCI.Network.WifiNetwork

- -

A Network.WifiNetwork instance represents a wireless network (vif) +

+

+ LuCI.Network. + + WifiNetwork +

+ +

A Network.WifiNetwork instance represents a wireless network (vif) configured on top of a radio device and provides functions for querying the runtime state of the network. Most radio devices support multiple such networks in parallel.

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

+ + new LuCI.Network.WifiNetwork() +

+ +
+ network.js, line 3280 +
+
+
+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
- +
+ + + + + + + + + + + - -

Methods

- +
+
+
+

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

+ + +
+ network.js, line 3313 +
+ +
+
+
+ + +
+

Read the given UCI option value of this wireless network.

+
+ -

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

- - - - -
-

Read the given UCI option value of this wireless network.

-
- - - - - - - - - -
Parameters:
+ + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + + + + +
NameTypeDescription
NameTypeDescription
opt @@ -198,422 +1237,387 @@ such networks in parallel.

The UCI option name to read.

+ +

The UCI option name to read.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + | + + Array.<string> + + + Returns the UCI option value or null if the requested option is +not found.
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
-

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

-
- - - -
-
- Type -
-
- -null -| - -string -| - -Array.<string> - - -
-
- - - - - - +
+
+
+

+ + getActiveBSSID(){string} +

+ + +
+ network.js, line 3566 +
+ +
+
+
+ + +
+

Query the current BSSID from runtime information.

+
+ -

getActiveBSSID() → {string}

- - - - -
-

Query the current BSSID from runtime information.

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

Returns the current BSSID or Mesh ID as reported by ubus runtime -information.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the current BSSID or Mesh ID as reported by ubus runtime +information.
+ + + +
+
+
+

+ + getActiveEncryption(){string} +

+ + +
+ network.js, line 3577 +
+ +
+
+
+ + +
+

Query the current encryption settings from runtime information.

+
+ -

getActiveEncryption() → {string}

- - - - -
-

Query the current encryption settings from runtime information.

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

Returns a string describing the current encryption or - if the the -encryption state could not be found in ubus runtime information.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns a string describing the current encryption or - if the the +encryption state could not be found in ubus runtime information.
+ + + +
+
+
+

+ + getActiveMode(){string} +

+ + +
+ network.js, line 3514 +
+ +
+
+
+ + +
+

Query the current operation mode from runtime information.

+
+ -

getActiveMode() → {string}

- - - - -
-

Query the current operation mode from runtime information.

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

Returns the human readable mode name as reported by ubus runtime -state. Possible returned values are:

+
+ + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the human readable mode name as reported by ubus runtime +state. Possible returned values are:
  • Master
  • Ad-Hoc
  • @@ -625,3475 +1629,3166 @@ state. Possible returned values are:

  • P2P Client
  • P2P Go
  • Unknown
  • -
- - - - -
-
- Type -
-
- -string - - -
-
+
- - - - + + +
+
+
+

+ + getActiveModeI18n(){string} +

+ + +
+ network.js, line 3535 +
+ +
- +
+
-

getActiveModeI18n() → {string}

- - - - - -
-

Query the current operation mode from runtime information as +

+

Query the current operation mode from runtime information as translated string.

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

Returns the translated, human readable mode name as reported by -ubus runtime state.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the translated, human readable mode name as reported by +ubus runtime state.
+ + + +
+
+
+

+ + getActiveSSID(){string} +

+ + +
+ network.js, line 3555 +
+ +
+
+
+ + +
+

Query the current SSID from runtime information.

+
+ -

getActiveSSID() → {string}

- - - - -
-

Query the current SSID from runtime information.

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

Returns the current SSID or Mesh ID as reported by ubus runtime -information.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the current SSID or Mesh ID as reported by ubus runtime +information.
+ + + +
+
+
+

+ + getAssocList(){Promise.<Array.<LuCI.Network.WifiPeerEntry>>} +

+ + +
+ network.js, line 3757 +
+ +
+
+
+ + +
+

Fetch the list of associated peers.

+
+ -

getAssocList() → {Promise.<Array.<LuCI.Network.WifiPeerEntry>>}

- - - - -
-

Fetch the list of associated peers.

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

Returns a promise resolving to an array of wireless peers associated -with this network.

-
- - - -
-
- Type -
-
- -Promise.<Array.<LuCI.Network.WifiPeerEntry>> - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Promise.<Array.<LuCI.Network.WifiPeerEntry>> + + + Returns a promise resolving to an array of wireless peers associated +with this network.
+ + + +
+
+
+

+ + getBitRate(){null|number} +

+ + +
+ network.js, line 3787 +
+ +
- +
+
-

getBitRate() → {null|number}

- - - - - -
-

Query the current average bitrate of all peers associated to this +

+

Query the current average bitrate of all peers associated to this wireless network.

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

Returns the average bit rate among all peers associated to the network +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + number + + + Returns the average bit rate among all peers associated to the network as reported by ubus runtime information or null if the information -is not available.

- - - - -
-
- Type -
-
- -null -| - -number - - -
-
+is not available.
- - - - + + +
+
+
+

+ + getBSSID(){null|string} +

+ + +
+ network.js, line 3392 +
+ +
+
+
+ + +
+

Get the configured BSSID of the wireless network.

+
+ -

getBSSID() → {null|string}

- - - - -
-

Get the configured BSSID of the wireless network.

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

Returns the BSSID value or null if none has been specified.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the BSSID value or null if none has been specified.
+ + + +
+
+
+

+ + getChannel(){null|number} +

+ + +
+ network.js, line 3803 +
+ +
+
+
+ + +
+

Query the current wireless channel.

+
+ -

getChannel() → {null|number}

- - - - -
-

Query the current wireless channel.

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

Returns the wireless channel as reported by ubus runtime information -or null if it cannot be determined.

-
- - - -
-
- Type -
-
- -null -| - -number - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + number + + + Returns the wireless channel as reported by ubus runtime information +or null if it cannot be determined.
+ + + +
+
+
+

+ + getCountryCode(){string} +

+ + +
+ network.js, line 3836 +
+ +
+
+
+ + +
+

Query the current country code.

+
+ -

getCountryCode() → {string}

- - - - -
-

Query the current country code.

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

Returns the wireless country code as reported by ubus runtime -information or 00 if it cannot be determined.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the wireless country code as reported by ubus runtime +information or 00 if it cannot be determined.
+ + + +
+
+
+

+ + getDevice(){LuCI.Network.Device} +

+ + +
+ network.js, line 3982 +
+ +
+
+
+ + +
+

Get the associated Linux network device.

+
+ -

getDevice() → {LuCI.Network.Device}

- - - - -
-

Get the associated Linux network device.

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

Returns a Network.Device instance representing the Linux network -device associted with this wireless network.

-
- - - -
-
- Type -
-
- -LuCI.Network.Device - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + LuCI.Network.Device + + + Returns a Network.Device instance representing the Linux network +device associted with this wireless network.
+ + + +
+
+
+

+ + getFrequency(){null|string} +

+ + +
+ network.js, line 3769 +
+ +
+
+
+ + +
+

Query the current operating frequency of the wireless network.

+
+ -

getFrequency() → {null|string}

- - - - -
-

Query the current operating frequency of the wireless network.

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

Returns the current operating frequency of the network from ubus +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the current operating frequency of the network from ubus runtime information in GHz or null if the information is not -available.

- - - - -
-
- Type -
-
- -null -| - -string - - -
-
+available.
- - - - + + +
+
+
+

+ + getI18n(){string} +

+ + +
+ network.js, line 3930 +
+ +
+
+
+ + +
+

Get a description string for this wireless network.

+
+ -

getI18n() → {string}

- - - - -
-

Get a description string for this wireless network.

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

Returns a string describing this network, consisting of the +

+ + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns a string describing this network, consisting of the term Wireless Network, followed by the active operation mode, the SSID, BSSID or internal network ID and the Linux network device -name, depending on which information is available.

- - - - -
-
- Type -
-
- -string - - -
-
+name, depending on which information is available.
- - - - + + +
+
+
+

+ + getID(){string} +

+ + +
+ network.js, line 3417 +
+ +
- +
+
-

getID() → {string}

- - - - - -
-

Get the internal network ID of this wireless network.

+
+

Get the internal network ID of this wireless network.

The network ID is a LuCI specific identifer in the form radio#.network# to identify wireless networks by their corresponding radio and network index numbers.

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

Returns the LuCI specific network ID.

-
- - - -
-
- Type -
-
- -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the LuCI specific network ID.
+ + + +
+
+
+

+ + getIfname(){null|string} +

+ + +
+ network.js, line 3439 +
+ +
+
+
+ + +
+

Get the Linux network device name.

+
+ -

getIfname() → {null|string}

- - - - -
-

Get the Linux network device name.

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

Returns the current Linux network device name as resolved from +

+ + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the current Linux network device name as resolved from ubus runtime information or null if this network has no -associated network device, e.g. when not configured or up.

- - - - -
-
- Type -
-
- -null -| - -string - - -
-
+associated network device, e.g. when not configured or up.
- - - - + + +
+
+
+

+ + getMeshID(){null|string} +

+ + +
+ network.js, line 3379 +
+ +
+
+
+ + +
+

Get the configured Mesh ID of the wireless network.

+
+ -

getMeshID() → {null|string}

- - - - -
-

Get the configured Mesh ID of the wireless network.

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

Returns the configured mesh ID value or null when this network -is not in mesh mode.

-
- - - -
-
- Type -
-
- -null -| - -string - - -
-
+ + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the configured mesh ID value or null when this network +is not in mesh mode.
+ + + +
+
+
+

+ + getMode(){string} +

+ + +
+ network.js, line 3354 +
+ +
+
+
+ + +
+

Get the configured operation mode of the wireless network.

+
+ -

getMode() → {string}

- - - - -
-

Get the configured operation mode of the wireless network.

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

Returns the configured operation mode. Possible values are:

+
+ + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns the configured operation mode. Possible values are:
  • ap - Master (Access Point) mode
  • sta - Station (client) mode
  • adhoc - Ad-Hoc (IBSS) mode
  • mesh - Mesh (IEEE 802.11s) mode
  • monitor - Monitor mode
  • -
- - - - -
-
- Type -
-
- -string - - -
-
+
- - - - + + +
+
+
+

+ + getName(){string} +

+ + +
+ network.js, line 3427 +
+ +
+
+
+ + +
+

Get the configuration ID of this wireless network.

+
+ -

getName() → {string}

- - - - -
-

Get the configuration ID of this wireless network.

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

Returns the corresponding UCI section ID of the network.

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

getNetwork() → {null|LuCI.Network.Protocol}

- - - - - - -
-

Get the primary logical interface this wireless network is attached to.

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

Returns a Network.Protocol instance representing the logical -interface or null if this network is not attached to any logical -interface.

-
- - - -
-
- Type -
-
- -null -| - -LuCI.Network.Protocol - - -
-
- - - - - - - - - - - - - -

getNetworkNames() → {Array.<string>}

- - - - - - -
-

Get the names of the logical interfaces this wireless network is -attached to.

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

Returns an array of logical interface names.

-
- - - -
-
- Type -
-
- -Array.<string> - - -
-
- - - - - - - - - - - - - -

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

- - - - - - -
-

Get the logical interfaces this wireless network is attached to.

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

Returns an array of Network.Protocol instances representing the -logical interfaces this wireless network is attached to.

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

getNoise() → {number}

- - - - - - -
-

Query the current radio noise floor.

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

Returns the radio noise floor in dBm as reported by ubus runtime -information or 0 if it cannot be determined.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

getShortName() → {string}

- - - - - - -
-

Get a short description string for this wireless network.

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

Returns a string describing this network, consisting of the -active operation mode, followed by either the SSID, BSSID or -internal network ID, depending on which information is available.

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

getSignal() → {null|number}

- - - - - - -
-

Query the current wireless signal.

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

Returns the wireless signal in dBm as reported by ubus runtime -information or null if it cannot be determined.

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

getSignalLevel() → {number}

- - - - - - -
-

Calculate the current signal.

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

Returns the calculated signal level, which is the difference between -noise and signal (SNR), divided by 5.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

getSignalPercent() → {number}

- - - - - - -
-

Calculate the current signal quality percentage.

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

Returns the calculated signal quality in percent. The value is -calculated from the quality and quality_max indicators reported -by ubus runtime state.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

getSSID() → {null|string}

- - - - - - -
-

Get the configured SSID of the wireless network.

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

Returns the configured SSID value or null when this network is -in mesh mode.

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

getTXPower() → {null|number}

- - - - - - -
-

Query the current radio TX power.

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

Returns the wireless network transmit power in dBm as reported by -ubus runtime information or null if it cannot be determined.

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

getTXPowerOffset() → {number}

- - - - - - -
-

Query the radio TX power offset.

-

Some wireless radios have a fixed power offset, e.g. due to the -use of external amplifiers.

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

Returns the wireless network transmit power offset in dBm as reported -by ubus runtime information or 0 if there is no offset, or if it -cannot be determined.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - - - - - - - - - -

getWifiDevice() → {null|LuCI.Network.WifiDevice}

- - - - - - -
-

Get the corresponding wifi radio device.

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

Returns a Network.WifiDevice instance representing the corresponding -wifi radio device or null if the related radio device could not be -found.

-
- - - -
-
- Type -
-
- -null -| - -LuCI.Network.WifiDevice - - -
-
- - - - - - - - - - - - - -

getWifiDeviceName() → {null|string}

- - - - - - -
-

Get the name of the corresponding wifi radio device.

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

Returns the name of the radio device this network is configured on -or null if it cannot be determined.

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

isDisabled() → {boolean}

- - - - - - -
-

Checks whether this wireless network 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 - - -
-
- - - - - - - - - - - - - -

isUp() → {boolean}

- - - - - - -
-

Check whether the radio network is up.

-

This function actually queries the up state of the related radio -device and assumes this network to be up as well when the parent -radio is up. This is due to the fact that OpenWrt does not control -virtual interfaces individually but within one common hostapd -instance.

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

Returns true when the network is up, else false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - -

set(opt, val)

- +
Returns:
- -
-

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

-
- - - - - - - - - -
Parameters:
- - - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + string + + + Returns the corresponding UCI section ID of the network.
+ + + +
+ + + +
+
+

+ + getNetwork(){null|LuCI.Network.Protocol} +

+ + +
+ network.js, line 3946 +
+ +
+ + +
+
+ + +
+

Get the primary logical interface this wireless network is attached to.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + LuCI.Network.Protocol + + + Returns a Network.Protocol instance representing the logical +interface or null if this network is not attached to any logical +interface.
+ + + + +
+ + + +
+
+

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

+ + +
+ network.js, line 3403 +
+ +
+ + +
+
+ + +
+

Get the names of the logical interfaces this wireless network is +attached to.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<string> + + + Returns an array of logical interface names.
+ + + + +
+ + + +
+
+

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

+ + +
+ network.js, line 3957 +
+ +
+ + +
+
+ + +
+

Get the logical interfaces this wireless network is attached to.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<LuCI.Network.Protocol> + + + Returns an array of Network.Protocol instances representing the +logical interfaces this wireless network is attached to.
+ + + + +
+ + + +
+
+

+ + getNoise(){number} +

+ + +
+ network.js, line 3825 +
+ +
+ + +
+
+ + +
+

Query the current radio noise floor.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the radio noise floor in dBm as reported by ubus runtime +information or 0 if it cannot be determined.
+ + + + +
+ + + +
+
+

+ + getShortName(){string} +

+ + +
+ network.js, line 3915 +
+ +
+ + +
+
+ + +
+

Get a short description string for this wireless network.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + string + + + Returns a string describing this network, consisting of the +active operation mode, followed by either the SSID, BSSID or +internal network ID, depending on which information is available.
+ + + + +
+ + + +
+
+

+ + getSignal(){null|number} +

+ + +
+ network.js, line 3814 +
+ +
+ + +
+
+ + +
+

Query the current wireless signal.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + number + + + Returns the wireless signal in dBm as reported by ubus runtime +information or null if it cannot be determined.
+ + + + +
+ + + +
+
+

+ + getSignalLevel(){number} +

+ + +
+ network.js, line 3874 +
+ +
+ + +
+
+ + +
+

Calculate the current signal.

+
+ + + + + + + + + +
+ + + + + + + +
Deprecated
  • Yes
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the calculated signal level, which is the difference between +noise and signal (SNR), divided by 5.
+ + + + +
+ + + +
+
+

+ + getSignalPercent(){number} +

+ + +
+ network.js, line 3897 +
+ +
+ + +
+
+ + +
+

Calculate the current signal quality percentage.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the calculated signal quality in percent. The value is +calculated from the quality and quality_max indicators reported +by ubus runtime state.
+ + + + +
+ + + +
+
+

+ + getSSID(){null|string} +

+ + +
+ network.js, line 3365 +
+ +
+ + +
+
+ + +
+

Get the configured SSID of the wireless network.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the configured SSID value or null when this network is +in mesh mode.
+ + + + +
+ + + +
+
+

+ + getTXPower(){null|number} +

+ + +
+ network.js, line 3847 +
+ +
+ + +
+
+ + +
+

Query the current radio TX power.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + number + + + Returns the wireless network transmit power in dBm as reported by +ubus runtime information or null if it cannot be determined.
+ + + + +
+ + + +
+
+

+ + getTXPowerOffset(){number} +

+ + +
+ network.js, line 3862 +
+ +
+ + +
+
+ + +
+

Query the radio TX power offset.

+

Some wireless radios have a fixed power offset, e.g. due to the +use of external amplifiers.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + number + + + Returns the wireless network transmit power offset in dBm as reported +by ubus runtime information or 0 if there is no offset, or if it +cannot be determined.
+ + + + +
+ + + +
+
+

+ + getWifiDevice(){null|LuCI.Network.WifiDevice} +

+ + +
+ network.js, line 3467 +
+ +
+ + +
+
+ + +
+

Get the corresponding wifi radio device.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + LuCI.Network.WifiDevice + + + Returns a Network.WifiDevice instance representing the corresponding +wifi radio device or null if the related radio device could not be +found.
+ + + + +
+ + + +
+
+

+ + getWifiDeviceName(){null|string} +

+ + +
+ network.js, line 3455 +
+ +
+ + +
+
+ + +
+

Get the name of the corresponding wifi radio device.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + null + | + + string + + + Returns the name of the radio device this network is configured on +or null if it cannot be determined.
+ + + + +
+ + + +
+
+

+ + isDisabled(){boolean} +

+ + +
+ network.js, line 3339 +
+ +
+ + +
+
+ + +
+

Checks whether this wireless network is disabled.

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

+ + +
+ network.js, line 3488 +
+ +
+ + +
+
+ + +
+

Check whether the radio network is up.

+

This function actually queries the up state of the related radio +device and assumes this network to be up as well when the parent +radio is up. This is due to the fact that OpenWrt does not control +virtual interfaces individually but within one common hostapd +instance.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when the network is up, else false.
+ + + + +
+ + + +
+
+

+ + set(opt, val) +

+ + +
+ network.js, line 3327 +
+ +
+ + +
+
+ + +
+

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

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + +
NameTypeDescription
opt @@ -4102,21 +4797,21 @@ instance.

The name of the UCI option to set.

+ +

The name of the UCI option to set.

val @@ -4131,109 +4826,83 @@ instance.

The value to set or null to remove the given option from the + +

+ +

The value to set or null to remove the given option from the configuration.

- - - - - - + + +
- + + + + - - - - - - - - - - - -
Source:
-
- - - -
+ + + + + + + + + + +
+
+ + + + + + +
- - - - - - - - - +
- - - - - - - - - - - +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+
- - - -
- -
- Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 d0ab9f2c95..5b4d1e81b1 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.Network

- -

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

+

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

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

+ + new LuCI.Network() +

+ +
+ network.js, line 628 +
+
+
+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + + + + +

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

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

- - -
-

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

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

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

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

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

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

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

- - -
-

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

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

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

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

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

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

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

flushCache() → {Promise.<Object>}

- - - - - - -
-

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

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

Returns a promise resolving to the internal network state object.

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

formatWifiEncryption(encryption) → {null|string}

- - - - - - -
-

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

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

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

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

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

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

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

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

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

- - - - - - -
-

Get a sorted list of all found network devices.

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
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>> - - -
-
- - - - - - - - - - - - - -

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

- - - - - - -
-

Queries the internal DSL modem type from board information.

-
- - - - - - - - - - - - - -
- - - - - - - - - +
Returns:
- - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
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)> - - -
-
- - - - - - - - - - - - - -

getHostHints() → {Promise.<LuCI.Network.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 a Hosts instance describing host known on the system.

-
- - - -
-
- Type -
-
- -Promise.<LuCI.Network.Hosts> - - -
-
- - - - - - - - - - - - - -

getIfnameOf(obj) → {null|string}

- - - - - - -
-

Obtains the the network device name of the given object.

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

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

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

Get a sorted list of all found network devices.

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

Queries the internal DSL modem type from board information.

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

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.

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

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

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

Obtains the the network device name of the given object.

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

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

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

- - - - - - -
-

Gets an array containing all known networks.

-
- - - - - - - - - - - - - -
- - + + + + +
Returns:
- - - - - - - - - - - - - - - - - -
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:
- - - - - - - - - - - - - - + + + + + + + +
NameTypeAttributesDefaultDescription
+ + 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.
+ + + +
+ + + +
+
+

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

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

Gets an array containing all known networks.

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

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

+ + +
+ network.js, line 750 +
+ +
+ + +
+
+ + +
+

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 the instantiated protocol backend class or null if the given -protocol isn't known.

-
- - - -
-
- Type -
-
- -null -| - -LuCI.Network.Protocol - - -
-
- - - - - - - - - - - - - -

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

- - - - - - -
-

Obtains instances of all known Protocol -backend classes.

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

Returns an array of protocol class instances.

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

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

- - - - - - -
-

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

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

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

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

- - - - - - -
-

Get IPv6 wan networks.

-

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

-
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
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>> - - -
-
- - - - - - - - - - - - -

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

- - -
-

Get IPv4 wan networks.

-

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

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

Obtains instances of all known Protocol +backend classes.

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

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

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

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

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

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

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

Get IPv6 wan networks.

+

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

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

Get IPv4 wan networks.

+

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

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

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

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

- - - - - - -
-

Obtain a list of all configured radio devices.

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

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

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

- - - - - - -
-

Get a WifiNetwork instance describing -the given wireless network.

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

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

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

Obtain a list of all configured radio devices.

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

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

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

Get a WifiNetwork instance describing +the given wireless network.

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

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

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

+ + 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:
+ + - - - - - - - - - - - - - + + + + + + + +
NameTypeAttributesDefaultDescription
+ + boolean + + + Returns true if the given name is in the ignore pattern list, +else returns false.
+ + + +
+ + + +
+
+

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

+ + +
+ network.js, line 664 +
+ +
+ + +
+
+ + +
+

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:
+ + - - - - - - - - - - - - - + + + + + + + +
NameTypeAttributesDefaultDescription
+ + null + | + + number + + + Returns the number of prefix bits contained in the netmask or null +if the given netmask value was invalid.
+ + + +
+ + + +
+
+

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

+ + +
+ network.js, line 646 +
+ +
+ + +
+
+ + +
+

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

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 true if the error code description has been added or false -if either the arguments were invalid or if there already was a -description for the given code.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - - - - -

registerPatternVirtual(pat)

- - -
-

Registers a new regular expression pattern to recognize -virtual interfaces.

-
- - - - - - - - - -
Parameters:
+ + + + +
Returns:
+ + - - - - - - - - - + + + + + + + +
NameTypeDescription
+ + boolean + + + Returns true if the error code description has been added or false +if either the arguments were invalid or if there already was a +description for the given code.
+ + + +
+ + + +
+
+

+ + registerPatternVirtual(pat) +

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

Registers a new regular expression pattern to recognize +virtual interfaces.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + +
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,354 +4884,316 @@ 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
oldName - -string - - - + LuCI.Network.Protocol + +

The current name of the network.

Returns the new Protocol subclass.
newName - - -string - - - -

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

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

Returns a promise resolving to either true if the network was -successfully renamed or false if the new name was invalid, if -a network with the new name already exists or if the network to -rename could not be found.

-
- - - -
-
- Type -
-
- -Promise.<boolean> - - -
-
- - - - - - - - - - - -

Type Definitions

- - - -

SwitchTopology

- - - - -
-

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

-
- - - -
Type:
-
    -
  • -Object.<string, (Object|Array)> +
    +
    +

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

    + + +
    + network.js, line 1026 +
    + +
    + + +
    +
    + + +
    +

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

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    oldName + + +string - - + + + +

    The current name of the network.

    newName + + +string + + + +

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

    + + + +
    + + + + + + + + + + + + + + + + + + + + +
    - -
    Properties:
    + + - + + + + + +
    Returns:
    + + + +
    - - - - - - - - - + + + + + + + +
    NameTypeDescription
    + + 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 Definitions

+ +
+ +
+
+

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

+
+ + +
+
+ +
+

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

+
+ + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - + + + - + - - - + + + - + + + +
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 -peer associated with a local network.

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

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.

+
+ + + +
+ + +
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 -transmission rate to or from a peer.

    -
    - - - -
    Type:
    -
      -
    • - -Object.<string, (boolean|number)> - - -
    • -
    - - - - - -
    Properties:
    - +
    +
    +

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

    +
    + +
    +
    + +
    +

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

    +
    + + + +
    + + +
    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 -network found in the vincinity.

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

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

    +
    + +
    +
    + +
    +

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

    +
    + + + +
    + + +
    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 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 195fdc991b..a00c9a3acb 100644 --- a/documentation/jsapi/LuCI.Poll.html +++ b/documentation/jsapi/LuCI.Poll.html @@ -1,307 +1,1336 @@ - + - JSDoc: Class: Poll - - - + Class: Poll + + + + + - - - - - -
    - -

    Class: Poll

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

    Class: Poll

    +
    - -
    -

    - LuCI.Poll

    - -

    The Poll class allows registering and unregistering poll actions, +

    +

    + LuCI. + + Poll +

    + +

    The Poll class allows registering and unregistering poll actions, as well as starting, stopping and querying the state of the polling loop.

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

    + + new LuCI.Poll() +

    + +
    + luci.js, line 999 +
    +
    +
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    - +
    + + + + + + + + + + + - -

    Methods

    - +
    +
    +
    +

    + + active(){boolean} +

    + + +
    + luci.js, line 1150 +
    + +
    +
    +
    + + +
    +

    Test whether the polling loop is running.

    +
    + -

    active() → {boolean}

    - - - - -
    -

    Test whether the polling loop is running.

    -
    - - - - - - - - - - - - - + + + +
    - + + + + - - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - -
    Returns:
    - - -
    -
      -
    • Returns true if polling is active, else false.
    • -
    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - - - - - - - - -

    add(fn, interval) → {boolean}

    - - -
    -

    Add a new operation to the polling loop. If the polling loop is not -already started at this point, it will be implicitely started.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - + + + + + + + +
    NameTypeDescription
    + + boolean + + +
      +
    • Returns true if polling is active, else false.
    • +
    + + + +
    + + + +
    +
    +

    + + add(fn, interval){boolean} +

    + + +
    + luci.js, line 1023 +
    + +
    + + +
    +
    + + +
    +

    Add a new operation to the polling loop. If the polling loop is not +already started at this point, it will be implicitely started.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - + + - - - + + +
    NameTypeDescription
    fn @@ -310,21 +1339,21 @@ already started at this point, it will be implicitely started.

    The function to invoke on each poll interval.

    + +

    The function to invoke on each poll interval.

    interval @@ -333,78 +1362,55 @@ already started at this point, it will be implicitely started.

    The poll interval in seconds.

    + +

    The poll interval in seconds.

    - - - - - - + + +
    - + + + + - - - - - - - - - - - -
    Source:
    -
    - - - -
    + + + - - - - - - - - - - -
    Throws:
    - - + + + +
    Throws:
    + +
    @@ -412,7 +1418,6 @@ already started at this point, it will be implicitely started.

    Throws TypeError when an invalid interval was passed.

    -
    @@ -426,95 +1431,103 @@ already started at this point, it will be implicitely started.

    -
    - - - -
    Returns:
    - -
    -

    Returns true if the function has been added or false if it -already is registered.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - + + +
    Returns:
    - - - - - - - - - -

    remove(fn) → {boolean}

    - - - - - - -
    -

    Remove an operation from the polling loop. If no further operatons -are registered, the polling loop is implicitely stopped.

    -
    - - - - - - - - - -
    Parameters:
    - - - - - - - - - - - + + + + + + + +
    NameTypeDescription
    + + boolean + + + Returns true if the function has been added or false if it +already is registered.
    + + + + + + + +
    +
    +

    + + remove(fn){boolean} +

    + + +
    + luci.js, line 1064 +
    + +
    + + +
    +
    + + +
    +

    Remove an operation from the polling loop. If no further operatons +are registered, the polling loop is implicitely stopped.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    fn @@ -523,78 +1536,55 @@ are registered, the polling loop is implicitely stopped.

    The function to remove.

    + +

    The function to remove.

    - - - - - - + + +
    - + + + + - - - - - - - - - - - -
    Source:
    -
    - - - -
    + + + - - - - - - - - - - -
    Throws:
    - - + + + +
    Throws:
    + +
    @@ -602,7 +1592,6 @@ are registered, the polling loop is implicitely stopped.

    Throws TypeError when the given argument isn't a function.

    -
    @@ -616,291 +1605,274 @@ are registered, the polling loop is implicitely stopped.

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

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

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

    + + start(){boolean} +

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

    start() → {boolean}

    - - - - - -
    -

    (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 true if polling has been started (or if no functions -where registered) or false when the polling loop already runs.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    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 true if polling has been stopped or false if it din't -run to begin with.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    + + - - - - - + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    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 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 2028b406fc..530bf9a033 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.

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

    + + new LuCI.Request() +

    + +
    + luci.js, line 569 +
    +
    +
    +
    + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    + + +
    + + + + + + + +

    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,157 +1245,143 @@ 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
    + + LuCI.Request.interceptorFn + + + The registered function.
    + + + +
    + + + +
    +
    +

    + + expandURL(url){string} +

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

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

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    url @@ -365,160 +1390,144 @@ implementing request retries before returning a failure.

    The URL to convert.

    + +

    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:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + string + + + The absolute URL derived from the given one, or the original URL +if it already was absolute.
    + + + +
    + + + +
    +
    +

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

    + + +
    + luci.js, line 797 +
    + +
    + + +
    +
    + + +
    +

    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:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + Promise.<LuCI.Response> + + + The resulting HTTP response.
    + + + +
    + + + +
    +
    +

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

    + + +
    + luci.js, line 818 +
    + +
    + + +
    +
    + + +
    +

    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,169 +1774,152 @@ 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
    + + Promise.<LuCI.Response> + + + 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.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    interceptorFn @@ -964,159 +1928,143 @@ function.

    The interceptor function to remove.

    + +

    The interceptor function to remove.

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

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

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - - - - - - - - -

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

    - - -
    -

    Initiate an HTTP request to the given target.

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

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

    + + +
    + luci.js, line 648 +
    + +
    + + +
    +
    + + +
    +

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

    The resulting HTTP response.

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

    Type Definitions

    - - - - - - - -

    interceptorFn(res)

    - - -
    -

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

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

    Type Definitions

    + +
    + +
    +
    +

    + + LuCI.Request.interceptorFn(res) +

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

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

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    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 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 06c700dc4f..656f91152b 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.poll

    - -

    The Request.poll class provides some convience wrappers around +

    +

    + LuCI.Request. + + poll +

    + +

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

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

    + + new LuCI.Request.poll() +

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

    Methods

    - - - - - - -

    active()

    - - - - - - -
    -

    Alias for LuCI.Poll.active().

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

    Methods

    + +
    + +
    +
    +

    + + active() +

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

    Alias for LuCI.Poll.active().

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

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

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

    -
    - - - -
    -
    - Type -
    -
    - -function - - -
    -
    - + + +
    Returns:
    - - - - - - - - - -

    remove(entry) → {boolean}

    - - - - - - -
    -

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

    -
    - - - - - - - - - -
    Parameters:
    - - - - - - - - - - - + + + + + + + +
    NameTypeDescription
    + + function + + + Returns the internally created poll function.
    + + + + + + + +
    +
    +

    + + remove(entry){boolean} +

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

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

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

    The poll function returned by add().

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

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

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - - - - - - - - -

    start()

    - - - - - - -
    -

    Alias for LuCI.Poll.start().

    -
    - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -

    stop()

    - - - - - - -
    -

    Alias for LuCI.Poll.stop().

    -
    - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -

    Type Definitions

    - - + - +

    The poll function returned by add().

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

    callbackFn(res, data, duration)

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

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

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

    + + start() +

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

    Alias for LuCI.Poll.start().

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

    + + stop() +

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

    Alias for LuCI.Poll.stop().

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

    Type Definitions

    + +
    + +
    +
    +

    + + callbackFn(res, data, duration) +

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

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

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + + - + - - - - + + - - - + + +
    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 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 fea8f79d99..a7398ef507 100644 --- a/documentation/jsapi/LuCI.Response.html +++ b/documentation/jsapi/LuCI.Response.html @@ -1,631 +1,1506 @@ - + - JSDoc: Class: Response - - - + Class: Response + + + + + - - - - - -
    - -

    Class: Response

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

    Class: Response

    +
    - +
    +

    + LuCI. -

    - LuCI.Response

    - -

    The Response class is an internal utility class representing HTTP responses.

    - + Response + -
    +

    The Response class is an internal utility class representing HTTP responses.

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

    + + new LuCI.Response() +

    + +
    + luci.js, line 377 +
    +
    +
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    - +
    + + + + + + + + + + -

    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.

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

    The cloned Response instance.

    -
    - - - -
    -
    - Type -
    -
    - -LuCI.Response - - -
    -
    - - - - - - +
    +
    +
    +

    + + json(){*} +

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

    Access the response content as JSON data.

    +
    + -

    json() → {*}

    - - - - -
    -

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

    The parsed JSON data.

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

    + + text(){string} +

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

    Access the response content as string.

    +
    + -

    text() → {string}

    - - - - -
    -

    Access the response content as string.

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

    The response content.

    -
    - - - -
    -
    - Type -
    -
    - -string - - -
    -
    + + - - - - - + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + string + + + The response content.
    + + + + +
    + + + + + + - + + + + +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 b82f2a0fb5..5a17dfa855 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.XHR()

    - -

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

    +

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

    - -
    +
    + + - - -

    Constructor

    - - - -

    new XHR()

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

    + + new LuCI.XHR() +

    + +
    + luci.js, line 2943 +
    +
    +
    +
    + + + + + + + + +
    + + + + + + + +
    Deprecated
    • Yes
    + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    - +
    + + + + + + + + + + + - -

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

    Checks the running state of the request.

    +
    + -

    busy() → {boolean}

    - - - - -
    -

    Checks the running state of the request.

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

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

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    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
    + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<null> + + +
    - - - - - -
    - - - - - - - - - - - - - -
    Deprecated:
    • Yes
    - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - - - -
    -
    - Type -
    -
    - -Promise.<null> - - -
    -
    - - - - - - +
    +
    +
    +

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

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

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

    - - - - - -
    -

    This function is a legacy wrapper around +

    +

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

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + + + + +
    NameTypeAttributesDescription
    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
    + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<null> + + +
    - - - - - -
    - - - - - - - - - - - - - -
    Deprecated:
    • Yes
    - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - - - -
    -
    - Type -
    -
    - -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 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 b98c8f0a66..8412eb3025 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.

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

    + + new LuCI.dom() +

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

    Methods

    - +
    +
    +
    +

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

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

    Appends the given children data to the given node.

    +
    + -

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

    - - - - -
    -

    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:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + Node + | + + null + + + Returns the last children Node appended to the node or null +if either the node argument was no valid DOM node or if the +children was null or didn't result in further DOM nodes.
    + + + +
    + + + +
    +
    +

    + + attr(node, key, val) +

    + + +
    + luci.js, line 2331 +
    + +
    + + +
    +
    + + +
    +

    Sets attributes or registers event listeners on element nodes.

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

    -
    - - - -
    -
    - Type -
    -
    - -Class - - -
    -
    - + + +
    Returns:
    - - - - - - - - - -

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

    - - - - - - -
    -

    Finds a bound class instance on the given node itself or the -first bound instance on its closest parent node and invokes -the specified method name on the found class instance.

    -
    - - - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + Class + + + Returns the bound class instance.
    + + + + + + + +
    +
    +

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

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

    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.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    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:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + * + | + + null + + + Returns the return value of the invoked method if a class +instance and method has been found. Returns null if either +no bound class instance could be found, or if the found +instance didn't have the requested method.
    + + + +
    + + + +
    +
    +

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

    + + +
    + luci.js, line 2283 +
    + +
    + + +
    +
    + + +
    +

    Replaces the content of the given node with the given children.

    +

    This function first removes any children of the given DOM +Node and then adds the given given children following the +rules outlined below.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
    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 the last children Node appended to the node or null -if either the node argument was no valid DOM node or if the -children was null or didn't result in further DOM nodes.

    -
    - - - -
    -
    - Type -
    -
    - -Node -| - -null - - -
    -
    - - - - - - - - - - - - -

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

    - - -
    -

    Creates a new DOM Node from the given html, attr and -data parameters.

    -

    This function has multiple signatures, it can be either invoked -in the form create(html[, attr[, data]]) or in the form -create(html[, data]). The used variant is determined from the -type of the second argument.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + Node + | + + null + + + Returns the last children Node appended to the node or null +if either the node argument was no valid DOM node or if the +children was null or didn't result in further DOM nodes.
    + + + +
    + + + +
    +
    +

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

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

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

    +

    This function has multiple signatures, it can be either invoked +in the form create(html[, attr[, data]]) or in the form +create(html[, data]). The used variant is determined from the +type of the second argument.

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

    Returns the newly created Node.

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

    - - -
    -

    Tests whether the given argument is a valid DOM Node.

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

    + + elem(e){boolean} +

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

    Tests whether the given argument is a valid DOM Node.

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

    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.

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

    + + 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 true if the node does not have any children or if -any children node either has a hidden CSS class or a false -result when testing it using the given ignoreFn.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - - - - - - - - -

    matches(node, selectoropt) → {boolean}

    - - -
    -

    Tests whether a given Node matches the given query selector.

    -

    This function is a convenience wrapper around the standard -Node.matches("selector") function with the added benefit that -the node argument may be a non-Node value, in which case -this function simply returns false.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + boolean + + + Returns true if the node does not have any children or if +any children node either has a hidden CSS class or a false +result when testing it using the given ignoreFn.
    + + + +
    + + + +
    +
    +

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

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

    Tests whether a given Node matches the given query selector.

    +

    This function is a convenience wrapper around the standard +Node.matches("selector") function with the added benefit that +the node argument may be a non-Node value, in which case +this function simply returns false.

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

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

    Returns true if the given node matches the specified selector -or false when the node argument is no valid DOM Node or the -selector didn't match.

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

    + + parent(node, selector){Node|null} +

    + + +
    + luci.js, line 2167 +
    + +
    - +
    +
    -

    parent(node, selectoropt) → {Node|null}

    - - - - - -
    -

    Returns the closest parent node that matches the given query +

    +

    Returns the closest parent node that matches the given query selector expression.

    This function is a convenience wrapper around the standard Node.closest("selector") function with the added benefit that the node argument may be a non-Node value, in which case this function simply returns null.

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

    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 the first DOM Node extracted from the HTML fragment or -null on parsing failures or if no element could be found.

    -
    - - - -
    -
    - Type -
    -
    - -Node - - -
    -
    - - - - - - - - - - -

    Type Definitions

    - - - - - - - -

    ignoreCallbackFn(node) → {boolean}

    - - -
    -

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

    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.

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

    The child node to test.

    + +

    The child node to test.

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + boolean + + + Boolean indicating whether to ignore the node or not.
    - - - - - -
    - - - +
    +
    - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Boolean indicating whether to ignore the node or not.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - - - - - + + + + +
    + Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 abae649cbe..cfc0dc9cef 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.fs

    - -

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

    +

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

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

    + + new LuCI.fs() +

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

    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.

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

    + + 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,158 +1458,144 @@ 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
    + + Promise.<Array.<string>> + + + 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.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + +
    NameTypeDescription
    path @@ -604,159 +1604,145 @@ of the given file or [] on failure.

    The directory path to list.

    + +

    The directory path to list.

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

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

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

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

    - - - - - -
    -

    Read the contents of the given file and return them. +

    +

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

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

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

    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.

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

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

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<LuCI.fs.FileStatEntry> - - -
    -
    - - - - - - +
    +
    +
    +

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

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

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

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

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

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

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

    - - - - - -
    -

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

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<number> + + + Returns a promise resolving to 0 or rejecting with an error stating +the failure reason.
    - - - - - -
    - - - +
    +
    - - - - - - - - - - - - - - - - - -
    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:
    - +
    +
    +

    LuCI.fs.FileExecResultObject

    +
    + +
    +
    + + + +
    + + +
    Properties:
    + +
    - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - + - - + + - - - + + + - + - + - - + + - - - + + + - + - + - - + + - + + + +
    NameTypeAttributesDescription
    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 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 44f899b352..68e2042c51 100644 --- a/documentation/jsapi/LuCI.html +++ b/documentation/jsapi/LuCI.html @@ -1,94 +1,1141 @@ - + - JSDoc: Class: LuCI - - - + Class: LuCI + + + + + - - - - - -
    - -

    Class: LuCI

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

    Class: LuCI

    +
    - +
    +

    + LuCI +

    -

    LuCI(env)

    - -

    This is the LuCI base class. It is automatically instantiated and +

    This is the LuCI base class. It is automatically instantiated and accessible using the global L variable.

    - -
    +
    + + +
    +
    +

    + + new LuCI(env) +

    + + +
    + luci.js, line 1 +
    + +
    -

    Constructor

    +
    +
    + -

    new LuCI(env)

    - - - - - - - - - - - - -
    Parameters:
    + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    env @@ -97,92 +1144,70 @@ accessible using the global L variable.

    The environment settings to use for the LuCI runtime.

    + +

    The environment settings to use for the LuCI runtime.

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

    Classes

    - +
    Class
    @@ -221,141 +1246,121 @@ accessible using the global L variable.

    - - - -

    Members

    - +
    -

    env

    - - - - -
    -

    The env object holds environment settings used by LuCI, such +

    +
    +

    env

    +
    + + +
    +
    + +
    +

    The env object holds environment settings used by LuCI, such as request timeouts, base URLs etc.

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

    Methods

    - +
    +
    +
    +

    + + bind(fn, self, args){function} +

    + + +
    + luci.js, line 1340 +
    + +
    - +
    +
    -

    bind(fn, self, …argsopt) → {function}

    - - - - - -
    -

    Return a bound function using the given self as this context +

    +

    Return a bound function using the given self as this context and any further arguments as parameters to the bound function.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    fn @@ -364,29 +1369,26 @@ and any further arguments as parameters to the bound function.

    - - - - - -

    The function to bind.

    + + + + + + +

    The function to bind.

    self @@ -395,29 +1397,26 @@ and any further arguments as parameters to the bound function.

    - - - - - -

    The value to bind as this context to the specified function.

    + + + + + + +

    The value to bind as this context to the specified function.

    args @@ -426,176 +1425,157 @@ and any further arguments as parameters to the bound function.

    - - <optional>
    - - - - - - <repeatable>
    - -

    Zero or more variable arguments which are bound to the function +

    + + + optional + + + + + repeatable + + +

    Zero or more variable arguments which are bound to the function as parameters.

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

    Returns the bound function.

    -
    - - - -
    -
    - Type -
    -
    - -function - - -
    -
    - - - - - - - - - - - - -

    error(typeopt, fmtopt, …argsopt)

    - - -
    -

    A wrapper around raise() which also renders -the error either as modal overlay when ui.js is already loaed -or directly into the view body.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDefaultDescription
    + + function + + + Returns the bound function.
    + + + +
    + + + +
    +
    +

    + + error(type, fmt, args) +

    + + +
    + luci.js, line 1300 +
    + +
    + + +
    +
    + + +
    +

    A wrapper around raise() which also renders +the error either as modal overlay when ui.js is already loaed +or directly into the view body.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + - + - - - - - - - - - + + + - + - - - - - - + + - - - + + +
    NameTypeDefaultDescription
    type @@ -607,19 +1587,7 @@ or directly into the view body.

    - - <optional>
    - - - - - -
    @@ -627,18 +1595,27 @@ or directly into the view body.

    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 @@ -647,19 +1624,7 @@ existing Error instance to copy.

    - - <optional>
    - - - - - -
    @@ -667,18 +1632,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 @@ -687,94 +1661,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:
    + +
    @@ -784,7 +1732,6 @@ appended to the message and the type set to the given type argument or copied from the given error instance.

    -
    @@ -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
    + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<null> + + + Returns a promise resolving to null when concluded.
    - - - - - -
    - - - - - - - - - - - - - -
    Deprecated:
    • Yes
    - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving to null when concluded.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<null> - - -
    -
    - - - - - - +
    +
    +
    +

    + + halt(){boolean} +

    + + +
    + luci.js, line 2040 +
    + +
    +
    +
    + + +
    +

    Deprecated wrapper around Poll.stop().

    +
    + -

    halt() → {boolean}

    - - - - -
    -

    Deprecated wrapper around Poll.stop().

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

    Returns true when the polling loop has been stopped or false -when it didn't run to begin with.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    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:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + boolean + | + + null + + + Return true if the queried feature (and sub-feature) is available +or false if the requested feature isn't present or known. +Return null when a sub-feature was queried for a feature which +has no sub-features.
    + + + +
    + + + +
    +
    +

    + + isObject(val){boolean} +

    + + +
    + luci.js, line 1765 +
    + +
    + + +
    +
    + + +
    +

    Tests whether the passed argument is a JavaScript object. +This function is meant to be an object counterpart to the +standard Array.isArray() function.

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

    location() → {string}

    - - - - - - -
    -

    Return the complete URL path to the current view.

    -
    - - - - - - - - - - - - - -
    - - + + + + +
    Returns:
    - - - - - - - - - - - - - - - - - -
    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:
    - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + boolean + + + Returns true if the given value is of type object and +not null, else returns false.
    + + + +
    + + + +
    +
    +

    + + location(){string} +

    + + +
    + luci.js, line 1745 +
    + +
    + + +
    +
    + + +
    +

    Return the complete URL path to the current view.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the URL path to the current view.
    + + + + +
    + + + +
    +
    +

    + + path(prefix, parts){string} +

    + + +
    + luci.js, line 1679 +
    + +
    + + +
    +
    + + +
    +

    Construct a relative URL path from the given prefix and parts. +The resulting URL is guaranteed to only contain the characters +a-z, A-Z, 0-9, _, ., %, ,, ;, and - as well +as / for the path separator.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + - + - - - - - - - - + + +
    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:
    + + - - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDefaultDescription
    + + string + + + Return the joined URL path.
    + + + +
    + + + +
    +
    +

    + + poll(interval, url, args, cb, post){function} +

    + + +
    + luci.js, line 1988 +
    + +
    + + +
    +
    + + +
    +

    Register a polling HTTP request that invokes the specified +callback function. The function is a wrapper around +Request.poll.add().

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + - + - - - - - - + + - - - + + + - + - - - - - - - - - + + + - + - - - - - - + + - - - + + + - + - - - - - - - - - + + +
    NameTypeDefaultDescription
    interval @@ -1935,35 +2773,32 @@ callback function. The function is a wrapper around - - - - - -

    The poll interval to use. If set to a value less than or equal + +

    + + + + + + +

    The poll interval to use. If set to a value less than or equal to 0, it will default to the global poll interval configured in LuCI.env.pollinterval.

    url @@ -1972,33 +2807,30 @@ in LuCI.env.pollinterval.

    - - - - - -

    The URL to request.

    + + + + + + +

    The URL to request.

    args @@ -2007,37 +2839,34 @@ in LuCI.env.pollinterval.

    - - <optional>
    - - - - - -

    Specifies additional arguments for the request. For GET requests, + +

    + + + optional + + + + + +

    Specifies additional arguments for the request. For GET requests, the arguments are appended to the URL as query string, for POST requests, they'll be added to the request body.

    cb @@ -2046,33 +2875,30 @@ requests, they'll be added to the request body.

    - - - - - -

    The callback function to invoke whenever a request finishes.

    + + + + + + +

    The callback function to invoke whenever a request finishes.

    post @@ -2081,19 +2907,7 @@ requests, they'll be added to the request body.

    - - <optional>
    - - - - - -
    @@ -2101,169 +2915,162 @@ requests, they'll be added to the request body.

    When set to false or not specified, poll requests will be made + +

    + + + optional + + + + + +

    When set to false or not specified, poll requests will be made using the GET method. When set to true, POST requests will be issued. In case of POST requests, the request body will contain an argument token with the current value of LuCI.env.token by default, regardless of the parameters specified with args.

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

    Returns the internally created function that has been passed to -Request.poll.add(). This value can -be passed to Poll.remove() to remove the -polling request.

    -
    - - - -
    -
    - Type -
    -
    - -function - - -
    -
    - - - - - - - - - - - - -

    post(url, argsopt, cb) → {Promise.<null>}

    - - -
    -

    Issues a POST request to the given url and invokes the specified -callback function. The function is a wrapper around -Request.request(). The request is -sent using application/x-www-form-urlencoded encoding and will -contain a field token with the current value of LuCI.env.token -by default.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + function + + + Returns the internally created function that has been passed to +Request.poll.add(). This value can +be passed to Poll.remove() to remove the +polling request.
    + + + +
    + + + +
    +
    +

    + + post(url, args, cb){Promise.<null>} +

    + + +
    + luci.js, line 1946 +
    + +
    + + +
    +
    + + +
    +

    Issues a POST request to the given url and invokes the specified +callback function. The function is a wrapper around +Request.request(). The request is +sent using application/x-www-form-urlencoded encoding and will +contain a field token with the current value of LuCI.env.token +by default.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + +
    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:
    + + - - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDefaultDescription
    + + Promise.<null> + + + Returns a promise resolving to null when concluded.
    + + + +
    + + + +
    +
    +

    + + raise(type, fmt, args) +

    + + +
    + luci.js, line 1234 +
    + +
    + + +
    +
    + + +
    +

    Captures the current stack trace and throws an error of the +specified type as a new exception. Also logs the exception as +error to the debug console if it is available.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + - + - - - - - - - - - + + + - + - - - - - - + + - - - + + +
    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,284 +3683,276 @@ class instance.

    -
    - - - -
    Returns:
    - - -
    -

    Returns the instantiated class.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<LuCI#Class> - - -
    -
    - + + + +
    Returns:
    - - - - - - - - - -

    resolveDefault(value, defvalue) → {Promise.<*>}

    - - - - - - -
    -

    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
    value - -* - - - + Promise.<LuCI#Class> + +

    The value to resolve the promise with.

    Returns the instantiated class.
    defvalue - - -* - - - -

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

    + + resolveDefault(value, defvalue){Promise.<*>} +

    + + +
    + luci.js, line 1873 +
    + +
    +
    +
    + + +
    +

    Returns a promise resolving with either the given value or or with +the given default in case the input value is a rejecting promise.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    value + + +* + + + + + +

    The value to resolve the promise with.

    defvalue + + +* + + + + + +

    The default value to resolve the promise with in case the given +input value is a rejecting promise.

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

    resource(partsopt) → {string}

    - - -
    -

    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:
    + + + + +
    Returns:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + Promise.<*> + + + Returns a new promise resolving either to the given input value or +to the given default value on error.
    + + + +
    + + + +
    +
    +

    + + resource(parts){string} +

    + + +
    + luci.js, line 1732 +
    + +
    + + +
    +
    + + +
    +

    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.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + +
    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 the resulting URL path.

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

    run() → {boolean}

    - - - - - - -
    -

    Deprecated wrapper around Poll.start().

    -
    - - - - - - - - - - - - - -
    - - + + + + +
    Returns:
    - - - - - - - -
    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:
    - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + string + + + Returns the resulting URL path.
    + + + +
    + + + +
    +
    +

    + + run(){boolean} +

    + + +
    + luci.js, line 2053 +
    + +
    + + +
    +
    + + +
    +

    Deprecated wrapper around Poll.start().

    +
    + + + + + + + + + +
    + + + + + + + +
    Deprecated
    • Yes
    + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + boolean + + + Returns true when the polling loop has been started or false +when it was already running.
    + + + + +
    + + + +
    +
    +

    + + sortedKeys(obj, key, sortmode){Array.<string>} +

    + + +
    + luci.js, line 1794 +
    + +
    + + +
    +
    + + +
    +

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

    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 true when the function has been removed or false if -it could not be found.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - - - - - - - - -

    toArray(val) → {Array.<*>}

    - - -
    -

    Converts the given value to an array. If the given value is of -type array, it is returned as-is, values of type object are -returned as one-element array containing the object, empty -strings and null values are returned as empty array, all other -values are converted using String(), trimmed, split on white -space and returned as array.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - + + + + + + + +
    NameTypeDescription
    + + boolean + + + Returns true when the function has been removed or false if +it could not be found.
    + + + +
    + + + +
    +
    +

    + + toArray(val){Array.<*>} +

    + + +
    + luci.js, line 1839 +
    + +
    + + +
    +
    + + +
    +

    Converts the given value to an array. If the given value is of +type array, it is returned as-is, values of type object are +returned as one-element array containing the object, empty +strings and null values are returned as empty array, all other +values are converted using String(), trimmed, split on white +space and returned as array.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + +
    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:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + Array.<*> + + + Returns the resulting array.
    + + + +
    + + + +
    +
    +

    + + url(parts){string} +

    + + +
    + luci.js, line 1710 +
    + +
    + + +
    +
    + + +
    +

    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 the resulting URL path.

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

    Type Definitions

    - - - - - - - -

    requestCallbackFn(xhr, data, duration)

    - - -
    -

    The request callback function is invoked whenever an HTTP -reply to a request made using the L.get(), L.post() or -L.poll() function is timed out or received successfully.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - + + + + + + + +
    NameTypeDescription
    + + string + + + Returns the resulting URL path.
    + + + +
    + + + + + +

    Type Definitions

    + +
    + +
    +
    +

    + + LuCI.requestCallbackFn(xhr, data, duration) +

    + + +
    + luci.js, line 1877 +
    + +
    + + +
    +
    + + +
    +

    The request callback function is invoked whenever an HTTP +reply to a request made using the L.get(), L.post() or +L.poll() function is timed out or received successfully.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + + - + - - - - + + - - - + + +
    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:
    -
    - - - -
    + + + + + + + + + + +
    - - - - - - - - - - - - - - - - - +
    + + - + + + + + +
    - - - -
    - - - - - + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.rpc.html b/documentation/jsapi/LuCI.rpc.html index 9d548f3ad3..557b972376 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.

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

    + + new LuCI.rpc() +

    + +
    + rpc.js, line 8 +
    +
    +
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    - +
    + + + + + + + + + + + - -

    Methods

    - +
    +
    +
    +

    + + addInterceptor(interceptorFn){LuCI.rpc~interceptorFn} +

    + + +
    + rpc.js, line 454 +
    + +
    +
    +
    + + +
    +

    Registers a new interceptor function.

    +
    + -

    addInterceptor(interceptorFn) → {LuCI.rpc~interceptorFn}

    - - - - -
    -

    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 a new function implementing the method call described in -options.

    -
    - - - -
    -
    - Type -
    -
    - -LuCI.rpc~invokeFn - - -
    -
    - - - - - - - - - - - - -

    getBaseURL() → {string}

    - - - - - - -
    -

    Returns the current RPC base URL.

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

    Returns the RPC URL endpoint to issue requests against.

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

    getSessionID() → {string}

    - - - - - - -
    -

    Returns the current RPC session id.

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

    Returns the 32 byte session ID string used for authenticating remote -requests.

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

    getStatusText(statusCode) → {string}

    - - - - - - -
    -

    Translates a numeric ubus error code into a human readable -description.

    -
    - - - - - - - - - -
    Parameters:
    - - - - - - - - - - + + + + + + + +
    NameTypeDescription
    + + LuCI.rpc~invokeFn + + + Returns a new function implementing the method call described in +options.
    + + + +
    + + + +
    +
    +

    + + getBaseURL(){string} +

    + + +
    + rpc.js, line 367 +
    + +
    + + +
    +
    + + +
    +

    Returns the current RPC base URL.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the RPC URL endpoint to issue requests against.
    + + + + +
    + + + +
    +
    +

    + + getSessionID(){string} +

    + + +
    + rpc.js, line 346 +
    + +
    + + +
    +
    + + +
    +

    Returns the current RPC session id.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the 32 byte session ID string used for authenticating remote +requests.
    + + + + +
    + + + +
    +
    +

    + + getStatusText(statusCode){string} +

    + + +
    + rpc.js, line 391 +
    + +
    + + +
    +
    + + +
    +

    Translates a numeric ubus error code into a human readable +description.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + +
    NameTypeDescription
    statusCode @@ -739,119 +1730,110 @@ description.

    The numeric status code.

    + +

    The numeric status code.

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the textual description of the code.
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns the textual description of the code.

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

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

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

    removeInterceptor(interceptorFn) → {boolean}

    - - -
    -

    Removes a registered interceptor function.

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

    + + removeInterceptor(interceptorFn){boolean} +

    + + +
    + rpc.js, line 470 +
    + +
    + + +
    +
    + + +
    +

    Removes a registered interceptor function.

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

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

    + + +
    + rpc.js, line 357 +
    + +
    +
    +
    + + +
    +

    Set the RPC session id to use.

    +
    + -

    setSessionID(sid)

    - - - - -
    -

    Set the RPC session id to use.

    -
    - - - - - - - - - -
    Parameters:
    + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
    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 @@ -1677,14 +2569,14 @@ a key success with a boolean value. If the reply does not contain be returned as default instead.

    filter @@ -1693,131 +2585,111 @@ be returned as default instead. <optional>
    - +

    Specfies an optional filter function which is invoked to transform the received reply data before it is returned to the caller.

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

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + * + + + The return value of the filter function will be returned to the caller +of the RPC method as-is.
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    The return value of the filter function will be returned to the caller -of the RPC method as-is.

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

    + + interceptorFn(msg, req){Promise.<*>|*} +

    + + +
    + rpc.js, line 408 +
    + +
    - +
    +
    -

    interceptorFn(msg, req) → {Promise.<*>|*}

    - - - - - -
    -

    Registered interceptor functions are invoked before the standard reply +

    +

    Registered interceptor functions are invoked before the standard reply parsing and handling logic.

    By returning rejected promises, interceptor functions can cause the invocation function to fail, regardless of the received reply.

    @@ -2023,44 +2877,39 @@ rewrite received replies before they're processed by the standard response handling code.

    A common use case for such functions is to detect failing RPC replies due to expired authentication in order to trigger a new login.

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

    Interceptor functions may return a promise to defer response -processing until some delayed work completed. Any values the returned -promise resolves to are ignored.

    -

    When the returned promise rejects with an error, the invocation -function will fail too, forwarding the error to the caller.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<*> -| - -* - - -
    -
    - - - - - - - - - - - - -

    invokeFn(…params) → {Promise.<*>}

    - - -
    -

    The generated invocation function is returned by -rpc.declare() and encapsulates a single -RPC method call.

    -

    Calling this function will execute a remote ubus HTTP call request -using the arguments passed to it as arguments and return a promise -resolving to the received reply values.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + Promise.<*> + | + + * + + + Interceptor functions may return a promise to defer response +processing until some delayed work completed. Any values the returned +promise resolves to are ignored. +When the returned promise rejects with an error, the invocation +function will fail too, forwarding the error to the caller.
    + + + +
    + + + +
    +
    +

    + + invokeFn(params){Promise.<*>} +

    + + +
    + rpc.js, line 254 +
    + +
    + + +
    +
    + + +
    +

    The generated invocation function is returned by +rpc.declare() and encapsulates a single +RPC method call.

    +

    Calling this function will execute a remote ubus HTTP call request +using the arguments passed to it as arguments and return a promise +resolving to the received reply values.

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

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

    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.<*> - - -
    -
    - - - - - - - -
    -
    + + + + +
    + 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 8a0e3e98f9..32e34eacb1 100644 --- a/documentation/jsapi/LuCI.uci.html +++ b/documentation/jsapi/LuCI.uci.html @@ -1,198 +1,1235 @@ - + - JSDoc: Class: uci - - - + Class: uci + + + + + - - - - - -
    - -

    Class: uci

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

    Class: uci

    +
    - -
    -

    - LuCI.uci

    - -

    The LuCI.uci class utilizes LuCI.rpc to declare low level +

    +

    + LuCI. + + uci +

    + +

    The LuCI.uci class utilizes LuCI.rpc to declare low level remote UCI ubus procedures and implements a local caching and data manipulation layer on top to allow for synchroneous operations on UCI configuration data.

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

    + + new LuCI.uci() +

    + +
    + uci.js, line 4 +
    +
    +
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    - +
    + + + + + + + + + + + - -

    Methods

    - +
    +
    +
    +

    + + add(config, type, name){string} +

    + + +
    + uci.js, line 269 +
    + +
    - +
    +
    -

    add(config, type, nameopt) → {string}

    - - - - - -
    -

    Adds a new section of the given type to the given configuration, +

    +

    Adds a new section of the given type to the given configuration, optionally named according to the given name.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    config @@ -201,29 +1238,26 @@ optionally named according to the given name.

    - - - - - -

    The name of the configuration to add the section to.

    + + + + + + +

    The name of the configuration to add the section to.

    type @@ -232,29 +1266,26 @@ optionally named according to the given name.

    - - - - - -

    The type of the section to add.

    + + + + + + +

    The type of the section to add.

    name @@ -263,175 +1294,156 @@ optionally named according to the given name.

    - - <optional>
    - - - - - -

    The name of the section to add. If the name is omitted, an anonymous +

    + + + optional + + + + + +

    The name of the section to add. If the name is omitted, an anonymous section will be added instead.

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

    Returns the section ID of the newly added section which is equivalent -to the given name for non-anonymous sections.

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

    apply(timeoutopt) → {Promise.<number>}

    - - -
    -

    Instructs the remote ubus UCI api to commit all saved changes with -rollback protection and attempts to confirm the pending commit -operation to cancel the rollback timer.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDefaultDescription
    + + string + + + Returns the section ID of the newly added section which is equivalent +to the given name for non-anonymous sections.
    + + + +
    + + + +
    +
    +

    + + apply(timeout){Promise.<number>} +

    + + +
    + uci.js, line 858 +
    + +
    + + +
    +
    + + +
    +

    Instructs the remote ubus UCI api to commit all saved changes with +rollback protection and attempts to confirm the pending commit +operation to cancel the rollback timer.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + + + + +
    NameTypeDefaultDescription
    timeout @@ -440,19 +1452,7 @@ operation to cancel the rollback timer.

    - - <optional>
    - - - - - -
    @@ -460,267 +1460,252 @@ operation to cancel the rollback timer.

    Override the confirmation timeout after which a rollback is triggered.

    + + + optional + + + + + +

    Override the confirmation timeout after which a rollback is triggered.

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<number> + + + Returns a promise resolving/rejecting with the ubus RPC status code.
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns a promise resolving/rejecting with the ubus RPC status code.

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

    + + changes(){Promise.<Object.<string, Array.<LuCI.uci.ChangeRecord>>>} +

    + + +
    + uci.js, line 938 +
    + +
    +
    +
    + + +
    +

    Fetches uncommitted UCI changes from the remote ubus RPC api.

    +
    + -

    changes() → {Promise.<Object.<string, Array.<LuCI.uci.ChangeRecord>>>}

    - - - - -
    -

    Fetches uncommitted UCI changes from the remote ubus RPC api.

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

    Returns a promise resolving to an object containing the configuration -names as keys and arrays of related change records as values.

    -
    - - - -
    -
    - Type -
    -
    - -Promise.<Object.<string, Array.<LuCI.uci.ChangeRecord>>> - - -
    -
    + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<Object.<string, Array.<LuCI.uci.ChangeRecord>>> + + + Returns a promise resolving to an object containing the configuration +names as keys and arrays of related change records as values.
    + + + +
    +
    +
    +

    + + createSID(config){string} +

    + + +
    + uci.js, line 88 +
    + +
    - +
    +
    -

    createSID(config) → {string}

    - - - - - -
    -

    Generates a new, unique section ID for the given configuration.

    +
    +

    Generates a new, unique section ID for the given configuration.

    Note that the generated ID is temporary, it will get replaced by an identifier in the form cfgXXXXXX once the configuration is saved by the remote ubus UCI api.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + + + + +
    NameTypeDescription
    NameTypeDescription
    config @@ -729,162 +1714,146 @@ by the remote ubus UCI api.

    The configuration to generate the new section ID for.

    + +

    The configuration to generate the new section ID for.

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + string + + + A newly generated, unique section ID in the form newXXXXXX +where X denotes a hexadecimal digit.
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    A newly generated, unique section ID in the form newXXXXXX -where X denotes a hexadecimal digit.

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

    + + get(config, sid, option){null|string|Array.<string>|LuCI.uci.SectionObject} +

    + + +
    + uci.js, line 443 +
    + +
    - +
    +
    -

    get(config, sid, optionopt) → {null|string|Array.<string>|LuCI.uci.SectionObject}

    - - - - - -
    -

    Gets the value of the given option within the specified section +

    +

    Gets the value of the given option within the specified section of the given configuration or the entire section object if the option name is omitted.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    config @@ -893,29 +1862,26 @@ option name is omitted.

    - - - - - -

    The name of the configuration to read the value from.

    + + + + + + +

    The name of the configuration to read the value from.

    sid @@ -924,29 +1890,26 @@ option name is omitted.

    - - - - - -

    The name or ID of the section to read.

    + + + + + + +

    The name or ID of the section to read.

    option @@ -955,351 +1918,94 @@ option name is omitted.

    - - <optional>
    - - - - - -

    The option name to read the value from. If the option name is +

    + + + optional + + + + + +

    The option name to read the value from. If the option name is omitted or null, the entire section is returned instead.

    - - - - - - + + +
    - + + + + - - - - - - - - - - - -
    Source:
    -
    - - - -
    - - - - - - - - - - - - - - -
    Returns:
    - - -
    -
      -
    • Returns a string containing the option value in case of a -plain UCI option.
    • -
    • Returns an array of strings containing the option values in -case of option pointing to an UCI list.
    • -
    • Returns a section object if -the option argument has been omitted or is null.
    • -
    • Returns null if the config, section or option has not been -found or if the corresponding configuration is not loaded.
    • -
    -
    - - - -
    -
    - Type -
    -
    - -null -| - -string -| - -Array.<string> -| - -LuCI.uci.SectionObject - - -
    -
    - - - - - - - - - - - - -

    get_first(config, typeopt, optionopt) → {null|string|Array.<string>|LuCI.uci.SectionObject}

    - - -
    -

    Gets the value of the given option or the entire section object of -the first found section of the specified type or the first found -section of the entire configuration if no type is specfied.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeAttributesDescription
    config - -string - - - + null + | + + string + | + + Array.<string> + | + + LuCI.uci.SectionObject + + - - - - - -

    The name of the configuration to read the value from.

    type - - -string - - - - - - <optional>
    - - - - - -

    The type of the first section to find. If it is null, the first -section of the entire config is read, otherwise the first section -matching the given type.

    option - - -string - - - - - - <optional>
    - - - - - -

    The option name to read the value from. If the option name is -omitted or null, the entire section is returned instead.

    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -
      +
      • Returns a string containing the option value in case of a plain UCI option.
      • Returns an array of strings containing the option values in @@ -1308,96 +2014,311 @@ case of option pointing to an UCI list.
      • the option argument has been omitted or is null.
      • Returns null if the config, section or option has not been found or if the corresponding configuration is not loaded.
      • -
      -
    - - - -
    -
    - Type -
    -
    - -null -| - -string -| - -Array.<string> -| - -LuCI.uci.SectionObject - - -
    -
    + + + + + - - - - + + +
    +
    +
    +

    + + get_first(config, type, option){null|string|Array.<string>|LuCI.uci.SectionObject} +

    + + +
    + uci.js, line 618 +
    + +
    +
    +
    + + +
    +

    Gets the value of the given option or the entire section object of +the first found section of the specified type or the first found +section of the entire configuration if no type is specfied.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    config + + +string + + + + + + + + + + +

    The name of the configuration to read the value from.

    type + + +string + + + + + + + optional + + + + + +

    The type of the first section to find. If it is null, the first +section of the entire config is read, otherwise the first section +matching the given type.

    option + + +string + + + + + + + optional + + + + + +

    The option name to read the value from. If the option name is +omitted or null, the entire section is returned instead.

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

    load(config) → {Promise.<Array.<string>>}

    + + + + + +
    Returns:
    + -
    -

    Loads the given UCI configurations from the remote ubus api.

    + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + null + | + + string + | + + Array.<string> + | + + LuCI.uci.SectionObject + + +
      +
    • Returns a string containing the option value in case of a +plain UCI option.
    • +
    • Returns an array of strings containing the option values in +case of option pointing to an UCI list.
    • +
    • Returns a section object if +the option argument has been omitted or is null.
    • +
    • Returns null if the config, section or option has not been +found or if the corresponding configuration is not loaded.
    • +
    + + + + +
    + + + +
    +
    +

    + + load(config){Promise.<Array.<string>>} +

    + + +
    + uci.js, line 205 +
    + +
    + + +
    +
    + + +
    +

    Loads the given UCI configurations from the remote ubus api.

    Loaded configurations are cached and only loaded once. Subsequent load operations of the same configurations will return the cached data.

    To force reloading a configuration, it has to be unloaded with uci.unload() first.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
    NameTypeDescription
    NameTypeDescription
    config @@ -1409,164 +2330,148 @@ data.

    The name of the configuration or an array of configuration + +

    + +

    The name of the configuration or an array of configuration names to load.

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

    Returns a promise resolving to the names of the configurations -that have been successfully loaded.

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

    move(config, sid1, sid2opt, afteropt) → {boolean}

    - - -
    -

    Move the first specified section within the given configuration -before or after the second specified section.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDefaultDescription
    + + Promise.<Array.<string>> + + + Returns a promise resolving to the names of the configurations +that have been successfully loaded.
    + + + + + + + +
    +
    +

    + + move(config, sid1, sid2, after){boolean} +

    + + +
    + uci.js, line 718 +
    + +
    + + +
    +
    + + +
    +

    Move the first specified section within the given configuration +before or after the second specified section.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + - - - + + + - + - - - - - - + + - - - + + + - + - - - - - - - - - + + + - + - - - - - - - - - + + +
    NameTypeDefaultDescription
    config @@ -1575,33 +2480,30 @@ before or after the second specified section.

    - - - - - -

    The configuration to move the section within.

    + + + + + + +

    The configuration to move the section within.

    sid1 @@ -1610,33 +2512,30 @@ before or after the second specified section.

    - - - - - -

    The ID of the section to move within the configuration.

    + + + + + + +

    The ID of the section to move within the configuration.

    sid2 @@ -1645,26 +2544,23 @@ before or after the second specified section.

    - - <optional>
    - - - - - -

    The ID of the target section for the move operation. If the + +

    + + + optional + + + + + +

    The ID of the target section for the move operation. If the after argument is false or not specified, the section named by sid1 will be moved before this target section, if the after argument is true, the sid1 section will be moved after this @@ -1672,14 +2568,14 @@ section.

    When the sid2 argument is null, the section specified by sid1 is moved to the end of the configuration.

    after @@ -1688,19 +2584,7 @@ is moved to the end of the configuration.

    - - <optional>
    - - - - - -
    @@ -1708,318 +2592,292 @@ is moved to the end of the configuration.

    When true, the section sid1 is moved after the section sid2, + +

    + + + optional + + + + + +

    When true, the section sid1 is moved after the section sid2, when false, the section sid1 is moved before sid2.

    If sid2 is null, then this parameter has no effect and the section sid1 is moved to the end of the configuration instead.

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

    Returns true when the section was successfully moved, or false -when either the section specified by sid1 or by sid2 is not found.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - - - - - - - - -

    remove(config, sid)

    - - -
    -

    Removes the section with the given ID from the given configuration.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - -
    NameTypeDescription
    config - -string - - - + boolean + +

    The name of the configuration to remove the section from.

    Returns true when the section was successfully moved, or false +when either the section specified by sid1 or by sid2 is not found.
    sid - - -string - - - -

    The ID of the section to remove.

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

    + + remove(config, sid) +

    + + +
    + uci.js, line 296 +
    + +
    +
    +
    + + +
    +

    Removes the section with the given ID from the given configuration.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    config + + +string + + + + + +

    The name of the configuration to remove the section from.

    sid + + +string + + + + + +

    The ID of the section to remove.

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

    resolveSID(config, sid) → {string|null}

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

    + + resolveSID(config, sid){string|null} +

    + + +
    + uci.js, line 119 +
    + +
    -
    -

    Resolves a given section ID in extended notation to the internal + +

    +
    + + +
    +

    Resolves a given section ID in extended notation to the internal section ID value.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - - - - + + +
    NameTypeDescription
    NameTypeDescription
    config @@ -2028,21 +2886,21 @@ section ID value.

    The configuration to resolve the section ID for.

    + +

    The configuration to resolve the section ID for.

    sid @@ -2051,283 +2909,257 @@ section ID value.

    The section ID to resolve. If the ID is in the form @typename[#], + +

    + +

    The section ID to resolve. If the ID is in the form @typename[#], it will get resolved to an internal anonymous ID in the forms cfgXXXXXX/newXXXXXX or to the name of a section in case it points to a named section. When the given ID is not in extended notation, it will be returned as-is.

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

    Returns the resolved section ID or the original given ID if it was -not in extended notation. Returns null when an extended ID could -not be resolved to existing section ID.

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

    save() → {Array.<string>}

    - - - - - - -
    -

    Submits all local configuration changes to the remove ubus api, -adds, removes and reorders remote sections as needed and reloads -all loaded configurations to resynchronize the local state with -the remote configuration values.

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

    Returns a promise resolving to an array of configuration names which -have been reloaded by the save operation.

    -
    - - - -
    -
    - Type -
    -
    - -Array.<string> - - -
    -
    - - - - - - - - - - - - - -

    sections(config, typeopt, cbopt) → {Array.<LuCI.uci.SectionObject>}

    - - - - - - -
    -

    Enumerates the sections of the given configuration, optionally -filtered by type.

    -
    - - - - - - - - - -
    Parameters:
    - - - - - - - - - - - - + + + + + + + +
    NameTypeAttributesDescription
    + + string + | + + null + + + Returns the resolved section ID or the original given ID if it was +not in extended notation. Returns null when an extended ID could +not be resolved to existing section ID.
    + + + + + + + +
    +
    +

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

    + + +
    + uci.js, line 772 +
    + +
    + + +
    +
    + + +
    +

    Submits all local configuration changes to the remove ubus api, +adds, removes and reorders remote sections as needed and reloads +all loaded configurations to resynchronize the local state with +the remote configuration values.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Array.<string> + + + Returns a promise resolving to an array of configuration names which +have been reloaded by the save operation.
    + + + + +
    + + + +
    +
    +

    + + sections(config, type, cb){Array.<LuCI.uci.SectionObject>} +

    + + +
    + uci.js, line 384 +
    + +
    + + +
    +
    + + +
    +

    Enumerates the sections of the given configuration, optionally +filtered by type.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + + - + - - - - - + - - - + + +
    NameTypeDescription
    config @@ -2336,29 +3168,26 @@ filtered by type.

    - - - - - -

    The name of the configuration to enumerate the sections for.

    + + + + + + +

    The name of the configuration to enumerate the sections for.

    type @@ -2367,32 +3196,29 @@ filtered by type.

    - - <optional>
    - - - - - -

    Enumerate only sections of the given type. If omitted, enumerate +

    + + + optional + + + + + +

    Enumerate only sections of the given type. If omitted, enumerate all sections.

    cb @@ -2401,171 +3227,154 @@ all sections.

    - - <optional>
    - - - - - -

    An optional callback to invoke for each enumerated section.

    + + + optional + + + + + +

    An optional callback to invoke for each enumerated section.

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

    Returns a sorted array of the section objects within the given -configuration, filtered by type of a type has been specified.

    -
    - - - -
    -
    - Type -
    -
    - -Array.<LuCI.uci.SectionObject> - - -
    -
    - - - - - - - - - - - - -

    set(config, sid, option, value)

    - - -
    -

    Sets the value of the given option within the specified section -of the given configuration.

    -

    If either config, section or option is null, or if option begins -with a dot, the function will do nothing.

    -
    - - - - - - - - - -
    Parameters:
    + + + + +
    Returns:
    + + - - - - - - - - - + + + + + + + +
    NameTypeDescription
    + + Array.<LuCI.uci.SectionObject> + + + Returns a sorted array of the section objects within the given +configuration, filtered by type of a type has been specified.
    + + + +
    + + + +
    +
    +

    + + set(config, sid, option, value) +

    + + +
    + uci.js, line 516 +
    + +
    + + +
    +
    + + +
    +

    Sets the value of the given option within the specified section +of the given configuration.

    +

    If either config, section or option is null, or if option begins +with a dot, the function will do nothing.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - + + - - - + + + - + - - - - + + - - - + + + - + - - - - - - - + + +
    NameTypeDescription
    config @@ -2574,21 +3383,21 @@ with a dot, the function will do nothing.

    The name of the configuration to set the option value in.

    + +

    The name of the configuration to set the option value in.

    sid @@ -2597,21 +3406,21 @@ with a dot, the function will do nothing.

    The name or ID of the section to set the option value in.

    + +

    The name or ID of the section to set the option value in.

    option @@ -2620,21 +3429,21 @@ with a dot, the function will do nothing.

    The option name to set the value for.

    + +

    The option name to set the value for.

    value @@ -2649,143 +3458,120 @@ with a dot, the function will do nothing.

    The option value to set. If the value is null or an empty string, + +

    + +

    The option value to set. If the value is null or an empty string, the option will be removed, otherwise it will be set or overwritten with the given value.

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

    + + set_first(config, type, option, value) +

    + + +
    + uci.js, line 653 +
    + +
    - +
    +
    -

    set_first(config, typeopt, option, value)

    - - - - - -
    -

    Sets the value of the given option within the first found section +

    +

    Sets the value of the given option within the first found section of the given configuration matching the specified type or within the first section of the entire config when no type has is specified.

    If either config, type or option is null, or if option begins with a dot, the function will do nothing.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + + - + - - - - - + - - - + + + - + - - - - - - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    config @@ -2794,29 +3580,26 @@ with a dot, the function will do nothing.

    - - - - - -

    The name of the configuration to set the option value in.

    + + + + + + +

    The name of the configuration to set the option value in.

    type @@ -2825,33 +3608,30 @@ with a dot, the function will do nothing.

    - - <optional>
    - - - - - -

    The type of the first section to find. If it is null, the first +

    + + + optional + + + + + +

    The type of the first section to find. If it is null, the first section of the entire config is written to, otherwise the first section matching the given type is used.

    option @@ -2860,29 +3640,26 @@ section matching the given type is used.

    - - - - - -

    The option name to set the value for.

    + + + + + + +

    The option name to set the value for.

    value @@ -2897,145 +3674,121 @@ section matching the given type is used.

    - - - - - -

    The option value to set. If the value is null or an empty string, +

    + + + + + + +

    The option value to set. If the value is null or an empty string, the option will be removed, otherwise it will be set or overwritten with the given value.

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

    + + unload(config) +

    + + +
    + uci.js, line 237 +
    + +
    +
    +
    + + +
    +

    Unloads the given UCI configurations from the local cache.

    +
    + -

    unload(config)

    - - - - -
    -

    Unloads the given UCI configurations from the local cache.

    -
    - - - - - - - - - -
    Parameters:
    + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - + + +
    NameTypeDescription
    NameTypeDescription
    config @@ -3047,139 +3800,118 @@ with the given value.

    The name of the configuration or an array of configuration + +

    + +

    The name of the configuration or an array of configuration names to unload.

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

    + + unset(config, sid, option) +

    + + +
    + uci.js, line 587 +
    + +
    - +
    +
    -

    unset(config, sid, option)

    - - - - - -
    -

    Remove the given option within the specified section of the given +

    +

    Remove the given option within the specified section of the given configuration.

    This function is a convenience wrapper around uci.set(config, section, option, null).

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + - + - - - - + + - - - + + + - + - - - - + + - - - + + +
    NameTypeDescription
    NameTypeDescription
    config @@ -3188,21 +3920,21 @@ configuration.

    The name of the configuration to remove the option from.

    + +

    The name of the configuration to remove the option from.

    sid @@ -3211,21 +3943,21 @@ configuration.

    The name or ID of the section to remove the option from.

    + +

    The name or ID of the section to remove the option from.

    option @@ -3234,141 +3966,118 @@ configuration.

    The name of the option to remove.

    + +

    The name of the option to remove.

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

    + + unset_first(config, type, option) +

    + + +
    + uci.js, line 683 +
    + +
    - +
    +
    -

    unset_first(config, typeopt, option)

    - - - - - -
    -

    Removes the given option within the first found section of the given +

    +

    Removes the given option within the first found section of the given configuration matching the specified type or within the first section of the entire config when no type has is specified.

    This function is a convenience wrapper around uci.set_first(config, type, option, null).

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - + - - - + + + - + - - - - - - - - + + + - + - - - - - + - - - + + +
    NameTypeAttributesDescription
    NameTypeDescription
    config @@ -3377,29 +4086,26 @@ of the entire config when no type has is specified.

    - - - - - -

    The name of the configuration to set the option value in.

    + + + + + + +

    The name of the configuration to set the option value in.

    type @@ -3408,33 +4114,30 @@ of the entire config when no type has is specified.

    - - <optional>
    - - - - - -

    The type of the first section to find. If it is null, the first +

    + + + optional + + + + + +

    The type of the first section to find. If it is null, the first section of the entire config is written to, otherwise the first section matching the given type is used.

    option @@ -3443,155 +4146,121 @@ section matching the given type is used.

    - - - - - -

    The option name to set the value for.

    + + + + + + +

    The option name to set the value for.

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

    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:
    -
    - - - -
    + + + + + + + + + + +
    - - - - - - - - - - - - - - - - - +
    + + - + + + + + +
    - - - -
    - - - - - + + \ No newline at end of file diff --git a/documentation/jsapi/LuCI.view.html b/documentation/jsapi/LuCI.view.html index 4a7209ceb0..59b34cfd83 100644 --- a/documentation/jsapi/LuCI.view.html +++ b/documentation/jsapi/LuCI.view.html @@ -1,155 +1,1199 @@ - + - JSDoc: Class: view - - - + Class: view + + + + + - - - - - -
    - -

    Class: view

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

    Class: view

    +
    - +
    +

    + LuCI. -

    - LuCI.view

    - -

    The view class forms the basis of views and provides a standard + view + + +

    The view class forms the basis of views and provides a standard set of methods to inherit from.

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

    + + new LuCI.view() +

    + +
    + luci.js, line 2687 +
    +
    +
    +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    - +
    + + + + + + + + + + + - -

    Methods

    - +
    +
    +
    +

    + + addFooter(){DocumentFragment} +

    + + +
    + luci.js, line 2905 +
    + +
    - +
    +
    -

    addFooter() → {DocumentFragment}

    - - - - - -
    -

    Renders a standard page action footer if any of the +

    +

    Renders a standard page action footer if any of the handleSave(), handleSaveApply() or handleReset() functions are defined.

    The default implementation should be sufficient for most @@ -160,119 +1204,109 @@ triggering the handleSave(), handleSaveApply() and

    When any of these handle*() functions is overwritten with null by a view extending this class, the corresponding button will not be rendered.

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

    Returns a DocumentFragment containing the footer bar +

    + + + + + + + + + + + + +
    TypeDescription
    + + DocumentFragment + + + Returns a DocumentFragment containing the footer bar with buttons for each corresponding handle*() action or an empty DocumentFragment if all three handle*() -methods are overwritten with null.

    - - - - -
    -
    - Type -
    -
    - -DocumentFragment - - -
    -
    +methods are overwritten with null.
    - - - - + + +
    +
    +
    +

    + + handleReset(ev){*|Promise.<*>} +

    + + +
    + luci.js, line 2871 +
    + +
    - +
    +
    -

    handleReset(ev) → {*|Promise.<*>}

    - - - - - -
    -

    The handleReset function is invoked when the user clicks +

    +

    The handleReset function is invoked when the user clicks the Reset button in the page action footer.

    The default implementation should be sufficient for most views using form.Map() based forms - it @@ -286,44 +1320,39 @@ this base class should overwrite the handleReset function with null.

    The invocation of this function is wrapped by Promise.resolve() so it may return Promises if needed.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + + + + +
    NameTypeDescription
    NameTypeDescription
    ev @@ -332,125 +1361,116 @@ with null.

    The DOM event that triggered the function.

    + +

    The DOM event that triggered the function.

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + * + | + + Promise.<*> + + + Any return values of this function are discarded, but +passed through Promise.resolve() to ensure that any +returned promise runs to completion before the button +is reenabled.
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Any return values of this function are discarded, but -passed through Promise.resolve() to ensure that any -returned promise runs to completion before the button -is reenabled.

    -
    - - - -
    -
    - Type -
    -
    - -* -| - -Promise.<*> - - -
    -
    - - - - - - +
    +
    +
    +

    + + handleSave(ev){*|Promise.<*>} +

    + + +
    + luci.js, line 2790 +
    + +
    - +
    +
    -

    handleSave(ev) → {*|Promise.<*>}

    - - - - - -
    -

    The handleSave function is invoked when the user clicks +

    +

    The handleSave function is invoked when the user clicks the Save button in the page action footer.

    The default implementation should be sufficient for most views using form.Map() based forms - it @@ -464,44 +1484,39 @@ this base class should overwrite the handleSave function with null.

    The invocation of this function is wrapped by Promise.resolve() so it may return Promises if needed.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + + + + +
    NameTypeDescription
    NameTypeDescription
    ev @@ -510,125 +1525,116 @@ with null.

    The DOM event that triggered the function.

    + +

    The DOM event that triggered the function.

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + * + | + + Promise.<*> + + + Any return values of this function are discarded, but +passed through Promise.resolve() to ensure that any +returned promise runs to completion before the button +is reenabled.
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Any return values of this function are discarded, but -passed through Promise.resolve() to ensure that any -returned promise runs to completion before the button -is reenabled.

    -
    - - - -
    -
    - Type -
    -
    - -* -| - -Promise.<*> - - -
    -
    - - - - - - +
    +
    +
    +

    + + handleSaveApply(ev){*|Promise.<*>} +

    + + +
    + luci.js, line 2834 +
    + +
    - +
    +
    -

    handleSaveApply(ev) → {*|Promise.<*>}

    - - - - - -
    -

    The handleSaveApply function is invoked when the user clicks +

    +

    The handleSaveApply function is invoked when the user clicks the Save & Apply button in the page action footer.

    The default implementation should be sufficient for most views using form.Map() based forms - it @@ -644,44 +1650,39 @@ extending this base class should overwrite the handleSaveApply function with null.

    The invocation of this function is wrapped by Promise.resolve() so it may return Promises if needed.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + + + + +
    NameTypeDescription
    NameTypeDescription
    ev @@ -690,125 +1691,116 @@ extending this base class should overwrite the

    The DOM event that triggered the function.

    + +

    The DOM event that triggered the function.

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + * + | + + Promise.<*> + + + Any return values of this function are discarded, but +passed through Promise.resolve() to ensure that any +returned promise runs to completion before the button +is reenabled.
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Any return values of this function are discarded, but -passed through Promise.resolve() to ensure that any -returned promise runs to completion before the button -is reenabled.

    -
    - - - -
    -
    - Type -
    -
    - -* -| - -Promise.<*> - - -
    -
    - - - - - - +
    +
    +
    +

    + + abstractload(){*|Promise.<*>} +

    + + +
    + luci.js, line 2725 +
    + +
    - +
    +
    -

    (abstract) load() → {*|Promise.<*>}

    - - - - - -
    -

    The load function is invoked before the view is rendered.

    +
    +

    The load function is invoked before the view is rendered.

    The invocation of this function is wrapped by Promise.resolve() so it may return Promises if needed.

    The return value of the function (or the resolved values @@ -816,119 +1808,109 @@ of the promise returned by it) will be passed as first argument to render().

    This function is supposed to be overwritten by subclasses, the default implementation does nothing.

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

    May return any value or a Promise resolving to any value.

    -
    - - - -
    -
    - Type -
    -
    - -* -| - -Promise.<*> - - -
    -
    + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + * + | + + Promise.<*> + + + May return any value or a Promise resolving to any value.
    + + + +
    +
    +
    +

    + + abstractrender(load_results){Node|Promise.<Node>} +

    + + +
    + luci.js, line 2757 +
    + +
    - +
    +
    -

    (abstract) render(load_results) → {Node|Promise.<Node>}

    - - - - - -
    -

    The render function is invoked after the +

    +

    The render function is invoked after the load() function and responsible for setting up the view contents. It must return a DOM Node or DocumentFragment holding the contents to @@ -941,44 +1923,39 @@ main content area using dom.append().

    This function is supposed to be overwritten by subclasses, the default implementation does nothing.

    -
    - - - - - - - - - -
    Parameters:
    +
    + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - + + + +
    NameTypeDescription
    NameTypeDescription
    load_results @@ -990,136 +1967,117 @@ the default implementation does nothing.

    This function will receive the return value of the + +

    + +

    This function will receive the return value of the view.load() function as first argument.

    + + + +
    + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Node + | + + Promise.<Node> + + + Should return a DOM Node value or a Promise resolving +to a Node value.
    - - - - - -
    - - - +
    +
    - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    Should return a DOM Node value or a Promise resolving -to a Node value.

    -
    - - - -
    -
    - Type -
    -
    - -Node -| - -Promise.<Node> - - -
    -
    - - - - - - - - - -
    -
    + + + + +
    + 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/index.html b/documentation/jsapi/index.html index d6997c8d82..550ed9bc8c 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 10:17:12 GMT+0100 (Central European Standard Time) +
    +
    - - - -
    - -
    - Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 09:33:05 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 b6f92a78db..aa2908c251 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 30ad4264b4..5a847add8e 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" } }