diff --git a/nix/pkgs/switch-report.nix b/nix/pkgs/switch-report.nix
index bc1ccf5..98552ee 100644
--- a/nix/pkgs/switch-report.nix
+++ b/nix/pkgs/switch-report.nix
@@ -12,13 +12,15 @@ let
then
# group ports
linksByPorts // {
- ${lib.concatStringsSep "
" links.${linkName}.ports} = linkName;
+ ${lib.concatMapStringsSep "
" (port:
+ "`${port}`"
+ ) links.${linkName}.ports} = linkName;
}
else
# expand lists of access ports to seperate rows
builtins.foldl' (linksByPorts': port:
linksByPorts' // {
- ${port} = linkName;
+ "`${port}`" = linkName;
}
) linksByPorts links.${linkName}.ports
) {} (builtins.attrNames links);
@@ -28,8 +30,8 @@ let
`${model}` @ **${location}**
- |Name|Ports|Trunk|Networks|
- |-:|-:|:-:|:-|
+ |Ports|Target|Networks|
+ |-:|:-:|:-|
${lib.concatMapStrings (ports:
let
linkName = linksByPorts.${ports};
@@ -37,17 +39,19 @@ let
in ''
|${
lib.optionalString (link.group != null)
- "Group ${toString link.group}: "
- }**${
+ "**Group ${toString link.group}**
"
+ }${
+ ports
+ }|**${
linkName
}**|${
- ports
- }|${
- lib.optionalString link.trunk "✓"
- }|${
- lib.concatStringsSep "
" (
+ if link.trunk
+ then "**Trunk:** "
+ else "**Access:** "
+ }${
+ lib.concatStringsSep ", " (
map (net:
- "${net} (`${toString config.site.net.${net}.vlan}`)"
+ "${net} (`${toString config.site.net.${net}.vlan}`)"
) (builtins.sort (a: b:
let
vlanA = config.site.net.${a}.vlan;