Age | Commit message (Collapse) | Author |
|
Since option deletions are sent first, followed by ubus set commands,
a call sequence like:
uci.set('config', 'section', 'option', ['foo', 'bar'])
uci.set('config', 'section', 'option', ['foo'])
uci.unset('config', 'section', 'option')
... would result in the option retainining `foo` as value, instead of it
getting removed as one would expect.
Fix this issue by reverting the internal change state of the option before
storing the deletion.
While we're at it, also rework the internal tracking of deleted options to
not result in duplicate removal requests when the same option is unset
several times.
Finally change all `undefined` returns to `null` in order to comply with
the function documentation.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
- Process deletions before additions or changes, allowing user code to
remove and recreate a section with the same name.
- Only record section deletions when the section to be removed actually
existed in the original config or when it was staged for creation
earlier. This avoids stray ubus not found exception when saving.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Fixes: #3912
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ec3a202b69b5bf5785c0785b2ac39efbe5cae2b7)
|
|
Don't overwrite the `r` variable which is supposed to refer to the reordered
uci sections with temporary data for collecting uci add parameters.
Fixes stray uci/get permission errors caused by an attempt to load
nonsensical uci package names.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
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>
|
|
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>
|
|
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 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>
|