Interface color

Started by straightup, January 01, 2024, 01:53:36 PM

Previous topic - Next topic
Hello,
I'm new to this forum and already read a lot, but did not find an answer on my actual question.
I want to change the color of the interfaces in the traffic graphs widget; like others before:

https://forum.opnsense.org/index.php?topic=32307.msg156131#msg156131
https://forum.opnsense.org/index.php?topic=6845.msg29747#msg29747

unfortunately these threads were not answered.
I found the code where I can change the color (/usr/local/www/widgets/widgets/traffic_graphs.widget.php) and I already did, but this "patch" is not update resistant. I see in the code, that the interfaces have a color stored in a database. But I did not get what database it is. Excuse my lack of knowledge but I'm not a programmer and I mostly struggle on these jumps into other code (require etc).
So perhaps here is someone who has the knowledge and is willing to help me and as the links above shows also others who want to customize these graphs.

So the question is which database is used to get the interfaces color in the traffic graph widget and how can this be changed? Thanks a lot.

Same here, I would love to be able to give each interface a specific color, as I'm using RJ45 with each its own color
WAN0 = black
LAN1 = Green
LAN2 = Blue
LAN3 = White

How do I access  /usr/local/www/widgets/widgets/traffic_graphs.widget.php from the GUI ? (or do I have to access the disk from SSH ?

And did you get an answer about how to make it permanent ?
Hunsn RS39 (N5105, 4x i225) 24.7.5_0 testing
LAN1 = swtch1 Laptop1 MX23, NAS, Laptop2 Win10
LAN2 = WiFi router AP, Laptop2, tablet, phone, printer, IoT, etc.
LAN3 = Swtch2 Laptop3 Suse; Laptop4 Qube-OS/Win10, printer
Pretending to be tech Savvy with a HomeLab :-p

Quote from: MarieSophieSG on October 03, 2024, 12:31:22 AM
How do I access  /usr/local/www/widgets/widgets/traffic_graphs.widget.php from the GUI ? (or do I have to access the disk from SSH ?

And did you get an answer about how to make it permanent ?
SSH only. OPN UI does not include a "file browser".
All changes to these internals do not survive upgrades because you are chaning version-controlled files that are part of the system. The only ones and methods to change are with hooks, and are documented in the docs.

Yes, TY, I did :)
But now I'm facing another problem, the traffic_graphs.widget.php is no longer in the www/widgets/widgets/
And couldn't find on Github where nor when it was moved

Or maybe it is just me not having it there ?
Hunsn RS39 (N5105, 4x i225) 24.7.5_0 testing
LAN1 = swtch1 Laptop1 MX23, NAS, Laptop2 Win10
LAN2 = WiFi router AP, Laptop2, tablet, phone, printer, IoT, etc.
LAN3 = Swtch2 Laptop3 Suse; Laptop4 Qube-OS/Win10, printer
Pretending to be tech Savvy with a HomeLab :-p

Try the files in https://github.com/opnsense/core/tree/master/src/opnsense/www/js/widgets

That corresponds to /usr/local/opnsense/www/js/widgets on your installed system.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: Patrick M. Hausen on October 03, 2024, 05:20:38 PM
Try the files in https://github.com/opnsense/core/tree/master/src/opnsense/www/js/widgets

That corresponds to /usr/local/opnsense/www/js/widgets on your installed system.

Thank you !
You sure know your way around :-p that's pretty impressive ..

Meanwhile, I have been opening each file that looks more or less like an interface config, but to date, I haven't found any addressing the colour subject, except a "avoid white = 1" in interfaces.php

I will keep looking but in GitHub this time rather than through Putty, much easier :)
Hunsn RS39 (N5105, 4x i225) 24.7.5_0 testing
LAN1 = swtch1 Laptop1 MX23, NAS, Laptop2 Win10
LAN2 = WiFi router AP, Laptop2, tablet, phone, printer, IoT, etc.
LAN3 = Swtch2 Laptop3 Suse; Laptop4 Qube-OS/Win10, printer
Pretending to be tech Savvy with a HomeLab :-p