Closed deku-m closed 1 year ago
Hi, yeah i have to rework the port "preparation" part.
I have seen you use regex to match the interface name.
You could use this one: ^(?P<type>([a-zA-Z\-_]*))(\/|(?P<dev>[0-9]+).|\s)?((?P<module>[0-9]+).|\s)?((?P<port>[0-9]+))$
1.1
eth0.10
eno3p0
lan 1
/
after type group e.g. x-sfp/1
Examples: https://regex101.com/r/XM47Bk/3
Maybe you could get the Interface type via interface.type field which is a required field of the interface NetBox object.
Nice project so far!
can you try with v0.1.3 again @deku-m ?
Hi @peterbaumert,
Tried with (SC-Panel) but for me its not working yet maybe i am doing something wrong?.
/* Ports are named "SC 1", "SC 2" | "Rear Port 1", "Rear Port 2" and so on */ .deviceview.area.dFront { /* both set to auto to overwrite the 32 columns 2 rows design */ grid-auto-rows: auto; grid-auto-columns: auto; grid-template-areas: "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24" }
.deviceview.area.dRear { /* both set to auto to overwrite the 32 columns 2 rows design */ grid-auto-rows: auto; grid-auto-columns: auto; grid-template-areas: "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24" }
Using device-type: https://github.com/netbox-community/devicetype-library/blob/master/device-types/Generic/SC-24-port-fiber-patch-panel.yaml
Will have a look and get back to you
Seems like css grids dont like numeric only names :D
Can you try with v0.1.4 and
/* Ports are named "1", "2" and so on for front and rear */
.deviceview.area.dFront {
/* both set to auto to overwrite the 32 columns 2 rows design */
grid-auto-rows: auto;
grid-auto-columns: auto;
grid-template-areas: "p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24";
}
.deviceview.area.dRear {
/* both set to auto to overwrite the 32 columns 2 rows design */
grid-auto-rows: auto;
grid-auto-columns: auto;
grid-template-areas: "p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24";
}
Seems like css grids dont like numeric only names :D
Can you try with v0.1.4 and
/* Ports are named "1", "2" and so on for front and rear */ .deviceview.area.dFront { /* both set to auto to overwrite the 32 columns 2 rows design */ grid-auto-rows: auto; grid-auto-columns: auto; grid-template-areas: "p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24"; } .deviceview.area.dRear { /* both set to auto to overwrite the 32 columns 2 rows design */ grid-auto-rows: auto; grid-auto-columns: auto; grid-template-areas: "p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24"; }
This works !
THere are devices that use only numbers as Ports like in the device-library from netbox > sc-panels. But there are also people that configure there ports like with floornumbers. 1001 1020 etc where 1xxx is the floor number. So they dont use any Port in front of it.
And there are also sub ports on some devices like 1.1 or 1.2.