netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Allow custom links to be added to list views

Open jasonyates opened this issue 2 years ago • 4 comments

NetBox version

3.3.5

Feature type

New functionality

Proposed functionality

Custom links can currently be added to object views i.e. Circuits -> Circuit or DCIM -> Site

It would be very useful if they could also be added to the corresponding list views i.e. Circuits -> Circuits or DCIM -> Sites

Use case

Expand on the locations that custom links can be added. My personal use case is to create custom links to internal documentation on list views.

Database changes

No response

External dependencies

No response

jasonyates avatar Oct 06 '22 08:10 jasonyates

Maybe I'm misunderstanding, but you can already add custom links to tables. They should show up when you configure the table and add the column.

kkthxbye-code avatar Oct 06 '22 08:10 kkthxbye-code

Maybe I'm misunderstanding, but you can already add custom links to tables. They should show up when you configure the table and add the column.

You can associate a custom link to an object i.e Circuits -> Circuit and it can be added as a column in the table. It also shows up on the top right of the object view e.g.:

Screenshot 2022-10-06 at 09 53 19

This FR is related to having that same behaviour on the list view i.e. allowing me to associate a custom link to the Circuits -> Circuit list view and having it appear in the top right of the relevant list view e.g. https://demo.netbox.dev/circuits/circuits/

jasonyates avatar Oct 06 '22 08:10 jasonyates

Custom links are tied to individual objects as the object data can be accessed in the template. I don't see us changing this to allow adding static links to the main Netbox UI.

having that same behaviour

Specifically this is not going to happen, the behavior is going to be different as no object is passed to the template.

I'm open to other opinions from other users and the other maintainers though, but I don't personally think the idea makes sense.

Edit:

It is also unclear if you want the same links showing up in the list view - so if you register a Custom Link for Circuits -> Circuit it will show up all places, or if you want a new content type added like Circuits -> Circuit List. I think both are unfeasible to implement, if you want the same link showing up, it will be missing the object context. Content-types are based on models, so that is also not something we can just add for lists.

kkthxbye-code avatar Oct 06 '22 09:10 kkthxbye-code

I'll echo what @kkthxbye-code explained: Custom links are designed to render with the context of a particular object. It would not be possible to render any link which relies on this context on a list view.

jeremystretch avatar Oct 06 '22 12:10 jeremystretch

Going to close this out as there's been no further conversation around the points above.

jeremystretch avatar Nov 02 '22 17:11 jeremystretch

Well, right now I was actually looking for exactly this feature. :)

I wanted to use that feature to give our (potiential) users a quick filtering method (by a certain attribute). Yes, you may click on Filter, then search the attribute, select your value or enter the text … and you may bookmark the result view. But still … making things easier could be the edge in discussion "Netbox vs. tedious time consuming custom application.

My opinion: If used on an overview context (you could use plural and write "[Overview]" or sth. like this at the Model dropdown menu), replace these two Template fields with simple Textboxes for Link and (relative) URL, with no jinja2 stuff in play at all.

There is another use cases: Sometimes you just want to have some static link at an overview page, because it refers to a certain documentation concerning work steps for whatever (circuits? server installation? Sth. like this).

Just my 3 cents (because of inflation)

mwobst avatar Nov 28 '22 10:11 mwobst