change hybrid colors
This commit is contained in:
parent
267303d4ce
commit
f1dad26944
9
show.php
9
show.php
@ -29,7 +29,7 @@ $otherPattern = " .*$NL";
|
|||||||
$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+)$NL";
|
$interfaceAddressPattern = "interface [\w-]+(?P<member>\d+)\/0\/(?P<port>\d+)$NL";
|
||||||
$pvidPattern = " port (?:access|trunk pvid) vlan (?P<pvid>\d+)$NL";
|
$pvidPattern = " port (?:access|trunk pvid|hybrid pvid) vlan (?P<pvid>\d+)$NL";
|
||||||
$portHybridPattern = " port hybrid (?:pvid )?vlan (?:(?P<tagged>\d+)(?: [0-9a-z ]*)? tagged|(?P<untagged>\d+)(?: \d+)* untagged)$NL";
|
$portHybridPattern = " port hybrid (?:pvid )?vlan (?:(?P<tagged>\d+)(?: [0-9a-z ]*)? tagged|(?P<untagged>\d+)(?: \d+)* untagged)$NL";
|
||||||
$voiceVlanPattern = " voice-vlan (?P<voice_vlan>\d+) enable$NL";
|
$voiceVlanPattern = " voice-vlan (?P<voice_vlan>\d+) enable$NL";
|
||||||
preg_match_all("/$startPattern$interfaceAddressPattern(?:$pvidPattern|$portHybridPattern|$voiceVlanPattern|$otherPattern)*$endPattern/", $conf, $interfaces, PREG_SET_ORDER);
|
preg_match_all("/$startPattern$interfaceAddressPattern(?:$pvidPattern|$portHybridPattern|$voiceVlanPattern|$otherPattern)*$endPattern/", $conf, $interfaces, PREG_SET_ORDER);
|
||||||
@ -137,10 +137,13 @@ foreach ($interfaces as $interface) {
|
|||||||
for (let i = 0; i < customColors.sheet.cssRules.length; i++) {
|
for (let i = 0; i < customColors.sheet.cssRules.length; i++) {
|
||||||
if (customColors.sheet.cssRules[i].selectorText == `[style*="--pvid: ${pvid}"]`) {
|
if (customColors.sheet.cssRules[i].selectorText == `[style*="--pvid: ${pvid}"]`) {
|
||||||
customColors.sheet.deleteRule(i)
|
customColors.sheet.deleteRule(i)
|
||||||
break
|
}
|
||||||
|
if (customColors.sheet.cssRules[i].selectorText == `[style*="--tagged: ${pvid}"]`) {
|
||||||
|
customColors.sheet.deleteRule(i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
customColors.sheet.insertRule(`[style*="--pvid: ${pvid}"] { background-color: ${color} }`)
|
customColors.sheet.insertRule(`[style*="--pvid: ${pvid}"] { --pvid-color: ${color} }`)
|
||||||
|
customColors.sheet.insertRule(`[style*="--tagged: ${pvid}"] { --tagged-color: ${color} }`)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
12
style.css
12
style.css
@ -163,11 +163,10 @@ main {
|
|||||||
|
|
||||||
.vlan {
|
.vlan {
|
||||||
--pvid: 0;
|
--pvid: 0;
|
||||||
|
--pvid-color: hsl(calc(var(--hue) * var(--pvid)) var(--saturation) var(--lightness));
|
||||||
color: #ecf0f1;
|
color: #ecf0f1;
|
||||||
text-shadow: 1px 2px 2px black;
|
text-shadow: 1px 2px 2px black;
|
||||||
background-color: hsl(
|
background-color: var(--pvid-color);
|
||||||
calc(var(--hue) * var(--pvid)) var(--saturation) var(--lightness)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.vlan:hover {
|
.vlan:hover {
|
||||||
@ -190,11 +189,8 @@ main {
|
|||||||
|
|
||||||
.hybrid {
|
.hybrid {
|
||||||
--tagged: 0;
|
--tagged: 0;
|
||||||
background-image: linear-gradient(
|
--tagged-color: hsl(calc(var(--hue) * var(--tagged)) var(--saturation) var(--lightness));
|
||||||
145deg,
|
background-image: linear-gradient(145deg, transparent 50%, var(--tagged-color) 50%);
|
||||||
transparent 50%,
|
|
||||||
hsl(calc(var(--hue) * var(--tagged)) var(--saturation) var(--lightness)) 50%
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.shutdown:not([class*="loopback-detection action shutdown"]) {
|
.shutdown:not([class*="loopback-detection action shutdown"]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user