Age | Commit message (Collapse) | Author |
|
This is required to properly reload the configurations after applying uci
changes that solely consist of uci section ordering operations.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
- Apply the same style to <button> and <input type="button"> elements
- Increase width of modal CBI dialogs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add a tools.widgets library which bundles a number of useful, higher
level CBI widgets like firewall zone list or network interface dropdowns
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Rework validation error translations for compount operators such
as list() or neg() to not rely that much on specific native language
grammar.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add support for extended section syntax notation in @type[#] format and
refactor the package loading function to not load configurations twice
when a package load operation is already pending and another load request
is made for the same package.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add the ability to pass additional CSS classes to modal dialogs and
make use of this facility in form.js to annotate CBI map modals.
This can be used later by themes to apply additional CSS rules.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Calling abort() on a finished xhr object will clear properties such
as status which can confuse code relying on legacy LuCI request
helper functions.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Ensure that patterns like %d, %x, %o or %b properly truncate their
operands to whole integers.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Placeholders may be HTML elements instead of plain strings, so do
not use innerHTML to assign them but rely on L.dom.content() instead.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Implement new ubus rpcd backend calls for later use in the frontend:
- netdevs: dump information about Linux network devices present
- boardjson: dump /etc/board.json if present
- offload_support: query whether netfilter offloading is supported
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Properly handle ubus POST requests exceeding the default chunk size
and fix a possible nil dereference when rejecting incoming requests
due to bad JSON message framing.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Introduce firewall.js, a client side reimplementation of the
luci.model.firewall class.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Introduce network.js, a client side reimplementation of the
luci.model.network class.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Introduce a new tools.prng JS library which implements the musl libc
srand() and rand() calls to produce identical pseudo random number
sequences in the browser which is needed for the string to color
conversion later on.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Refactor L.require() to use L.raise() instead of L.error() to signal
class loading failures. This allows callers to handle class loading
errors in a graceful manner.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Factor out an L.raise() function out of L.error() which constructs and
throws an exception object.
Rework the remaining L.error() function to internally use L.raise() to
construct exceptionts to render.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
- Do not artificially cutoff dropdown items, use all available space
- Close open dropdown when clicking into the preview area
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
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>
|
|
- Drop manual RPC batch usage
- Use LuCI.Poll for status updates
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Extend LuCI.Request to automatically coalesce subsequent requests
to ubus resources into single batch requests.
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>
|
|
Introduce a new LuCI.Poll class which is able to repeat any
promise based function and not strictly tied to HTTP request
semantics.
Also rework LuCI.Request.Poll and XHR.Poll as well as
LuCI.start(), LuCI.stop(), LuCI.halt() etc. to redirect to
the new api.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
- Fix discovering base url if cache buster is appended to luci.js href
- Fix extracting require tokens in minified sources
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add an rpcd executable plugin containing procedures required by client
side views.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add a new client side form.js library which is a more or less direct
reimplementation of the Lua side cbi.lua in JavaScript.
Due to its client side nature, it supports a number of features which
would be hard to realize on the server side, such as drag&drop sorting,
modal sub-map dialogs, reload-free editing etc.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Do not render standard widgets like checkboxes, select boxes,
text input fields etc. on the server side anymore but utilize
the ui.js primitives instead.
This avoids logic duplication between server side cbi templates
and JS widgets in the future.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Implement further widget primitives like text inputs or checkboxes and
support custom validation callback functions when instantiating CBI
validators.
Also add support initializing ui.js widgets from the "data-ui-widget"
HTML attribute.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Introduce a new view() target for CBI dispatch nodes, as long with the
required template and plumbing work in luci.js to allow requiring view
classes.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
If the ui class is loaded, use its modalDialog facility to display runtime
errors, alternatively render them into the maincontent area.
Also prevent duplication of stack trace information and throw a low level
error on session expiration to allow higher layers to properly handle it.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
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>
|
|
Add an admin/ubus route mimicking the native uhttpd-mod-ubus protocol.
The main difference to the native protocol is that this gateway requires
no additional per-object/procedure ACL setup on the router side and that
it is located under the same prefix as LuCI itself, allowing the reuse
of the session login cookie.
This route is meant to be a transitional mechanism until client side
RPC calls are eventually migrated to uhttpd-mod-ubus completely.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Move the widget code to the ui class and replace it with compatibility
shims in cbi.js
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add a new data() function which allows to attach arbitrary JS data
to DOM elements.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
JS CBI fields have no parent form element anymore.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|