firmware: avoid update-hook background cleanups
Since ea75da8a this is no longer necessary although the introduction
in 039ae3c19 states that this was happening and allegedly helping.
Pre-upgrade runs this as well as the cleanup audit if it's needed
manually.
(cherry picked from commit a6f5203adb751dd66def0938434fec2a2c0d94e3)
firmware: avoid update-hook background cleanups
Since ea75da8a this is no longer necessary although the introduction
in 039ae3c19 states that this was happening and allegedly helping.
Pre-upgrade runs this as well as the cleanup audit if it's needed
manually.
mvc:javascript:SimpleFileUploadDlg() - add download button for validation errors, closes https://github.com/opnsense/core/issues/9760
When uploading a file results in validation messages, add a download button to dump the results into a csv file as well.
Since our javascript code doesn't translate very well, only add an icon and skip the title text for simplicity.
(cherry picked from commit b2aae25d6ae21c32f753559c8f5f0858efe04220)
ApiControllerBase->exportCsv: add $separator as parameter and swtich the default to a semicolon (;), importCsv() already understands both, but semicolon seems to be more commonly used, which helps tools like Excel to open the file instantly as table.
(cherry picked from commit e1f7cf04e12e7502b772acf1a5e16ce46208530d)
mvc: catch empty data in CSV import
Catch empty lines. A single "," will generate
an empty string instead of NULL so we are good
here. It's safe to assume we have at least one
property in the line, otherwise the data is
useless to us anyway.
From the fgetcsv() manual:
A blank line in a CSV file will be returned as an array
comprising a single null field, and will not be treated
as an error.
See: https://www.php.net/manual/en/function.fgetcsv.php
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
bootgrid: batch enable/disable-selected toggle by default, clean up IDS page (#9768)
The footer commands weren't taking into account the required properties, rendering unlinked buttons where they shouldn't be (e.g. in dnsmasq DHCP ranges etc.).
Take this opportunity to clean up and improve some front-end code, including batching of enable/disable-selected API calls. The arbitrary default limit of "40" has been set based on (40 * 36-character UUID + ~150-character URI out of a 2k URI character limit).
In the controller, change how rows are collected (use getNodeByReference only for rootnode) to save some cycles, throw an error if someone tries to swap multiple records at once as that is less likely intentional anyway (explicit on/off are acceptable values) and keep simplified result output.
Reference: https://forum.opnsense.org/index.php?topic=50806.0
---------
Co-authored-by: Ad Schellevis <ad at opnsense.org>
bootgrid: batch enable/disable-selected, minor update for https://github.com/opnsense/core/pull/9768
This commit changes how rows are collected (use getNodeByReference only for rootnode) to save some cycles, throw an error if someone tries to swap multiple records at once as that is less likely intentional anyway (explicit on/off are acceptable values) and keep simplified result output.