Suppressing port status in LuCI Overview > Status

I realize I'm in a minority group running an lacp bonded interface. I have my br-lan interface set up with two ports: bond-lacp and eth0. bond-lacp is configured to have two slaves: eth1 and eth2.

On the overview page with port statuses, I've modified /etc/board.json to have the lan ports set to bond-lacp and eth0, and wan device to be eth3:

cat /etc/board.json
{
	"model": {
		"id": "pc-engines-apu2",
		"name": "PC Engines apu2"
	},
...
	"network": {
		"lan": {
			"ports": [
				"eth0",
				"eth1",
				"eth2",
				"bond-lacp"
			],
			"protocol": "static"
		},
		"wan": {
			"device": "eth3",
			"protocol": "dhcp"
		}
	}
}

The issue I want to see if I can address is: can I suppress the eth1 and eth2 ports on the status page, when they're otherwise being called along with all others in /www/luci-static/resources/view/status/include/29_ports.js via callGetBuiltinEthernetPorts?

You can just remove eth1 and eth2 from the lan port list in board.json.
They will still work.
I checked this myself on my FB7530.

Now i'm looking for a way to 'rename' the wan interface, i want it to show 'wan' instead of 'lan4' in the port status.
But i guess i should open a new thread for this..

So I removed the ports from board.json, but they still show because the status page is pulling from other sources, in addition to board.json:

root@Nemo-Gateway:~# cat /etc/board.json
{
        "model": {
                "id": "pc-engines-apu2",
                "name": "PC Engines apu2"
        },
        "led": {
                "wan": {
                        "name": "WAN",
                        "sysfs": "apu:green:3",
                        "type": "netdev",
                        "device": "eth0",
                        "mode": "link tx rx"
                },
                "lan": {
                        "name": "LAN",
                        "sysfs": "apu:green:2",
                        "type": "netdev",
                        "device": "br-lan",
                        "mode": "link tx rx"
                },
                "diag": {
                        "name": "DIAG",
                        "sysfs": "apu:green:1",
                        "default": "1"
                }
        },
        "network": {
                "lan": {
                        "ports": [
                                "eth0",
                                "bond-LACP"
                        ],
                        "protocol": "static"
                },
                "wan": {
                        "device": "eth3",
                        "protocol": "dhcp"
                }
        }
}

turned to chatgpt to parse the javascript, because I do not know js. Deleting the lines with callGetBuiltinEthernetPorts breaks things. But modifying it's output works.

so

...
return Promise.all([
	L.resolveDefault(callGetBuiltinEthernetPorts(), []),
	L.resolveDefault(fs.read('/etc/board.json'), '{}'),
	firewall.getZones(),
	network.getNetworks(),
	uci.load('network')
]);

becomes

...
return Promise.all([
	L.resolveDefault(callGetBuiltinEthernetPorts(), []).then(ports => {
		// Filter out specific ports, e.g., "eth0", "eth1"
		const excludedPorts = ['eth0', 'eth1'];
		return ports.filter(port => !excludedPorts.includes(port.device));
	}),
	L.resolveDefault(fs.read('/etc/board.json'), '{}'),
	firewall.getZones(),
	network.getNetworks(),
	uci.load('network')
]);

and after modifying the filtered ports to be my specific eth1 and eth2, the status page shows only the interfaces I want:

They aren't centered, or spaced the same as when all the ports are shown, but I can probably figure out how to change the spacing between.

1 Like

That's interesting. This didn't happen on my FB7530. Maybe it depends on how the ports are shown to the system?

The same is true over here. It looks a bit...unusual.

If you find a solution, i'd be interested.
I still haven't found a way to 'rename' lan4 to wan...but of course that's just a cosmetical thing.

My board is 4 individual ethernet phy devices. The fritzbox you mentioned I think has a 4 port switch. I'm thinking that makes a difference maybe?

Well, i think so, too.
I just can't confirm it because all i have access to are various cheap routers, who all show the same effect.