Age | Commit message (Collapse) | Author |
|
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>
|
|
- 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>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
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>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|