From: Jo-Philipp Wich Date: Wed, 12 Feb 2020 10:57:10 +0000 (+0100) Subject: docs: update JS api docs X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1e3f74211ed0c9f5e91bcd95f2ac52ee77f7d947;p=oweals%2Fluci.git docs: update JS api docs Signed-off-by: Jo-Philipp Wich --- diff --git a/docs/jsapi/LuCI.Class.html b/docs/jsapi/LuCI.Class.html index 428e53576..e1efc4a9a 100644 --- a/docs/jsapi/LuCI.Class.html +++ b/docs/jsapi/LuCI.Class.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1339,7 +1347,7 @@ class constructor and can be instantiated with new. @@ -1526,7 +1534,7 @@ enable inheritance. @@ -1673,7 +1681,7 @@ a subclass of this class'. @@ -1865,7 +1873,7 @@ enable inheritance. @@ -2095,7 +2103,7 @@ superclass method returned null. @@ -2318,7 +2326,7 @@ and the values extracted from the args array beginning with
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Headers.html b/docs/jsapi/LuCI.Headers.html index f23a6507b..d19075b5e 100644 --- a/docs/jsapi/LuCI.Headers.html +++ b/docs/jsapi/LuCI.Headers.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1103,7 +1111,7 @@ response objects using the response.headers property.

    @@ -1188,7 +1196,7 @@ response objects using the response.headers property.

    @@ -1337,7 +1345,7 @@ Note: Header-Names are case-insensitive.

    @@ -1491,7 +1499,7 @@ Note: Header-Names are case-insensitive.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Network.Device.html b/docs/jsapi/LuCI.Network.Device.html index 436fb0aeb..eec9069b9 100644 --- a/docs/jsapi/LuCI.Network.Device.html +++ b/docs/jsapi/LuCI.Network.Device.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1103,7 +1111,7 @@ device and allows querying device details such as packet statistics or MTU.

    < @@ -1188,7 +1196,7 @@ device and allows querying device details such as packet statistics or MTU.

    < @@ -1292,7 +1300,7 @@ device is not a Linux bridge. @@ -1393,7 +1401,7 @@ enabled, else false. @@ -1494,7 +1502,7 @@ for non-wifi devices or operation mode and ssid for wifi ones. @@ -1594,7 +1602,7 @@ for non-wifi devices or operation mode and ssid for wifi ones. @@ -1694,7 +1702,7 @@ for non-wifi devices or operation mode and ssid for wifi ones. @@ -1798,7 +1806,7 @@ e.g. for non-ethernet tunnel devices. @@ -1898,7 +1906,7 @@ e.g. for non-ethernet tunnel devices. @@ -1998,7 +2006,7 @@ e.g. for non-ethernet tunnel devices. @@ -2103,7 +2111,7 @@ assigned to any logical interface. @@ -2204,7 +2212,7 @@ logical interfaces this device is assigned to. @@ -2309,7 +2317,7 @@ a Linux bridge. @@ -2409,7 +2417,7 @@ a Linux bridge. @@ -2509,7 +2517,7 @@ a Linux bridge. @@ -2610,7 +2618,7 @@ the operation mode and SSID for wifi devices. @@ -2710,7 +2718,7 @@ the operation mode and SSID for wifi devices. @@ -2810,7 +2818,7 @@ the operation mode and SSID for wifi devices. @@ -2919,7 +2927,7 @@ the operation mode and SSID for wifi devices. @@ -3020,7 +3028,7 @@ the operation mode and SSID for wifi devices. @@ -3125,7 +3133,7 @@ is not a wireless device. @@ -3226,7 +3234,7 @@ else false. @@ -3327,7 +3335,7 @@ else false. @@ -3436,7 +3444,7 @@ when it is down or absent.
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Network.Hosts.html b/docs/jsapi/LuCI.Network.Hosts.html index ce99197ae..9af4dec9f 100644 --- a/docs/jsapi/LuCI.Network.Hosts.html +++ b/docs/jsapi/LuCI.Network.Hosts.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1104,7 +1112,7 @@ host information by different criteria.

    @@ -1189,7 +1197,7 @@ host information by different criteria.

    @@ -1339,7 +1347,7 @@ the corresponding host. @@ -1489,7 +1497,7 @@ the corresponding host. @@ -1639,7 +1647,7 @@ the corresponding host. @@ -1789,7 +1797,7 @@ the corresponding host. @@ -1939,7 +1947,7 @@ the corresponding host. @@ -2089,7 +2097,7 @@ the corresponding host. @@ -2239,7 +2247,7 @@ the corresponding host. @@ -2417,7 +2425,7 @@ is used as hint.
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Network.Protocol.html b/docs/jsapi/LuCI.Network.Protocol.html index 76aac1dff..d6dd78cb8 100644 --- a/docs/jsapi/LuCI.Network.Protocol.html +++ b/docs/jsapi/LuCI.Network.Protocol.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1103,7 +1111,7 @@ subclasses which describe logical UCI networks defined by config interface @@ -1188,7 +1196,7 @@ subclasses which describe logical UCI networks defined by config interface @@ -1349,7 +1357,7 @@ interface or if the logical interface is virtual. @@ -1510,7 +1518,7 @@ device or false if not. @@ -1671,7 +1679,7 @@ interface or if the logical interface is virtual. @@ -1823,7 +1831,7 @@ not found. @@ -1925,7 +1933,7 @@ expected Linux network device according to the configuration. @@ -2032,7 +2040,7 @@ virtual and not a bridge. @@ -2133,7 +2141,7 @@ protocol backend. @@ -2234,7 +2242,7 @@ protocol backend. @@ -2342,7 +2350,7 @@ error code in case no translation can be found.

    @@ -2446,7 +2454,7 @@ if it isn't applicable to the associated protocol. @@ -2548,7 +2556,7 @@ default route or null if no default route was found. @@ -2650,7 +2658,7 @@ default route or null if no default route was found. @@ -2752,7 +2760,7 @@ default route or null if no default route was found. @@ -2856,7 +2864,7 @@ it could not be determined. @@ -2960,7 +2968,7 @@ in CIDR notation or null if no IPv6 addresses were set. @@ -3062,7 +3070,7 @@ follows the order of the addresses in ubus runtime information. - network.js, line 2227 + network.js, line 2231 @@ -3166,7 +3174,7 @@ handler or null if no prefix is present. @@ -3270,7 +3278,7 @@ or null if no IPv4 addresses were set. @@ -3372,7 +3380,7 @@ follows the order of the addresses in ubus runtime information. - network.js, line 2526 + network.js, line 2530 @@ -3474,7 +3482,7 @@ network device currently associated with the logical interface. @@ -3576,7 +3584,7 @@ network device currently associated with the logical interface. @@ -3677,7 +3685,7 @@ routes spawned by the associated logical interface. @@ -3777,7 +3785,7 @@ routes spawned by the associated logical interface. @@ -3881,7 +3889,7 @@ protocol handler or null if no IPv4 addresses were set. @@ -3983,7 +3991,7 @@ function, e.g. odhcp6c for the dhcpv6 prototocol. @@ -4086,7 +4094,7 @@ function, e.g. odhcp6c for the dhcpv6 prototocol. @@ -4193,7 +4201,7 @@ interface or null if no type option is set. @@ -4293,7 +4301,7 @@ interface or null if no type option is set. @@ -4401,7 +4409,7 @@ handler didn't request a zone. @@ -4508,7 +4516,7 @@ is an alias or null if it is not an alias interface. @@ -4610,7 +4618,7 @@ or false when the logical interface is no bridge. @@ -4715,7 +4723,7 @@ or not (false). @@ -4816,7 +4824,7 @@ has no network devices attached.

    @@ -4925,7 +4933,7 @@ or not (false). @@ -5029,7 +5037,7 @@ returns true.

    @@ -5129,7 +5137,7 @@ returns true.

    @@ -5236,7 +5244,7 @@ dynamic interfaces (true) or not (false). @@ -5390,7 +5398,7 @@ configuration.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Network.WifiDevice.html b/docs/jsapi/LuCI.Network.WifiDevice.html index 0dc692901..6373db805 100644 --- a/docs/jsapi/LuCI.Network.WifiDevice.html +++ b/docs/jsapi/LuCI.Network.WifiDevice.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1104,7 +1112,7 @@ well as methods for enumerating related wireless networks.

    @@ -1189,7 +1197,7 @@ well as methods for enumerating related wireless networks.

    @@ -1344,7 +1352,7 @@ were invalid. @@ -1496,7 +1504,7 @@ with this wireless radio device. @@ -1648,7 +1656,7 @@ not found. @@ -1759,7 +1767,7 @@ known mode values are: @@ -1869,7 +1877,7 @@ known mode values are: @@ -1969,7 +1977,7 @@ known mode values are: @@ -2071,7 +2079,7 @@ for the wireless phy. @@ -2173,7 +2181,7 @@ describing the networks found in the vincinity. @@ -2324,7 +2332,7 @@ this radio device. @@ -2426,7 +2434,7 @@ radio device. @@ -2528,7 +2536,7 @@ UCI configuration. @@ -2629,7 +2637,7 @@ runtime state.

    @@ -2783,7 +2791,7 @@ configuration.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Network.WifiNetwork.html b/docs/jsapi/LuCI.Network.WifiNetwork.html index 478ba8bb9..4b4b7e0bc 100644 --- a/docs/jsapi/LuCI.Network.WifiNetwork.html +++ b/docs/jsapi/LuCI.Network.WifiNetwork.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1105,7 +1113,7 @@ such networks in parallel.

    @@ -1190,7 +1198,7 @@ such networks in parallel.

    @@ -1461,7 +1469,7 @@ are passed. @@ -1613,7 +1621,7 @@ not found. @@ -1714,7 +1722,7 @@ information. @@ -1815,7 +1823,7 @@ encryption state could not be found in ubus runtime information. - network.js, line 3572 + network.js, line 3576 @@ -1928,7 +1936,7 @@ state. Possible returned values are: @@ -2030,7 +2038,7 @@ translated string.

    @@ -2131,7 +2139,7 @@ information. @@ -2232,7 +2240,7 @@ with this network. @@ -2338,7 +2346,7 @@ is not available. @@ -2441,7 +2449,7 @@ is not available. @@ -2545,7 +2553,7 @@ or null if it cannot be determined. @@ -2646,7 +2654,7 @@ information or 00 if it cannot be determined. @@ -2747,7 +2755,7 @@ device associted with this wireless network. @@ -2852,7 +2860,7 @@ available. @@ -2955,7 +2963,7 @@ name, depending on which information is available. @@ -3058,7 +3066,7 @@ radio and network index numbers.

    @@ -3163,7 +3171,7 @@ associated network device, e.g. when not configured or up. @@ -3267,7 +3275,7 @@ is not in mesh mode. @@ -3374,7 +3382,7 @@ is not in mesh mode. @@ -3474,7 +3482,7 @@ is not in mesh mode. @@ -3579,7 +3587,7 @@ interface. @@ -3680,7 +3688,7 @@ attached to.

    @@ -3781,7 +3789,7 @@ logical interfaces this wireless network is attached to. @@ -3882,7 +3890,7 @@ information or 0 if it cannot be determined. @@ -3984,7 +3992,7 @@ internal network ID, depending on which information is available. @@ -4088,7 +4096,7 @@ information or null if it cannot be determined. @@ -4191,7 +4199,7 @@ noise and signal (SNR), divided by 5. @@ -4293,7 +4301,7 @@ by ubus runtime state. @@ -4397,7 +4405,7 @@ in mesh mode. @@ -4501,7 +4509,7 @@ in mesh mode. @@ -4605,7 +4613,7 @@ cannot be determined. @@ -4710,7 +4718,7 @@ found. @@ -4814,7 +4822,7 @@ or null if it cannot be determined. @@ -4915,7 +4923,7 @@ deauthenticating clients, otherwise false. @@ -5017,7 +5025,7 @@ UCI configuration. @@ -5122,7 +5130,7 @@ instance.

    @@ -5276,7 +5284,7 @@ configuration.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Network.html b/docs/jsapi/LuCI.Network.html index d8433c5bf..4dd84f333 100644 --- a/docs/jsapi/LuCI.Network.html +++ b/docs/jsapi/LuCI.Network.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1105,7 +1113,7 @@ current configuration details and to manipulate settings.

    @@ -1209,7 +1217,7 @@ current configuration details and to manipulate settings.

    @@ -1396,7 +1404,7 @@ existed. @@ -1546,7 +1554,7 @@ were invalid or if the associated radio device could not be found. @@ -1694,7 +1702,7 @@ references to it were successfully deleted from the configuration or @@ -1844,7 +1852,7 @@ be found. @@ -1945,7 +1953,7 @@ from the remote ubus apis.

    @@ -2096,7 +2104,7 @@ or WPA3 SAE (CCMP).

    @@ -2244,7 +2252,7 @@ be found. @@ -2345,7 +2353,7 @@ instances describing the network devices found on the system. @@ -2446,7 +2454,7 @@ instances describing the network devices found on the system. @@ -2550,7 +2558,7 @@ class instance describing the found hosts.

    @@ -2711,7 +2719,7 @@ object could not be converted to a name. @@ -2859,7 +2867,7 @@ the network or null if the network did not exist. @@ -2961,7 +2969,7 @@ describing all known networks. @@ -3161,7 +3169,7 @@ protocol isn't known. @@ -3262,7 +3270,7 @@ backend classes.

    @@ -3366,7 +3374,7 @@ the layout. @@ -3469,7 +3477,7 @@ instances describing the found IPv6 default route interfaces. @@ -3572,7 +3580,7 @@ instances describing the found default route interfaces. @@ -3721,7 +3729,7 @@ be found. @@ -3824,7 +3832,7 @@ the configuration. @@ -3975,7 +3983,7 @@ be found. @@ -4078,7 +4086,7 @@ are found. @@ -4228,7 +4236,7 @@ else returns false. @@ -4425,7 +4433,7 @@ if the given netmask value was invalid. @@ -4623,7 +4631,7 @@ value of 32 for IPv4 or 128 for IPv6. @@ -4795,7 +4803,7 @@ description for the given code. @@ -4913,7 +4921,7 @@ such as 6in4-wan or tun0.

    @@ -5086,7 +5094,7 @@ be passed to Class.extend().< @@ -7131,7 +7139,7 @@ conjunction with quality to calculate a quality percentage.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time) diff --git a/docs/jsapi/LuCI.Poll.html b/docs/jsapi/LuCI.Poll.html index 0be36a8e6..ef5aba59f 100644 --- a/docs/jsapi/LuCI.Poll.html +++ b/docs/jsapi/LuCI.Poll.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1104,7 +1112,7 @@ loop.

    @@ -1189,7 +1197,7 @@ loop.

    @@ -1291,7 +1299,7 @@ loop.

    @@ -1488,7 +1496,7 @@ already is registered. @@ -1662,7 +1670,7 @@ wasn't found. @@ -1764,7 +1772,7 @@ where registered) or false when the polling loop already runs. @@ -1874,7 +1882,7 @@ run to begin with.
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Request.html b/docs/jsapi/LuCI.Request.html index 4588f78fd..177b8c186 100644 --- a/docs/jsapi/LuCI.Request.html +++ b/docs/jsapi/LuCI.Request.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1103,7 +1111,7 @@ for dealing with responses.

    @@ -1195,7 +1203,7 @@ for dealing with responses.

    @@ -1343,7 +1351,7 @@ implementing request retries before returning a failure.

    @@ -1489,7 +1497,7 @@ if it already was absolute. @@ -1669,7 +1677,7 @@ if it already was absolute. @@ -1879,7 +1887,7 @@ if it already was absolute. @@ -2026,7 +2034,7 @@ function.

    @@ -2212,7 +2220,7 @@ function.

    @@ -2614,6 +2622,45 @@ given object will be converted to JSON.

    + + + responseType + + + + + +string + + + + + + + + + <optional>
    + + + + + + + + + + text + + + + +

    Overrides the request response type. Valid values or text to +interpret the response as UTF-8 string or blob to handle the +response as binary Blob data.

    + + + + content @@ -2770,7 +2817,7 @@ instances as sole argument during the HTTP request transfer.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Request.poll.html b/docs/jsapi/LuCI.Request.poll.html index 28a716595..8865bf20f 100644 --- a/docs/jsapi/LuCI.Request.poll.html +++ b/docs/jsapi/LuCI.Request.poll.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1104,7 +1112,7 @@ request calls as polling functions.

    @@ -1189,7 +1197,7 @@ request calls as polling functions.

    @@ -1260,7 +1268,7 @@ request calls as polling functions.

    @@ -1527,7 +1535,7 @@ invoke for each HTTP reply.

    @@ -1674,7 +1682,7 @@ This function is essentially a wrapper around @@ -1745,7 +1753,7 @@ This function is essentially a wrapper around @@ -1822,7 +1830,7 @@ This function is essentially a wrapper around @@ -1993,7 +2001,7 @@ else null.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.Response.html b/docs/jsapi/LuCI.Response.html index f5b3fdf42..5627139ec 100644 --- a/docs/jsapi/LuCI.Response.html +++ b/docs/jsapi/LuCI.Response.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1102,7 +1110,7 @@ @@ -1452,6 +1460,106 @@
    +
    +
    +

    + + blob(){Blob} +

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

    Access the response content as blob.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Blob + + + The response content as blob.
    + + + + +
    + + +

    @@ -1461,7 +1569,7 @@

    @@ -1616,7 +1724,7 @@ using String() and treated as response text.

    @@ -1743,7 +1851,7 @@ using String() and treated as response text.

    @@ -1851,7 +1959,7 @@ using String() and treated as response text.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.XHR.html b/docs/jsapi/LuCI.XHR.html index 62a7e8963..4d1670b7b 100644 --- a/docs/jsapi/LuCI.XHR.html +++ b/docs/jsapi/LuCI.XHR.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1106,7 +1114,7 @@ request handling.

    @@ -1193,7 +1201,7 @@ request handling.

    @@ -1267,7 +1275,7 @@ request handling.

    @@ -1370,7 +1378,7 @@ already completed. @@ -1447,7 +1455,7 @@ finishes or timed out.

    @@ -1690,7 +1698,7 @@ finishes or timed out.

    @@ -1933,7 +1941,7 @@ finishes or timed out.

    @@ -2043,7 +2051,7 @@ when invoked.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.dom.html b/docs/jsapi/LuCI.dom.html index 8247dc1ea..539e07683 100644 --- a/docs/jsapi/LuCI.dom.html +++ b/docs/jsapi/LuCI.dom.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1103,7 +1111,7 @@ manipulating DOM elements.

    @@ -1188,7 +1196,7 @@ manipulating DOM elements.

    @@ -1389,7 +1397,7 @@ if either the node argument was no valid DOM node or i @@ -1587,7 +1595,7 @@ call implicitely turning it into a string.

    @@ -1788,7 +1796,7 @@ a valid Class instance.

    @@ -2004,7 +2012,7 @@ instance didn't have the requested method. @@ -2208,7 +2216,7 @@ if either the node argument was no valid DOM node or i @@ -2468,7 +2476,7 @@ element names, such as spaces.

    @@ -2707,7 +2715,7 @@ be found. @@ -2852,7 +2860,7 @@ be found. @@ -3002,7 +3010,7 @@ class could be found on the node itself or any of its parents. @@ -3189,7 +3197,7 @@ result when testing it using the given ignoreFn. @@ -3375,7 +3383,7 @@ selector didn't match. @@ -3565,7 +3573,7 @@ selector didn't match any parent. @@ -3720,7 +3728,7 @@ the first div element node.

    @@ -3874,7 +3882,7 @@ ignored, else not.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.fs.html b/docs/jsapi/LuCI.fs.html index 06b0d2f10..c370890be 100644 --- a/docs/jsapi/LuCI.fs.html +++ b/docs/jsapi/LuCI.fs.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1104,7 +1112,7 @@ external JavaScript, use L.require("fs").then(...).

    - fs.js, line 111 + fs.js, line 145 @@ -1189,7 +1197,7 @@ external JavaScript, use L.require("fs").then(...).

    - fs.js, line 232 + fs.js, line 266 @@ -1394,6 +1402,284 @@ results or rejecting with an error stating the failure reason. + + + + +
    +
    +

    + + exec_direct(command, params, type, latin1){Promise.<*>} +

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

    Execute the specified command, bypassing ubus.

    +

    Note: The command must be either the path to an executable, +or a basename without arguments in which case it will be searched +in $PATH. If specified, the values given in params will be passed +as arguments to the command.

    +

    This function will invoke the requested commands through the cgi-io +helper applet at /cgi-bin/cgi-exec which bypasses the ubus rpc +transport. This is useful to fetch large command outputs which might +exceed the ubus message size limits or which contain binary data.

    +

    The cgi-io helper will enforce the same access permission rules as +the ubus based exec call.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefaultDescription
    command + + +string + + + + + + + + + + + + +

    The command to invoke.

    params + + +Array.<string> + + + + + + + + + optional + + + + + +

    The arguments to pass to the command.

    type + + +string + + + + + + text + + + + + optional + + + + + +

    The expected output type of the invoked program. Valid values are +text to interpret the output as string, json to parse the output +as JSON or blob to return the output as Blob instance.

    latin1 + + +boolean + + + + + + false + + + + + optional + + + + + +

    Whether to encode the command line as Latin1 instead of UTF-8. This +is usually not needed but can be useful for programs that cannot +handle UTF-8 input.

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<*> + + + Returns a promise resolving with the command stdout output interpreted +according to the specified type or rejecting with an error stating the +failure reason.
    + + + +
    @@ -1407,7 +1693,7 @@ results or rejecting with an error stating the failure reason. @@ -1557,7 +1843,7 @@ of the given file or [] on failure. @@ -1703,7 +1989,7 @@ rejecting with an error stating the failure reason. @@ -1837,6 +2123,208 @@ rejecting with an error stating the failure reason. + + + + +
    +
    +

    + + read_direct(path, type){Promise.<*>} +

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

    Read the contents of the given file and return them, bypassing ubus.

    +

    This function will read the requested file through the cgi-io +helper applet at /cgi-bin/cgi-download which bypasses the ubus rpc +transport. This is useful to fetch large file contents which might +exceed the ubus message size limits or which contain binary data.

    +

    The cgi-io helper will enforce the same access permission rules as +the ubus based read call.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDefaultDescription
    path + + +string + + + + + + + + + + + + +

    The file path to read.

    type + + +string + + + + + + text + + + + + optional + + + + + +

    The expected type of read file contents. Valid values are text to +interpret the contents as string, json to parse the contents as JSON +or blob to return the contents as Blob instance.

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Promise.<*> + + + Returns a promise resolving with the file contents interpreted according +to the specified type or rejecting with an error stating the failure +reason.
    + + + +
    @@ -1850,7 +2338,7 @@ rejecting with an error stating the failure reason. @@ -1996,7 +2484,7 @@ the failure reason. @@ -2142,7 +2630,7 @@ rejecting with an error stating the failure reason. @@ -2294,7 +2782,7 @@ on failure. @@ -2983,7 +3471,7 @@ the failure reason.
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.html b/docs/jsapi/LuCI.html index 000e39084..2d15fc039 100644 --- a/docs/jsapi/LuCI.html +++ b/docs/jsapi/LuCI.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1321,7 +1329,7 @@ as request timeouts, base URLs etc.

    @@ -1533,7 +1541,7 @@ as parameters.

    @@ -1772,7 +1780,7 @@ argument or copied from the given error instance.

    @@ -1984,7 +1992,7 @@ callback function. The function is a wrapper around @@ -2087,7 +2095,7 @@ when it didn't run to begin with. @@ -2280,7 +2288,7 @@ has no sub-features. @@ -2435,7 +2443,7 @@ not null, else returns false. @@ -2522,6 +2530,163 @@ not null, else returns false. + + + + +
    +
    +

    + + media(parts){string} +

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

    Construct an URL path relative to the media resource path of the +LuCI ui (usually /luci-static/$theme_name).

    +

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

    An array of parts to join into an URL path. Parts may contain +slashes and any of the other characters mentioned above.

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + string + + + Returns the resulting URL path.
    + + + +
    @@ -2535,7 +2700,7 @@ not null, else returns false. @@ -2722,7 +2887,7 @@ slashes and any of the other characters mentioned above.

    @@ -3027,7 +3192,7 @@ polling request. @@ -3242,7 +3407,7 @@ by default.

    @@ -3481,7 +3646,7 @@ argument or copied from the given error instance.

    @@ -3739,7 +3904,7 @@ class instance.

    @@ -3910,7 +4075,7 @@ to the given default value on error. @@ -4067,7 +4232,7 @@ slashes and any of the other characters mentioned above.

    @@ -4170,7 +4335,7 @@ when it was already running. @@ -4387,7 +4552,7 @@ addresses or numeric values respectively.

    @@ -4535,7 +4700,7 @@ it could not be found. @@ -4685,7 +4850,7 @@ space and returned as array.

    @@ -4848,7 +5013,7 @@ slashes and any of the other characters mentioned above.

    @@ -5019,7 +5184,7 @@ else null.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.rpc.html b/docs/jsapi/LuCI.rpc.html index c6c065afb..35d319848 100644 --- a/docs/jsapi/LuCI.rpc.html +++ b/docs/jsapi/LuCI.rpc.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -3221,7 +3229,7 @@ to the expect and filter declarations.
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.uci.html b/docs/jsapi/LuCI.uci.html index 98698e98d..a38f932f2 100644 --- a/docs/jsapi/LuCI.uci.html +++ b/docs/jsapi/LuCI.uci.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -4769,7 +4777,7 @@ associated name as arguments.

    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/LuCI.view.html b/docs/jsapi/LuCI.view.html index 53c222c5f..3e300f262 100644 --- a/docs/jsapi/LuCI.view.html +++ b/docs/jsapi/LuCI.view.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1103,7 +1111,7 @@ set of methods to inherit from.

    @@ -1188,7 +1196,7 @@ set of methods to inherit from.

    @@ -1301,7 +1309,7 @@ methods are overwritten with null. @@ -1465,7 +1473,7 @@ is reenabled. @@ -1629,7 +1637,7 @@ is reenabled. @@ -1795,7 +1803,7 @@ is reenabled. @@ -1905,7 +1913,7 @@ the default implementation does nothing.

    @@ -2079,7 +2087,7 @@ to a Node value.
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:06 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/fs.js.html b/docs/jsapi/fs.js.html index 467319f89..769e3edd8 100644 --- a/docs/jsapi/fs.js.html +++ b/docs/jsapi/fs.js.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1186,6 +1194,40 @@ function handleRpcReply(expect, rc) { return rc; } +function handleCgiIoReply(res) { + if (!res.ok || res.status != 200) { + var e = new Error(res.statusText); + switch (res.status) { + case 400: + e.name = 'InvalidArgumentError'; + break; + + case 403: + e.name = 'PermissionError'; + break; + + case 404: + e.name = 'NotFoundError'; + break; + + default: + e.name = 'Error'; + } + throw e; + } + + switch (this.type) { + case 'blob': + return res.blob(); + + case 'json': + return res.json(); + + default: + return res.text(); + } +} + /** * @class fs * @memberof LuCI @@ -1371,6 +1413,100 @@ var FileSystem = L.Class.extend(/** @lends LuCI.fs.prototype */ { return lines; }); + }, + + /** + * Read the contents of the given file and return them, bypassing ubus. + * + * This function will read the requested file through the cgi-io + * helper applet at `/cgi-bin/cgi-download` which bypasses the ubus rpc + * transport. This is useful to fetch large file contents which might + * exceed the ubus message size limits or which contain binary data. + * + * The cgi-io helper will enforce the same access permission rules as + * the ubus based read call. + * + * @param {string} path + * The file path to read. + * + * @param {string} [type=text] + * The expected type of read file contents. Valid values are `text` to + * interpret the contents as string, `json` to parse the contents as JSON + * or `blob` to return the contents as Blob instance. + * + * @returns {Promise<*>} + * Returns a promise resolving with the file contents interpreted according + * to the specified type or rejecting with an error stating the failure + * reason. + */ + read_direct: function(path, type) { + var postdata = 'sessionid=%s&path=%s' + .format(encodeURIComponent(L.env.sessionid), encodeURIComponent(path)); + + return L.Request.post(L.env.cgi_base + '/cgi-download', postdata, { + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: (type == 'blob') ? 'blob' : 'text' + }).then(handleCgiIoReply.bind({ type: type })); + }, + + /** + * Execute the specified command, bypassing ubus. + * + * Note: The `command` must be either the path to an executable, + * or a basename without arguments in which case it will be searched + * in $PATH. If specified, the values given in `params` will be passed + * as arguments to the command. + * + * This function will invoke the requested commands through the cgi-io + * helper applet at `/cgi-bin/cgi-exec` which bypasses the ubus rpc + * transport. This is useful to fetch large command outputs which might + * exceed the ubus message size limits or which contain binary data. + * + * The cgi-io helper will enforce the same access permission rules as + * the ubus based exec call. + * + * @param {string} command + * The command to invoke. + * + * @param {string[]} [params] + * The arguments to pass to the command. + * + * @param {string} [type=text] + * The expected output type of the invoked program. Valid values are + * `text` to interpret the output as string, `json` to parse the output + * as JSON or `blob` to return the output as Blob instance. + * + * @param {boolean} [latin1=false] + * Whether to encode the command line as Latin1 instead of UTF-8. This + * is usually not needed but can be useful for programs that cannot + * handle UTF-8 input. + * + * @returns {Promise<*>} + * Returns a promise resolving with the command stdout output interpreted + * according to the specified type or rejecting with an error stating the + * failure reason. + */ + exec_direct: function(command, params, type, latin1) { + var cmdstr = String(command) + .replace(/\\/g, '\\\\').replace(/(\s)/g, '\\$1'); + + if (Array.isArray(params)) + for (var i = 0; i < params.length; i++) + cmdstr += ' ' + String(params[i]) + .replace(/\\/g, '\\\\').replace(/(\s)/g, '\\$1'); + + if (latin1) + cmdstr = escape(cmdstr).replace(/\+/g, '%2b'); + else + cmdstr = encodeURIComponent(cmdstr); + + var postdata = 'sessionid=%s&command=%s' + .format(encodeURIComponent(L.env.sessionid), cmdstr); + + return L.Request.post(L.env.cgi_base + '/cgi-exec', postdata, { + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: (type == 'blob') ? 'blob' : 'text' + }).then(handleCgiIoReply.bind({ type: type })); } }); @@ -1387,7 +1523,7 @@ return FileSystem;
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/index.html b/docs/jsapi/index.html index 5933bcd94..c5203a4d2 100644 --- a/docs/jsapi/index.html +++ b/docs/jsapi/index.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1104,7 +1112,7 @@
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/luci.js.html b/docs/jsapi/luci.js.html index 126825668..c8bf70211 100644 --- a/docs/jsapi/luci.js.html +++ b/docs/jsapi/luci.js.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1145,7 +1153,7 @@ * It provides simple means to create subclasses of given classes and * implements prototypal inheritance. */ - var superContext = null, Class = Object.assign(function() {}, { + var superContext = {}, classIndex = 0, Class = Object.assign(function() {}, { /** * Extends this base class with the properties described in * `properties` and returns a new subclassed Class instance @@ -1164,8 +1172,9 @@ */ extend: function(properties) { var props = { + __id__: { value: classIndex }, __base__: { value: this.prototype }, - __name__: { value: properties.__name__ || 'anonymous' } + __name__: { value: properties.__name__ || 'anonymous' + classIndex++ } }; var ClassConstructor = function() { @@ -1343,15 +1352,21 @@ * superclass method returned `null`. */ super: function(key, callArgs) { - for (superContext = Object.getPrototypeOf(superContext || - Object.getPrototypeOf(this)); - superContext && !superContext.hasOwnProperty(key); - superContext = Object.getPrototypeOf(superContext)) { } + if (key == null) + return null; + + var slotIdx = this.__id__ + '.' + key, + symStack = superContext[slotIdx], + protoCtx = null; - if (!superContext) + for (protoCtx = Object.getPrototypeOf(symStack ? symStack[0] : Object.getPrototypeOf(this)); + protoCtx != null && !protoCtx.hasOwnProperty(key); + protoCtx = Object.getPrototypeOf(protoCtx)) {} + + if (protoCtx == null) return null; - var res = superContext[key]; + var res = protoCtx[key]; if (arguments.length > 1) { if (typeof(res) != 'function') @@ -1360,10 +1375,18 @@ if (typeof(callArgs) != 'object') callArgs = this.varargs(arguments, 1); + if (symStack) + symStack.unshift(protoCtx); + else + superContext[slotIdx] = [ protoCtx ]; + res = res.apply(this, callArgs); - } - superContext = null; + if (symStack && symStack.length > 1) + symStack.shift(protoCtx); + else + delete superContext[slotIdx]; + } return res; }, @@ -1512,17 +1535,32 @@ /* privates */ this.xhr = xhr; - if (content != null && typeof(content) == 'object') { + if (content instanceof Blob) { + this.responseBlob = content; + this.responseJSON = null; + this.responseText = null; + } + else if (content != null && typeof(content) == 'object') { + this.responseBlob = null; this.responseJSON = content; this.responseText = null; } else if (content != null) { + this.responseBlob = null; this.responseJSON = null; this.responseText = String(content); } else { this.responseJSON = null; - this.responseText = xhr.responseText; + + if (xhr.responseType == 'blob') { + this.responseBlob = xhr.response; + this.responseText = null; + } + else { + this.responseBlob = null; + this.responseText = xhr.responseText; + } } }, @@ -1581,6 +1619,18 @@ this.responseText = JSON.stringify(this.responseJSON); return this.responseText; + }, + + /** + * Access the response content as blob. + * + * @instance + * @memberof LuCI.Response + * @returns {Blob} + * The response content as blob. + */ + blob: function() { + return this.responseBlob; } }); @@ -1694,6 +1744,11 @@ * @property {boolean} [credentials=false] * Whether to include credentials such as cookies in the request. * + * @property {string} [responseType=text] + * Overrides the request response type. Valid values or `text` to + * interpret the response as UTF-8 string or `blob` to handle the + * response as binary `Blob` data. + * * @property {*} [content] * Specifies the HTTP message body to send along with the request. * If the value is a function, it is invoked and the return value @@ -1779,7 +1834,7 @@ else opt.xhr.open(opt.method, opt.url, true); - opt.xhr.responseType = 'text'; + opt.xhr.responseType = opt.responseType || 'text'; if ('overrideMimeType' in opt.xhr) opt.xhr.overrideMimeType('application/octet-stream'); @@ -2255,6 +2310,8 @@ if (env.base_url == null) this.error('InternalError', 'Cannot find url of luci.js'); + env.cgi_base = env.scriptname.replace(/\/[^\/]+$/, ''); + Object.assign(this.env, env); document.addEventListener('poll-start', function(ev) { @@ -2571,8 +2628,8 @@ if (rpcBaseURL == null) { var rpcFallbackURL = this.url('admin/ubus'); - rpcBaseURL = Request.get('/ubus/').then(function(res) { - return (rpcBaseURL = (res.status == 400) ? '/ubus/' : rpcFallbackURL); + rpcBaseURL = Request.get(this.env.ubuspath).then(function(res) { + return (rpcBaseURL = (res.status == 400) ? L.env.ubuspath : rpcFallbackURL); }, function() { return (rpcBaseURL = rpcFallbackURL); }).then(function(url) { @@ -2811,6 +2868,28 @@ return this.path(this.env.resource, arguments); }, + /** + * Construct an URL path relative to the media resource path of the + * LuCI ui (usually `/luci-static/$theme_name`). + * + * The resulting URL is guaranteed to only contain the characters + * `a-z`, `A-Z`, `0-9`, `_`, `.`, `%`, `,`, `;`, and `-` as well + * as `/` for the path separator. + * + * @instance + * @memberof LuCI + * + * @param {string[]} [parts] + * An array of parts to join into an URL path. Parts may contain + * slashes and any of the other characters mentioned above. + * + * @return {string} + * Returns the resulting URL path. + */ + media: function() { + return this.path(this.env.media, arguments); + }, + /** * Return the complete URL path to the current view. * @@ -3909,9 +3988,9 @@ * returned promise runs to completion before the button * is reenabled. */ - handleSaveApply: function(ev) { + handleSaveApply: function(ev, mode) { return this.handleSave(ev).then(function() { - L.ui.changes.apply(true); + L.ui.changes.apply(mode == '0'); }); }, @@ -3983,12 +4062,20 @@ addFooter: function() { var footer = E([]); + var saveApplyBtn = this.handleSaveApply ? new L.ui.ComboButton('0', { + 0: [ _('Save & Apply') ], + 1: [ _('Apply unchecked') ] + }, { + classes: { + 0: 'cbi-button cbi-button-apply important', + 1: 'cbi-button cbi-button-negative important' + }, + click: L.ui.createHandlerFn(this, 'handleSaveApply') + }).render() : E([]); + if (this.handleSaveApply || this.handleSave || this.handleReset) { footer.appendChild(E('div', { 'class': 'cbi-page-actions' }, [ - this.handleSaveApply ? E('button', { - 'class': 'cbi-button cbi-button-apply', - 'click': L.ui.createHandlerFn(this, 'handleSaveApply') - }, [ _('Save & Apply') ]) : '', ' ', + saveApplyBtn, ' ', this.handleSave ? E('button', { 'class': 'cbi-button cbi-button-save', 'click': L.ui.createHandlerFn(this, 'handleSave') @@ -4162,7 +4249,7 @@
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/network.js.html b/docs/jsapi/network.js.html index 3b42218a6..4a306a23a 100644 --- a/docs/jsapi/network.js.html +++ b/docs/jsapi/network.js.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1083,7 +1091,7 @@ var proto_errors = { CONNECT_FAILED: _('Connection attempt failed'), - INVALID_ADDRESS: _('IP address in invalid'), + INVALID_ADDRESS: _('IP address is invalid'), INVALID_GATEWAY: _('Gateway address is invalid'), INVALID_LOCAL_ADDRESS: _('Local IP address is invalid'), MISSING_ADDRESS: _('IP address is missing'), @@ -1463,6 +1471,7 @@ function initNetworkState(refresh) { type: dev.type, mtu: dev.mtu, qlen: dev.qlen, + wireless: dev.wireless, ipaddrs: [], ip6addrs: [] }; @@ -2226,7 +2235,10 @@ Network = L.Class.extend(/** @lends LuCI.Network.prototype */ { if (devices.hasOwnProperty(ifname)) continue; - if (isIgnoredIfname(ifname) || isVirtualIfname(ifname) || isWifiIfname(ifname)) + if (isIgnoredIfname(ifname) || isWifiIfname(ifname)) + continue; + + if (_state.netdevs[ifname].wireless) continue; devices[ifname] = this.instantiateDevice(ifname); @@ -5183,7 +5195,7 @@ return Network;
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/rpc.js.html b/docs/jsapi/rpc.js.html index 4f10cb3ad..c9d239b0e 100644 --- a/docs/jsapi/rpc.js.html +++ b/docs/jsapi/rpc.js.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -1565,7 +1573,7 @@ return L.Class.extend(/** @lends LuCI.rpc.prototype */ {
    - Documentation generated by JSDoc 3.6.3 on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time) + Documentation generated by JSDoc 3.6.3 on Wed Feb 12 2020 11:56:59 GMT+0100 (Central European Standard Time)
    diff --git a/docs/jsapi/uci.js.html b/docs/jsapi/uci.js.html index c12047cb5..8a619eed1 100644 --- a/docs/jsapi/uci.js.html +++ b/docs/jsapi/uci.js.html @@ -74,6 +74,8 @@
  • location
  • +
  • media
  • +
  • path
  • poll
  • @@ -220,12 +222,16 @@
  • exec
  • +
  • exec_direct
  • +
  • lines
  • list
  • read
  • +
  • read_direct
  • +
  • remove
  • stat
  • @@ -864,6 +870,8 @@ Methods +
  • blob
  • +
  • clone
  • json
  • @@ -2031,7 +2039,7 @@ return L.Class.extend(/** @lends LuCI.uci.prototype */ {