How does the interface filter (the JS based one built in to the table) work? #5647
Replies: 3 comments 1 reply
-
Hmm. I might actually be seeing a browser issue as I am now unable to replicate my problems at home... |
Beta Was this translation helpful? Give feedback.
-
I've gotten to the bottom of this and will document here for others in case it's useful. I'm using the netbox-docker image. At startup, it calls manage.py collectstatic to copy the static files to a dedicated static volume. When the volume was created, it was so with NetBox 2.10.0 as that was the latest image I had lying around and was after the release of 2.10.2 in which 442dee7 changed the way the filter worked. When I upgraded to 2.10.3, the file modification date on static/js/interface_filtering.js was older than the date collectstatic last copied the files to the volume and hence it wasn't updated. The code was expecting to find an id in the form interface_ge/0/0/0, yet the template was generating the data-name field as per the changes made to dcim/tables/devices.py in 442dee7 hence it did nothing. I fixed this by deleting the entire static directory and re-running manage.py collectstatic to re-copy the files. This also had a side effect in that it removed the font-awesome stuff that is no longer used but hadn't been deleted. It feels like this is a potential bug in the netbox-docker image and I'll raise a bug on https://github.com/netbox-community/netbox-docker however, is there any reason at all to retain any of the contents of the static volume between upgrades? I'm wondering whether it should just be blatted as a matter of course. |
Beta Was this translation helpful? Give feedback.
-
Hi @cpmills1975 I don't know if you still need help on this, but hopefully the following will shed some light. The interface filter uses regular expressions, not shell expansion. You may be used to shell expansion in bash (i.e. Example regular expressions:
Note that this is not exclusive to NetBox; this is just how regular expressions work. There are a lot of resources online with more complex examples, but I think these would suffice. |
Beta Was this translation helpful? Give feedback.
-
Hi All
I've been trying to understand how to use the (JavaScript based) filter that is built in to the interface table in 2.10.3 (and perhaps earlier - I've skipped many versions!). I understand it accepts a RegEx.
Take for example a Juniper Switch with ge-0/0/[0-47].
Some practical examples would be helpful - I know at some point, the users I support are going to ask...
Many thanks
Beta Was this translation helpful? Give feedback.
All reactions