NMS-16118: Structured Node List Page: handle query params#8535
Open
synqotik wants to merge 9 commits into
Open
NMS-16118: Structured Node List Page: handle query params#8535synqotik wants to merge 9 commits into
synqotik wants to merge 9 commits into
Conversation
b79c18e to
7119117
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the new Vue Structured Node List page to handle the full set of legacy element/nodeList.htm query-string parameters so links from other pages will continue to filter correctly after the legacy JSP is removed. It also adds the matching REST v2 Node API support (search property + criteria behavior) needed for the new FIQL clauses to work.
Changes:
- Adds parsers for legacy query params (
category1/2,foreignsource,mib2Parm*,snmpParm*,maclike/snmpphysaddr,monitoredService) and incorporates them into the node filter, with sys/SNMP match-type honored in FIQL generation. - Defers applying URL query filters in
Nodes.vueuntil categories and monitoring locations are loaded, via apendingRouteQueryref and a watcher. - Backend: adds
snmpInterface.physAddrsearch property/behavior and a customserviceType.namecriteria behavior (SQL subselect overipinterface/ifservices/service) on the Node REST v2 endpoint.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/components/Nodes/hooks/queryStringParser.ts | New parsers for category1/2, lowercase foreignsource, mib2Parm, snmpParm, maclike, monitoredService. |
| ui/src/components/Nodes/hooks/useNodeQuery.ts | Wires new parsers into filter build; adds wildcard handling for SNMP/sys match types; emits snmpInterface.physAddr and serviceType.name FIQL clauses. |
| ui/src/containers/Nodes.vue | Defers query-filter application until categories/locations are loaded. |
| ui/src/types/index.ts | Adds optional physAddr, sysMatchType, selectedService fields. |
| ui/src/components/Nodes/utils.ts | Renames "Location" column label to "Monitoring Location". |
| ui/tests/components/Nodes/hooks/*.test.ts | Tests for new parsers, match-type wildcards, physAddr, selectedService, tracked properties. |
| opennms-webapp-rest/.../NodeRestService.java | Registers NODE_SERVICE_TYPE_BEHAVIORS under serviceType. |
| opennms-webapp-rest/.../SearchProperties.java | Adds snmpInterface.physAddr and serviceType.name search properties. |
| opennms-webapp-rest/.../CriteriaBehaviors.java | Adds physAddr STRING behavior and SQL-subselect behavior for serviceType.name filtering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
christianpape
previously approved these changes
May 27, 2026
Contributor
christianpape
left a comment
There was a problem hiding this comment.
LGTM, but my Javascript/Typescript skills are pretty limited.
Contributor
Author
|
Converting to draft, fixing a few things and testing. |
8736133 to
414c858
Compare
- parseCategories: handles category1/category2 as arrays (vue-router repeats params as arrays for multi-value). Two groups produce union-within-group and intersection-between-groups FIQL instead of a flat intersection. - buildCategoryQuery: new grouped mode builds (A,B);(Q,R) when selectedCategories2 is present; single-group path unchanged. - NodeQueryFilter: adds optional selectedCategories2 field. - FilterTypeEnum: adds Category2 for chip removal in NodesTable. - nodeStructureStore: adds selectedCategories2 ref, updateSelectedCategories2, removeCategory2; clears group2 on clearAllFiltersAndSelections; restores from preferences. - NodeAdvancedFiltersDrawer: add/delete icon buttons to show/hide a second 'Additional Categories' autocomplete wired to selectedCategories2. - NodesTable: adds chips for selectedCategories2 with remove support.
…behaviors
Without this flag, CriteriaBuilderSearchVisitor applies a Hibernate property
restriction (e.g. like("snmpInterface.ifAlias", ...)) after the SQL subquery
BeforeVisit runs. Since NodeRestService never joins the snmpInterface alias
(getCriteriaBuilder has that call commented out), Hibernate throws
QueryException: could not resolve property: snmpInterface for both exact and
wildcard SNMP string field queries.
Fix mirrors serviceTypeName in CriteriaBehaviors.java which uses the same
SQL subquery pattern with setSkipPropertyByDefault(true).
414c858 to
eaa74dd
Compare
…ve search MAC addresses stored uppercase (SNMP4J OctetString.toHexString()), ifAlias/ifName/ifDescr stored in original case. Using case-sensitive LIKE caused MAC searches to never match and SNMP string filter searches to miss records that differed only in case (regression from legacy DefaultNodeListService which used Restrictions.ilike). Fix: use ilike in all SNMP string subselects for both EQUALS and NOT_EQUALS conditions. ilike without wildcards is semantically equivalent to case-insensitive =. Add regression tests using DatabasePopulator's seeded SNMP interfaces (physAddr=34E45604BB69, ifAlias='Initial ifAlias value') to verify lowercase wildcard searches find the uppercase/mixed-case stored values.
e01695d to
4a2e663
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We are replacing the legacy JSP Node List (
element/nodeList.htm) page with a new Vue UI page, currently known as theStructured Node Listpage.One final thing we've needed to do is to make sure links from other pages back to the node list page will work correctly with the new page. Those links can contains query string filter parameters to filter the node list.
We previously did work to handle some of these. This PR does the rest of the work to handle all of them. Some work in the Nodes v2 Rest API was also needed to handle some cases which were not fully handled by the FIQL -> Criteria processing.
Once this PR is merged, a 2nd PR will be done which actually relinks all existing links to the legacy node list page to the new Vue page, and will also remove the legacy page.
We handle the
category1/category2filtering from the Surveillance View. The filter will be union within category sets, then intersection between category sets. I.e.:(category1Item || category1Item || category1Item) && (category2Item || category2Item || category2Item)The UI has been updated to allow an optional 2nd category. If needed we could add more category sets.
Added full support for monitored service filtering, including accepting different query params and adding to the UI filters.
Fixed various issues re case-insensitive filtering and various other things.
External References