feat(network-map): refine stale node representation with updated dimensions and positioning for improved clarity
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m15s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m15s
This commit is contained in:
@@ -677,12 +677,14 @@ export default function NetworkMapUnifi({
|
|||||||
const isStale = e.stale === true;
|
const isStale = e.stale === true;
|
||||||
const staleColor = UNIFI_WARNING;
|
const staleColor = UNIFI_WARNING;
|
||||||
const textWidth = labelText.length * (compactOnly ? 5.9 : 6.2);
|
const textWidth = labelText.length * (compactOnly ? 5.9 : 6.2);
|
||||||
const iconWidth = isStale ? 14 : 0;
|
const staleDotRadius = 4.2;
|
||||||
|
const staleDotSpace = isStale ? 18 : 0;
|
||||||
const minW = compactOnly ? 76 : LABEL_W;
|
const minW = compactOnly ? 76 : LABEL_W;
|
||||||
const maxW = compactOnly ? 160 : 210;
|
const maxW = compactOnly ? 160 : 210;
|
||||||
const w = Math.max(minW, Math.min(textWidth + pad * 2 + iconWidth, maxW));
|
const w = Math.max(minW, Math.min(textWidth + pad * 2 + staleDotSpace, maxW));
|
||||||
const h = LABEL_H;
|
const h = isStale ? LABEL_H + 2 : LABEL_H;
|
||||||
const textX = x - (iconWidth / 2);
|
const textAnchor = isStale ? 'start' : 'middle';
|
||||||
|
const textX = isStale ? (x - w / 2 + pad + staleDotSpace) : x;
|
||||||
return (
|
return (
|
||||||
<g>
|
<g>
|
||||||
<rect
|
<rect
|
||||||
@@ -698,9 +700,9 @@ export default function NetworkMapUnifi({
|
|||||||
/>
|
/>
|
||||||
{isStale && (
|
{isStale && (
|
||||||
<circle
|
<circle
|
||||||
cx={x - w / 2 + 10}
|
cx={x - w / 2 + pad + staleDotRadius}
|
||||||
cy={y}
|
cy={y}
|
||||||
r={4.4}
|
r={staleDotRadius}
|
||||||
fill={staleColor}
|
fill={staleColor}
|
||||||
opacity={0.95}
|
opacity={0.95}
|
||||||
/>
|
/>
|
||||||
@@ -708,7 +710,7 @@ export default function NetworkMapUnifi({
|
|||||||
<text
|
<text
|
||||||
x={textX}
|
x={textX}
|
||||||
y={y}
|
y={y}
|
||||||
textAnchor="middle"
|
textAnchor={textAnchor}
|
||||||
dominantBaseline="middle"
|
dominantBaseline="middle"
|
||||||
fill={isStale ? staleColor : edgeColor}
|
fill={isStale ? staleColor : edgeColor}
|
||||||
fontSize={compactOnly ? 10.2 : 11}
|
fontSize={compactOnly ? 10.2 : 11}
|
||||||
|
|||||||
Reference in New Issue
Block a user