From 3f1d6870ff0b3a0e8e0fc1c63ae2fbee86775261 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 16 Apr 2020 13:26:27 +0200 Subject: docs: update js api docs Signed-off-by: Jo-Philipp Wich --- docs/jsapi/rpc.js.html | 111 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-) (limited to 'docs/jsapi/rpc.js.html') diff --git a/docs/jsapi/rpc.js.html b/docs/jsapi/rpc.js.html index a1501a7234..34a41e33c5 100644 --- a/docs/jsapi/rpc.js.html +++ b/docs/jsapi/rpc.js.html @@ -74,12 +74,16 @@
  • error
  • +
  • fspath
  • +
  • get
  • halt
  • hasSystemFeature
  • +
  • hasViewPermission
  • +
  • isObject
  • location
  • @@ -331,6 +335,8 @@
  • optional
  • +
  • readonly
  • +
  • rmempty
  • uciconfig
  • @@ -423,6 +429,8 @@
  • placeholder
  • +
  • readonly
  • +
  • rmempty
  • uciconfig
  • @@ -511,6 +519,8 @@
  • placeholder
  • +
  • readonly
  • +
  • rmempty
  • uciconfig
  • @@ -595,6 +605,8 @@
  • placeholder
  • +
  • readonly
  • +
  • rmempty
  • uciconfig
  • @@ -687,6 +699,8 @@
  • placeholder
  • +
  • readonly
  • +
  • rmempty
  • uciconfig
  • @@ -775,6 +789,8 @@
  • placeholder
  • +
  • readonly
  • +
  • rmempty
  • uciconfig
  • @@ -929,6 +945,8 @@
  • placeholder
  • +
  • readonly
  • +
  • rmempty
  • uciconfig
  • @@ -997,6 +1015,10 @@ +
  • + + LuCI.ui.menu + + +
      + +
    + +
      + +
    + +
      + +
    +
  • +
  • LuCI.ui.Select @@ -3311,6 +3409,10 @@ return baseclass.extend(/** @lends LuCI.rpc.prototype */ { ret = msg.result; } else if (Array.isArray(msg.result)) { + if (req.raise && msg.result[0] !== 0) + L.raise('RPCError', 'RPC call to %s/%s failed with ubus code %d: %s', + req.object, req.method, msg.result[0], this.getStatusText(msg.result[0])); + ret = (msg.result.length > 1) ? msg.result[1] : msg.result[0]; } @@ -3446,6 +3548,10 @@ return baseclass.extend(/** @lends LuCI.rpc.prototype */ { * Specfies an optional filter function which is invoked to transform the * received reply data before it is returned to the caller. * + * @property {boolean} [reject=false] + * If set to `true`, non-zero ubus call status codes are treated as fatal + * error and lead to the rejection of the call promise. The default + * behaviour is to resolve with the call return code value instead. */ /** @@ -3534,7 +3640,8 @@ return baseclass.extend(/** @lends LuCI.rpc.prototype */ { params: params, priv: priv, object: options.object, - method: options.method + method: options.method, + raise: options.reject }; /* build message object */ @@ -3707,7 +3814,7 @@ return baseclass.extend(/** @lends LuCI.rpc.prototype */ { -- cgit v1.2.3