diff --git a/index.php b/index.php index db31a36..5b141b7 100644 --- a/index.php +++ b/index.php @@ -1,51 +1,53 @@ + -Schémas des VLANs - + Schémas des VLANs + + -
-

Schémas des VLANs

-
- -
-
+ echo recursive_ls($basedir); + ?> + + - + + \ No newline at end of file diff --git a/show.php b/show.php index 81ea745..0f65c4f 100644 --- a/show.php +++ b/show.php @@ -1,39 +1,39 @@ \d+)$NLPattern"; - $vlanNamePattern = " name (?P.+)$NLPattern"; - $vlanDescriptionPattern = " description (?P.+)$NLPattern"; - $otherPattern = " .*$NLPattern"; - $endPattern = "(?\d+)\/0\/(?P\d+)$NLPattern"; - $portHybridPattern = " port hybrid (?:pvid )?vlan (?:(?P\d+)(?: [0-9a-z ]*)? tagged|(?P\d+)(?: \d+)* untagged)$NLPattern"; - $portAccessPattern = " port (?:access |trunk |hybrid |pvid |vlan )*(?P\d+)$NLPattern"; - $voiceVlanPattern = " voice-vlan (?P\d+) enable$NLPattern"; - preg_match_all("/$startPattern$interfaceAddressPattern(?:$portHybridPattern|$portAccessPattern|$voiceVlanPattern|$otherPattern)*$endPattern/", $conf, $interfaces, PREG_SET_ORDER); - $stack = array(); - foreach ($interfaces as $interface) { - if (!isset($stack[$interface["member"]])) $stack[$interface["member"]] = [[], []]; - $interface["style"] = ""; - if (!empty($interface["pvid"])) $interface["style"] .= "--pvid: {$interface["pvid"]}; "; - if (!empty($interface["tagged"])) $interface["style"] .= "--tagged: {$interface["tagged"]}; "; - if (!empty($interface["untagged"])) $interface["style"] .= "--untagged: {$interface["untagged"]}; "; - $stack[$interface["member"]][1 - $interface["port"] % 2][$interface["port"]] = $interface; - } +preg_match("/ sysname ([\w-]+)/", $conf, $sysname); +preg_match("/ip address ([\d.]+)/", $conf, $address); +$startPattern = "(?<=\n)"; +$NLPattern = "[\r\n]+"; +$vlanPvidPattern = "vlan (?P\d+)$NLPattern"; +$vlanNamePattern = " name (?P.+)$NLPattern"; +$vlanDescriptionPattern = " description (?P.+)$NLPattern"; +$otherPattern = " .*$NLPattern"; +$endPattern = "(?\d+)\/0\/(?P\d+)$NLPattern"; +$portHybridPattern = " port hybrid (?:pvid )?vlan (?:(?P\d+)(?: [0-9a-z ]*)? tagged|(?P\d+)(?: \d+)* untagged)$NLPattern"; +$portAccessPattern = " port (?:access |trunk |hybrid |pvid |vlan )*(?P\d+)$NLPattern"; +$voiceVlanPattern = " voice-vlan (?P\d+) enable$NLPattern"; +preg_match_all("/$startPattern$interfaceAddressPattern(?:$portHybridPattern|$portAccessPattern|$voiceVlanPattern|$otherPattern)*$endPattern/", $conf, $interfaces, PREG_SET_ORDER); +$stack = array(); +foreach ($interfaces as $interface) { + if (!isset($stack[$interface["member"]])) $stack[$interface["member"]] = [[], []]; + $interface["style"] = ""; + if (!empty($interface["pvid"])) $interface["style"] .= "--pvid: {$interface["pvid"]}; "; + if (!empty($interface["tagged"])) $interface["style"] .= "--tagged: {$interface["tagged"]}; "; + if (!empty($interface["untagged"])) $interface["style"] .= "--untagged: {$interface["untagged"]}; "; + $stack[$interface["member"]][1 - $interface["port"] % 2][$interface["port"]] = $interface; +} - /*echo ("");*/ ?> @@ -46,83 +46,81 @@ -
-
-

-
- -

-
+
+

+
+ +

+
-
-
-

Interfaces

+
+
+

Interfaces

+ $lines) { + echo "
\n$member_id\n\n\n"; + foreach ($lines as $interfaces) { + echo "\n"; + foreach ($interfaces as $interface) { + echo "\n"; + }; + echo "\n"; + } + echo "\n\n
{$interface["port"]}
\n
\n"; + } + ?> +
+ + + + + + + + + + $lines) { - echo "
\n$member_id\n
+

Légende

+
PVIDNomDescription
\n\n"; - foreach ($lines as $interfaces) { - echo "\n"; - foreach ($interfaces as $interface) { - echo "\n"; - }; - echo "\n"; + foreach ($vlans as $vlan) { + if (isset($vlan["pvid"]) and $vlan["pvid"] != 1) { + $name = $vlan["name"] ?? ""; + $description = $vlan["description"] ?? ""; + echo ""; } - echo "\n\n
{$interface["port"]}
{$vlan["pvid"]}$name$description
\n
\n"; } ?> -
- - - - - - - - - - - "; - } - } - ?> - - - - - - - - - - - - - - - - - - - - - -
-

Légende

-
PVIDNomDescription
{$vlan["pvid"]}$name$description
Trunk
Hybride (tagged/untagged)
Power on Ethernet
ToIP (voice-vlan)
Interface désactivée
- - - + + + Trunk + + + + Hybride (tagged/untagged) + + + + Power on Ethernet + + + + ToIP (voice-vlan) + + + + Interface désactivée + + + + + \ No newline at end of file diff --git a/style.css b/style.css index 49970c6..9b62e06 100644 --- a/style.css +++ b/style.css @@ -1,5 +1,5 @@ :root { - --hue: 15; + --hue: 58.3; --saturation: 80%; --lightness: 65%; } @@ -8,21 +8,19 @@ margin: 0; padding: 0; box-sizing: border-box; + overflow: visible !important; } body { + max-width: 1200px; + margin: 2rem auto; + padding: 0 1rem; font-family: Arial, sans-serif; line-height: 1.6; background-color: #f5f5f5; color: #333; } -.container { - max-width: 1200px; - margin: 2rem auto; - padding: 0 1rem; -} - h1 { color: #2c3e50; margin-bottom: 1rem; @@ -97,8 +95,11 @@ h2 { main { display: flex; flex-flow: wrap; - gap: 1rem; + align-items: center; + justify-content: space-between; + row-gap: 1rem; margin-bottom: 2rem; + width: 100%; } ul { @@ -109,10 +110,6 @@ details { cursor: pointer; } -main > table { - margin: auto; -} - td { text-align: left; } @@ -151,7 +148,6 @@ td { vertical-align: middle; min-width: 2em; height: 2em; - mix-blend-mode: darken; cursor: help; transition: 0.2s background-color; border: 2px inset #476079; @@ -223,7 +219,6 @@ td { .poe::before { content: "⚡"; - font-size: 0.7em; position: absolute; top: -0.5em; right: -0.5em; @@ -231,10 +226,9 @@ td { .voice_vlan::after { content: "📞"; - font-size: 0.7em; position: absolute; - bottom: -0.5em; - left: -0.5em; + bottom: -0.4em; + left: -0.3em; } .legend { @@ -256,10 +250,6 @@ footer { } @media print { - * { - overflow: visible !important; - } - .no-print { display: none; }