Compare commits
2 Commits
8dbc082b37
...
b54b4f6bfc
Author | SHA1 | Date | |
---|---|---|---|
b54b4f6bfc | |||
832a0c1232 |
14
show.php
14
show.php
@ -19,10 +19,11 @@ $otherPattern = " .*$NLP";
|
|||||||
$endPattern = "(?<!#)";
|
$endPattern = "(?<!#)";
|
||||||
preg_match_all("/$startPattern$vlanPvidPattern(?:$vlanNamePattern|$vlanDescriptionPattern|$otherPattern)*$endPattern/", $conf, $vlans, PREG_SET_ORDER);
|
preg_match_all("/$startPattern$vlanPvidPattern(?:$vlanNamePattern|$vlanDescriptionPattern|$otherPattern)*$endPattern/", $conf, $vlans, PREG_SET_ORDER);
|
||||||
$interfaceAddressPattern = "interface [\w-]+(?P<member>\d+)\/0\/(?P<port>\d+)$NLP";
|
$interfaceAddressPattern = "interface [\w-]+(?P<member>\d+)\/0\/(?P<port>\d+)$NLP";
|
||||||
$portHybridPattern = " port hybrid (?:pvid )?vlan (?:(?P<tagged>\d+)(?: [0-9a-z ]*)? tagged|(?P<untagged>\d+)(?: \d+)* untagged)$NLP";
|
|
||||||
$portAccessPattern = " port (?:access |trunk |hybrid |pvid |vlan )*(?P<pvid>\d+)$NLP";
|
$portAccessPattern = " port (?:access |trunk |hybrid |pvid |vlan )*(?P<pvid>\d+)$NLP";
|
||||||
|
$portHybridPattern = " port hybrid (?:pvid )?vlan (?:(?P<tagged>\d+)(?: [0-9a-z ]*)? tagged|(?P<untagged>\d+)(?: \d+)* untagged)$NLP";
|
||||||
$voiceVlanPattern = " voice-vlan (?P<voice_vlan>\d+) enable$NLP";
|
$voiceVlanPattern = " voice-vlan (?P<voice_vlan>\d+) enable$NLP";
|
||||||
preg_match_all("/$startPattern$interfaceAddressPattern(?:$portHybridPattern|$portAccessPattern|$voiceVlanPattern|$otherPattern)*$endPattern/", $conf, $interfaces, PREG_SET_ORDER);
|
preg_match_all("/$startPattern$interfaceAddressPattern(?:$portAccessPattern|$portHybridPattern|$voiceVlanPattern|$otherPattern)*$endPattern/", $conf, $interfaces, PREG_SET_ORDER);
|
||||||
|
|
||||||
$stack = array();
|
$stack = array();
|
||||||
foreach ($interfaces as $interface) {
|
foreach ($interfaces as $interface) {
|
||||||
if (!isset($stack[$interface["member"]])) $stack[$interface["member"]] = [[], []];
|
if (!isset($stack[$interface["member"]])) $stack[$interface["member"]] = [[], []];
|
||||||
@ -30,12 +31,13 @@ foreach ($interfaces as $interface) {
|
|||||||
if (!empty($interface["pvid"])) $interface["style"] .= "--pvid: {$interface["pvid"]}; ";
|
if (!empty($interface["pvid"])) $interface["style"] .= "--pvid: {$interface["pvid"]}; ";
|
||||||
if (!empty($interface["tagged"])) $interface["style"] .= "--tagged: {$interface["tagged"]}; ";
|
if (!empty($interface["tagged"])) $interface["style"] .= "--tagged: {$interface["tagged"]}; ";
|
||||||
if (!empty($interface["untagged"])) $interface["style"] .= "--untagged: {$interface["untagged"]}; ";
|
if (!empty($interface["untagged"])) $interface["style"] .= "--untagged: {$interface["untagged"]}; ";
|
||||||
|
if (!empty($interface["voice_vlan"])) $interface["style"] .= "--voice-vlan: {$interface["voice_vlan"]}; ";
|
||||||
$stack[$interface["member"]][1 - $interface["port"] % 2][$interface["port"]] = $interface;
|
$stack[$interface["member"]][1 - $interface["port"] % 2][$interface["port"]] = $interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*echo ("<!--");
|
/*echo ("<!--");
|
||||||
var_dump($stack);
|
var_dump($stack);
|
||||||
echo ("-->");*/
|
echo ("-->");*/
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html lang='fr'>
|
<html lang='fr'>
|
||||||
@ -96,10 +98,10 @@ foreach ($interfaces as $interface) {
|
|||||||
<td class='interface trunk'></td>
|
<td class='interface trunk'></td>
|
||||||
<td colspan='2'>Trunk</td>
|
<td colspan='2'>Trunk</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<!--<tr>
|
||||||
<td class='interface hybrid' style='--tagged:60; --untagged:0'></td>
|
<td class='interface hybrid' style='--tagged:60; --untagged:0'></td>
|
||||||
<td colspan='2'>Hybride (tagged/untagged)</td>
|
<td colspan='2'>Hybride (tagged/untagged)</td>
|
||||||
</tr>
|
</tr>-->
|
||||||
<tr>
|
<tr>
|
||||||
<td class='interface poe'></td>
|
<td class='interface poe'></td>
|
||||||
<td colspan='2'>Power on Ethernet</td>
|
<td colspan='2'>Power on Ethernet</td>
|
||||||
|
23
style.css
23
style.css
@ -112,7 +112,7 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.member-id {
|
.member-id {
|
||||||
background: #777;
|
background: #888;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
color: lightgreen;
|
color: lightgreen;
|
||||||
text-shadow: 0 1px 3px #fffb;
|
text-shadow: 0 1px 3px #fffb;
|
||||||
@ -169,6 +169,19 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trunk:not(.shutdown) {
|
.trunk:not(.shutdown) {
|
||||||
|
font-weight: bold;
|
||||||
|
background-image: linear-gradient(
|
||||||
|
127deg,
|
||||||
|
red,
|
||||||
|
orange,
|
||||||
|
yellow,
|
||||||
|
green,
|
||||||
|
blue,
|
||||||
|
violet
|
||||||
|
) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*.trunk:not(.shutdown) {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border: 4px solid;
|
border: 4px solid;
|
||||||
border-image-slice: 1 !important;
|
border-image-slice: 1 !important;
|
||||||
@ -181,9 +194,9 @@ main {
|
|||||||
blue,
|
blue,
|
||||||
violet
|
violet
|
||||||
) !important;
|
) !important;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
.hybrid {
|
/*.hybrid {
|
||||||
--tagged: 0;
|
--tagged: 0;
|
||||||
--untagged: var(--pvid);
|
--untagged: var(--pvid);
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
@ -195,7 +208,7 @@ main {
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-origin: border-box;
|
background-origin: border-box;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
.shutdown:not([class*="loopback-detection action shutdown"]) {
|
.shutdown:not([class*="loopback-detection action shutdown"]) {
|
||||||
background-color: lightgray;
|
background-color: lightgray;
|
||||||
@ -214,7 +227,7 @@ main {
|
|||||||
.voice_vlan::after {
|
.voice_vlan::after {
|
||||||
content: "📞";
|
content: "📞";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -0.5em;
|
bottom: -0.4em;
|
||||||
left: -0.4em;
|
left: -0.4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user