It's time to create a ticket for generalisation because now
resetStaticOptionList() is declared in two places also hinting
at a shared functionality in BaseListField.
With this we can insert new entries without the need to grab the entry
beforehand using config_read_array().
config_write_array('foo', 'bar', 'hello');
becomes
<foo>
<bar>hello</bar>
</foo>
* vpn/openvpn: Even though openvpn --genkey secret generates the same static key for secret, tls-auth and tls-crypt, it is more explicit to use all modes verbatim. It's simpler to expand it in the future this way.
This prevents edge cases of widget deletion or additions in one layout mode
still showing up in others. This also handles privilege changes, where
users don't have access to specific widgets anymore, making sure
these persisted widget layouts are cleaned up when requested.
We currently define 3 breakpoints with 1, 3 and 12 columns respectively.
Previously, if a user loaded the dashboard on a phone or tablet
screen and subsequently saved the layout, this layout would be
ignored in order to prevent a hardcoded number of columns on
larger screens. With this commit, each breakpoint will have its
own associated layout and dynamically adjust the layout to one
of the available ones if the screen is resized and forced to reduce
the number of columns. Layouts on smaller screens are therefore
persisted as well.
This splits off rtsold and dhcp6c into separate processes
which frees us from the restrictions of faked iterative IDs
for PD associations. For NA we simply default to 0 now.
I'm not entirely sure why we settled for a single deamon of
dhcp6c back in the day, but there are certianly downsides to
it and I don't see something that wasn't fixed in the meantime
that makes this not work.
When config keys are not found or are not arrays that should
be (especially for iterating with foreach) we do a trick here
by returning a detached empty array to avoid upper layer
errors, forcing empty arrays into $config yet reading and
removal still work fine. The default stays the "insert" mode,
which can be triggered explicitly just for symmetry. Bools
are not in the keys so this is perfectly fine.
The function itself was added in 4c179c23 in 2017 and hasn't
been modified since which is quite the achievement IMO. It's
had a clear purpose but now we make it just a little bit
better. :)
Look for more references at least in the legacy pages:
# git grep 'foreach.($config\[' src/www
* Reduce complexity of firewall_rule_lookup, we have an all rules entrypoint now, so potentially we could just search for the UUID of the rule without concerning us with interfaces anymore
* Clean up URL hash logic, we only allow #search and #interface now and need no special handling
* Only get the hash once, use it everywhere, re-add missing null fallback and initialized interface variable
* The hash was consumed too early now, fix it by shifting to the new spot where the variable is used last
Add UUID to the fields that can be searched, but only if the searchPhrase contains a valid UUID. That way it won't match on partial strings.
* Create new Type class in core library and add isUUID static, replace individual callers with the new static.
* Add a new static function containsUUID() to the new Type class.
* Move searchPhrase tokenization to ApiMutableControllerBase searchBase()
Determine if search_tokens contain a valid UUID, if yes collect the uuid field so it can be searched. Doing this prevents finding partial strings in UUIDs, but allows to find exact UUIDs.
Inside UIModelGrid fetchBindRequest(), use the search_tokens directly. A compatability case makes this backwards compatible for callers that do not know about search_tokens.
Pass the search_tokens directky into UIModelGrid fetch() instead of the raw searchPhrase.
Functionally this shouldn't change anything, but when building additional handlers, it's practical to show priorities of the ones that are registered.
To use the list action, simply call:
./blocklists.py list
Goes over the previous change by calling the reboot only once
instead of three times:
Here we are told there are upgrades pending and the upgrade hooks
were returning successfully. Apply the kernel immediately if
necessary to save a reboot. Contrary to popular belief the kernel
can still apply during a reboot if something went wrong, but this
way we save a reboot. After that don't question that a reboot is
necessary to avoid ever falling into the error case for no reason.
findNodeById() is not needed as findNodeByPath() does the same.
It's also not used anywhere else so just merge both.
On the system end make a getItem() which makes the code a little
cleaner and reduces callers of findNodeByPath() to one. ;)
One of the main issues with our previous bectl output was the variance of the (uuid) key, which we generated using the current name.
By using the create timestamp (acquired via zfs), we can keep our key stable on renames and offer access to simple json files on disk which contain additional notes.
Notes are stored in /conf/snapshots/ as json files, keyed by their generated uuid's.
* bootgrid: batch delete-selected by default
* ApiMutableModelControllerBase - simplify checkAndThrowSafeDelete in delBase a bit for https://github.com/opnsense/core/pull/9779
* use a descriptive name if available
---------
Co-authored-by: Ad Schellevis <ad@opnsense.org>
fw_log.volt:
Uses a url hash inside fw_log.volt to set a filter when opening it through a link from filter_rule.volt
The url hash can set any type of a single filter, so it can be reused in other pages as well.
Combine entry point of addCombinedFilter and addFilter, decide via array in field what type it is.
Change init entrypoint to always go through the filterChange() pipeline, but have a fast path in there that initializes without a filter. This adds the filter immediately when loading with the page with the URL hash
Make sure we want for tableBuilt to prevent replaceData errors
filter_rule.volt
Only show the log search button when row.log is 1 or true
Change fa icon in the lookup rule reference button in dnat as well for consistency
Use URLSearchParams()
---------
Co-authored-by: Stephan de Wit <stephan.de.wit@deciso.com>