Skip to content

Allow Tags to be displayed in a specific order #17841

Closed
@BrunoBlanes

Description

@BrunoBlanes

NetBox version

v4.1.0

Feature type

New functionality

Triage priority

N/A

Proposed functionality

Add an integer Index field to the Tag object definition which can be used by the frontend to order tags first by Index, then alphabetically when displaying them.

  • Index ordering should be from lowest to highest value, where the lowest value has the highest priority and therefore it is displayed before any other tags
  • Some sort of hard limit, e.g. -128 to 128, could be implemented for optimization
  • The default index value must be zero
  • For tags with the same index, alphabetical sorting should be the default behavior. This is to ensure that, when migrating to this implementation existing behavior is preserved.

Use case

There are innumerous use cases for tags, one such case is the ability to give information about an object such as a virtual machine:

NETPY CLT01 VM108 APCHE

 |     |      |      |_ Gives a clear visual hint of the service running in this machine
 |     |      |________ Shows the virtual machine name according to our virtualization system
 |     |_______________ Identifies the cluster where this machine belongs to
 |_____________________ Identifies the tenant

It would be lovely to display the four tags in the aforementioned order, since that is the formal name of this object and everywhere in our internal processes and documents, we refer to this virtual machine as NETPY-CLT01-VM108-APCHE.

Having the ability to sort tags when displaying objects in Netbox will allow for further customization and integration with other systems that rely on tags for looking up objects.

Database changes

A new integer column for the Tag table definition.

External dependencies

None that I am aware of.

Metadata

Metadata

Assignees

Labels

complexity: mediumRequires a substantial but not unusual amount of effort to implementnetboxstatus: acceptedThis issue has been accepted for implementationstatus: backlogAwaiting selection for worktype: featureIntroduction of new functionality to the application

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions