Add a hidden column to the network table to allow filtering by hostnames #3264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR aim to accomplish?
This PR restores v5 functionality, allowing users to filter the Network table using hostnames.
The v5 table had a hostname column, allowing datatables to use the values on this column to filter the table.
In v6 this column was merged with IP column; The hostnames are dynamically added to the first cell, but they are not searchable.
Issue originally reported on Discourse:
https://discourse.pi-hole.net/t/search-in-tools-network-not-searching-on-hostname-v6/77123
How does this PR accomplish the above?
Including a hidden column containing the hostnames allows datatables to use these values.
Note:
When
saveState
istrue
, datatables ignoresvisible: false
and shows the column. If we setsaveState: false
we lose the ability to save properties like sort order, number of items per page, etc.To solve this issue, we keep
saveState: true
and useclass: "hide"
, to make sure the column will be hidden by CSS.hide
class.Link documentation PRs if any are needed to support this PR:
none
By submitting this pull request, I confirm the following:
git rebase
)