Change color interface background (enabled/disabled/connected) #10118

Closed
opened 2025-12-29 21:27:06 +01:00 by adam · 4 comments
Owner

Originally created by @PieterL75 on GitHub (Aug 20, 2024).

Originally assigned to: @PieterL75 on GitHub.

NetBox version

v4.0.9

Feature type

Change to existing functionality

Proposed functionality

This is a revisit of #16075 , as it was closed.

This is revisit of #15379. There @jeremystretch mentioned that the coloring would go away in v4.0, but it seems they are still there, hence my resubmit of this FR

Can we have a poll with the community to see what they prefer ?

Currently the background color of an interface is like this :
disabled: red
virtual: blue
enabled, marked_connected: green
enabled, connected (cable status color) : green/blue/..
enabled, no cable : white

def get_cabletermination_row_class(record):
    if record.mark_connected:
        return 'success'
    elif record.cable:
        return record.cable.get_status_color()
    return ''

def get_interface_row_class(record):
    if not record.enabled:
        return 'danger'
    elif record.is_virtual:
        return 'primary'
    return get_cabletermination_row_class(record)

My proposal is to change the color coding to:

disabled: white
virtual: blue
enabled, marked_connected: green
enabled, connected (cable status color) : green/blue/...
enabled, no cable : red

def get_cabletermination_row_class(record):
    if record.mark_connected:
        return 'success'
    elif record.cable:
        return record.cable.get_status_color()
    return 'danger'


def get_interface_row_class(record):
    if not record.enabled:
        return ''
    elif record.is_virtual:
        return 'primary'
    return get_cabletermination_row_class(record)

Use case

The 'red' color is confusing, as it tells me something is 'wrong'. but having an interface in the disable state is not wrong.
image

With the proposed change, this view would become more logic (red = wrong state )
image

Having an 'enabled' interface, without a cable is 'danger'
A disabled interface is just good, that can be white.

Database changes

No response

External dependencies

No response

Originally created by @PieterL75 on GitHub (Aug 20, 2024). Originally assigned to: @PieterL75 on GitHub. ### NetBox version v4.0.9 ### Feature type Change to existing functionality ### Proposed functionality This is a revisit of #16075 , as it was closed. This is revisit of #15379. There @jeremystretch mentioned that the coloring would go away in v4.0, but it seems they are still there, hence my resubmit of this FR Can we have a poll with the community to see what they prefer ? Currently the background color of an interface is like this : disabled: red virtual: blue enabled, marked_connected: green enabled, connected (cable status color) : green/blue/.. enabled, no cable : white ``` def get_cabletermination_row_class(record): if record.mark_connected: return 'success' elif record.cable: return record.cable.get_status_color() return '' def get_interface_row_class(record): if not record.enabled: return 'danger' elif record.is_virtual: return 'primary' return get_cabletermination_row_class(record) ``` My proposal is to change the color coding to: disabled: white virtual: blue enabled, marked_connected: green enabled, connected (cable status color) : green/blue/... enabled, no cable : red ``` def get_cabletermination_row_class(record): if record.mark_connected: return 'success' elif record.cable: return record.cable.get_status_color() return 'danger' def get_interface_row_class(record): if not record.enabled: return '' elif record.is_virtual: return 'primary' return get_cabletermination_row_class(record) ``` ### Use case The 'red' color is confusing, as it tells me something is 'wrong'. but having an interface in the disable state is not wrong. ![image](https://github.com/netbox-community/netbox/assets/74899468/c1decadb-a5e4-44ca-b698-e983be08b45a) With the proposed change, this view would become more logic (red = wrong state ) ![image](https://github.com/netbox-community/netbox/assets/74899468/1acc0f4e-4133-4d95-9182-a0b81278ecaa) Having an 'enabled' interface, without a cable is 'danger' A disabled interface is just good, that can be white. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: featurenetboxcomplexity: low labels 2025-12-29 21:27:06 +01:00
adam closed this issue 2025-12-29 21:27:06 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 22, 2024):

IMO we should change the color for disabled interfaces from red to gray and leave the rest as-is.

@jeremystretch commented on GitHub (Oct 22, 2024): IMO we should change the color for disabled interfaces from red to gray and leave the rest as-is.
Author
Owner

@PieterL75 commented on GitHub (Oct 22, 2024):

Sounds like a fair compromise.
As long as the disabled interfaces are no longer red...

We're starting to implement automation, with the status being a real value. And that red is an eyesore.

@PieterL75 commented on GitHub (Oct 22, 2024): Sounds like a fair compromise. As long as the disabled interfaces are no longer red... We're starting to implement automation, with the status being a real value. And that red is an eyesore.
Author
Owner

@PieterL75 commented on GitHub (Dec 13, 2024):

I can create a PR for this
"change the color for disabled interfaces from red to gray"

@PieterL75 commented on GitHub (Dec 13, 2024): I can create a PR for this "change the color for disabled interfaces from red to gray"
Author
Owner

@PieterL75 commented on GitHub (Dec 13, 2024):

Branche https://github.com/PieterL75/netbox/tree/issue17215_changedisabledinterfacecolor

@PieterL75 commented on GitHub (Dec 13, 2024): Branche https://github.com/PieterL75/netbox/tree/issue17215_changedisabledinterfacecolor
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10118