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