netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.77k stars 2.54k forks source link

Custom field filtering #17063

Closed M0NsTeRRR closed 1 day ago

M0NsTeRRR commented 1 month ago

NetBox version

v4.0.8

Feature type

Change to existing functionality

Proposed functionality

Add a way to filter custom field data when creating/editing related objects, similar to the "database" button on IPAM > IP Addresses (Interface Assignment).

Use case

I'm adding a custom field DCIM > Interfaces on Circuits > Provider Network object to track ENNI interfaces. We have multiple GigabitEthernet0/0/0 interfaces on different devices and we can't filter the interface based on the device name, which leads to confusion about which interface is chosen, as we can't know which one we selected.

Example with the interface creation menu: image

Current functionality (no database button for filtering): image

Database changes

No response

External dependencies

No response

jeremystretch commented 1 month ago

Thank you for your interest in extending NetBox. Unfortunately, the information you have provided does not constitute an actionable feature request. Per our contributing guide, a feature request must include a thorough description of the proposed functionality, including any database changes, new views or API endpoints, and so on. It must also include a detailed use case justifying its implementation. If you would like to elaborate on your proposal, please modify your post above. If sufficient detail is not added, this issue will be closed.

M0NsTeRRR commented 1 month ago

I've updated the feature request; I hope it aligns better now.

PS: I've read the contribution guide before creating this PR and used the feature request template. If something is still missing, please point out what is unclear.

jeremystretch commented 1 month ago

@M0NsTeRRR the entirety of your proposed functionality is a single sentence:

Add a way to filter custom field data when creating/editing related objects, similar to the "database" button on IPAM > IP Addresses (Interface Assignment).

Please spend some time and effort considering how this might be implemented and elaborate on the specific functionality you want to propose. What is the intended workflow? What specific UI changes are needed? Give some examples.

If you're not prepared to offer this degree of detail, please open a discussion instead.

lchabert commented 1 month ago

Hi @jeremystretch,

I'm joining @M0NsTeRRR for this feature request. It will be usefull if filters on custom-fields to be more precise. Especially when we have a lot of data inside objects likes interfaces (same name multiples times).

Exemple: we setup an custom-field as type object, linked to an interface.

Then when we need to select one interface on new object instance, we have 10k interfaces, with at least 1000 interfaces named 'Gi0/0/0/1' (one per each device).

I have made some test on my local netbox instance, and it seems we have only one line to add https://github.com/netbox-community/netbox/blob/develop/netbox/extras/models/customfields.py#L503 => +selector=True

Before: image

After: image

Is it more clear for you ? Thx, Regards

github-actions[bot] commented 1 month ago

This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.

github-actions[bot] commented 1 day ago

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.