summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources/rpc.js
AgeCommit message (Collapse)Author
2020-04-10luci-base: rpc.js: add ability to reject nonzero ubus statusesJo-Philipp Wich
Add a new declare option `reject` which makes the generated RPC call function reject with an error in case the remote ubus call returned a non-zero status. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-02luci-base: harmonize JS class naming and requestingJo-Philipp Wich
- Make builtin classes available via `require` to allow view code to request external and internal classes in a consistent manner without having to know which classes are builtin and which not - Make base classes request any used class explicitely instead of relying on implicitly set up L.{dom,view,Poll,Request,Class} aliases - Consistently convert class names to lower case in JSdoc to match the names used in `require` statements - Deprecate L.{dom,view,Poll,Request,Class} aliases Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-10-02luci-base: luci.js, rpc.js, uci.js, network.js: add JSDoc annotationsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-21luci-base: rpc.js: increase default timeout to 20s, allow batch preventionJo-Philipp Wich
Support a new option "nobatch: true" in rpc.declare() which prevents the underlying RPC call from being batched with other calls. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-12luci-base: rpc.js: fix list requests, handle aborted http requestsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-11luci-base: rpc.js: revamp error handling, add interceptor supportJo-Philipp Wich
Add two new functions L.rpc.addInterceptor() and L.rpc.removeInterceptor() which allow to register and remove interceptor functions which are invoked before the rpc reply result promise is fulfilled. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-10luci-base: rpc.js: add getStatusText() callJo-Philipp Wich
The new function allows translating an ubus return code into a human readable error message. Also report the called object and method on ubus rpc errors. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: rpc.js: drop batch apiJo-Philipp Wich
Now that LuCI.Request is transparently coalescing requests, there is no need for the rather cumbersome batch()/flush() api in rpc.js. Also refactor the code to get rid of the rpcRequestRegistry indirection and remove superfluous promises which simplifies the code a lot. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: rpc.js: make base URL configurableJo-Philipp Wich
Implement setters and getters for the base URL prefix used and also implement a session ID getter while we're at it. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-07-07luci-base: add uci.js and rpc.js classesJo-Philipp Wich
Add a new rpc.js class which provides low level facilities to exchanges messages with the ubus rpc endpoint. Also introduce a new uci.js class which provides client side uci manipulation routines. Signed-off-by: Jo-Philipp Wich <jo@mein.io>