diff --git a/static/rack.js b/static/rack.js index a0d5c31..0a966a2 100644 --- a/static/rack.js +++ b/static/rack.js @@ -61,7 +61,7 @@ function panelSvg(item) { const rowH = (H - 20) / rows; // Label characters that fit under one port at the label's font size (9px, ~5.6px a character) const fit = Math.max(3, Math.floor((pitch - 2) / 5.6)); - const short = t => (t.length > fit ? `${t.slice(0, fit - 1)}…` : t); + const short = (t, max = fit) => (t.length > max ? `${t.slice(0, max - 1)}…` : t); const ports = []; for (let n = 1; n <= count; n++) { const r = Math.floor((n - 1) / perRow), c = (n - 1) % perRow; @@ -81,7 +81,7 @@ function panelSvg(item) { return ` - ${esc(item.name)} + ${esc(item.name)}${esc(short(item.name, 48))} ${ports.join('')} `; } diff --git a/static/style.css b/static/style.css index 7507aee..2d77b6f 100644 --- a/static/style.css +++ b/static/style.css @@ -1464,7 +1464,8 @@ body.fp-marks-off .fp-svg .fp-mark { display: none; } .rack-kind-shelf .rack-plate { background: repeating-linear-gradient(90deg, var(--rk-plate-b) 0 10px, var(--rk-frame) 10px 20px); } .rack-pp-body { fill: #1d2229; stroke: #39424e; } -.rack-pp-name { fill: #9aa7b4; font-size: 15px; font-family: var(--font-mono, monospace); } +/* The panel's name sits in its top-left corner, above the port numbers, so a long name can't run under the ports */ +.rack-pp-name { fill: #9aa7b4; font-size: 12px; font-family: var(--font-mono, monospace); } .rack-pp-num { fill: #7d8a97; font-size: 10px; } .rack-pp-label { fill: #c9d3dc; font-size: 9px; } .rack-pp-jack { fill: #0c0f13; stroke: #4a5560; stroke-width: 1.5; }