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

Closed
opened 2025-12-29 21:20:13 +01:00 by adam · 3 comments
Owner

Originally created by @PieterL75 on GitHub (May 10, 2024).

NetBox version

v4.0.1

Feature type

Change to existing functionality

Proposed functionality

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 (May 10, 2024). ### NetBox version v4.0.1 ### Feature type Change to existing functionality ### Proposed functionality 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 type: featurestatus: duplicate labels 2025-12-29 21:20:13 +01:00
adam closed this issue 2025-12-29 21:20:13 +01:00
Author
Owner

@Daniel-Dietz commented on GitHub (May 11, 2024):

Agree with Enabled not connected => danger

Would change:
disabled: gray
enabled: white

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

@Daniel-Dietz commented on GitHub (May 11, 2024): Agree with Enabled not connected => danger Would change: **disabled: gray enabled: white** virtual: blue enabled, marked_connected: green enabled, connected (cable status color) : green/blue/... enabled, no cable : red
Author
Owner

@jeremystretch commented on GitHub (May 28, 2024):

This seems to overlap substantially with #16039, and is likely addressed in part or in full by PR #16044. Please review that issue & PR and note any areas you believe remain unaddressed.

@jeremystretch commented on GitHub (May 28, 2024): This seems to overlap substantially with #16039, and is likely addressed in part or in full by PR #16044. Please review that issue & PR and note any areas you believe remain unaddressed.
Author
Owner

@PieterL75 commented on GitHub (May 28, 2024):

I don't see how this overlaps ?
#16039 is a bugreport, asking to return the color coding of a connected interface in the gui after the 4.0 GUI change.

This FR is a request to change the current colour coding behavior
My proposal is to change the color coding to:

disabled: white (no color, just the background of the table)
virtual: blue
enabled, marked_connected: green
enabled, connected (cable status color) : green/blue/...
enabled, no cable : red

@PieterL75 commented on GitHub (May 28, 2024): I don't see how this overlaps ? #16039 is a bugreport, asking to return the color coding of a connected interface in the gui after the 4.0 GUI change. This FR is a request to change the current colour coding behavior My proposal is to change the color coding to: disabled: **white** (no color, just the background of the table) virtual: blue enabled, marked_connected: green enabled, connected (cable status color) : green/blue/... enabled, no cable : **red**
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9644