Skip to content

Self-hosted homelab infrastructure visualizer — interactive network diagram with live status monitoring

feat(rack): add desktop NAS faceplates in 2, 4 and 5 bays

Pouzor7067bd76d45c
diff --git a/frontend/src/rack/__tests__/faceplates.test.ts b/frontend/src/rack/__tests__/faceplates.test.ts
index 73a6127..fc0ed1d 100644
--- a/frontend/src/rack/__tests__/faceplates.test.ts
+++ b/frontend/src/rack/__tests__/faceplates.test.ts
@@ -81,6 +81,25 @@ describe('faceplate catalog', () => {
}
})
+ it('keeps the desktop NAS boxes third-width and 3U, one bay column each', () => {
+ const expected: Record<string, number> = {
+ 'nas-desktop-2': 2,
+ 'nas-desktop-4': 4,
+ 'nas-desktop-5': 5,
+ }
+ for (const [id, bays] of Object.entries(expected)) {
+ const plate = getFaceplate(id)
+ // Shelf-mounted desktop gear, not rack gear: a third of the width, 3U tall.
+ expect(plate.colSpan).toBe(RACK_COLUMNS / 3)
+ expect(plate.uHeight).toBe(3)
+ const tray = plate.elements.find((e) => e.kind === 'bays')
+ expect(tray).toMatchObject({ cols: bays, rows: 1 })
+ expect(plate.ports.length).toBeGreaterThan(0)
+ // Trays own the upper half; the name band and the ports share the lower.
+ expect(tray!.kind === 'bays' && tray.y + tray.h).toBeLessThanOrEqual(0.5)
+ }
+ })
+
it('falls back to the first plate on an unknown id', () => {
expect(getFaceplate('does-not-exist')).toBe(FACEPLATES[0])
})
diff --git a/frontend/src/rack/faceplates.ts b/frontend/src/rack/faceplates.ts
index cca42d2..2a95dfb 100644
--- a/frontend/src/rack/faceplates.ts
+++ b/frontend/src/rack/faceplates.ts
@@ -300,6 +300,62 @@ export const FACEPLATES: FaceplateTemplate[] = [
...bank({ type: 'sfp+', count: 1, x: 0.93, w: 0.05, prefix: 'sfp' }),
],
},
+ // Desktop NAS boxes (UGREEN DXP, Synology DS…) sat on a rack shelf: not rack
+ // gear, so they take a third of the width and stand ~3U tall, with their
+ // drive trays side by side. Bays fill the upper half; the name band and the
+ // ports share the lower one, side by side, since the name is always drawn at
+ // mid-height whatever the U count.
+ {
+ id: 'nas-desktop-2',
+ label: 'Desktop NAS — 2 bays',
+ kind: 'device',
+ group: 'Storage',
+ uHeight: 3,
+ colSpan: RACK_COLUMNS / 3,
+ statusLed: true,
+ labelBox: { x: 0.12, w: 0.5 },
+ portSize: 'md',
+ elements: [
+ { kind: 'panel', fill: '#262c35', stroke: '#0d1117' },
+ { kind: 'bays', x: 0.14, y: 0.06, w: 0.72, h: 0.42, cols: 2, rows: 1, fill: BLACK_BOX },
+ ],
+ ports: bank({ type: 'rj45', count: 1, x: 0.68, w: 0.24, prefix: 'eth' }),
+ },
+ {
+ id: 'nas-desktop-4',
+ label: 'Desktop NAS — 4 bays',
+ kind: 'device',
+ group: 'Storage',
+ uHeight: 3,
+ colSpan: RACK_COLUMNS / 3,
+ statusLed: true,
+ labelBox: { x: 0.12, w: 0.5 },
+ portSize: 'md',
+ elements: [
+ { kind: 'panel', fill: '#262c35', stroke: '#0d1117' },
+ { kind: 'bays', x: 0.1, y: 0.06, w: 0.8, h: 0.42, cols: 4, rows: 1, fill: BLACK_BOX },
+ ],
+ ports: bank({ type: 'rj45', count: 2, x: 0.64, w: 0.3, prefix: 'eth' }),
+ },
+ {
+ id: 'nas-desktop-5',
+ label: 'Desktop NAS — 5 bays',
+ kind: 'device',
+ group: 'Storage',
+ uHeight: 3,
+ colSpan: RACK_COLUMNS / 3,
+ statusLed: true,
+ labelBox: { x: 0.12, w: 0.5 },
+ portSize: 'md',
+ elements: [
+ { kind: 'panel', fill: '#262c35', stroke: '#0d1117' },
+ { kind: 'bays', x: 0.08, y: 0.06, w: 0.84, h: 0.42, cols: 5, rows: 1, fill: BLACK_BOX },
+ ],
+ ports: [
+ ...bank({ type: 'rj45', count: 2, x: 0.64, w: 0.22, prefix: 'eth' }),
+ ...bank({ type: 'sfp+', count: 1, x: 0.88, w: 0.1, prefix: 'sfp' }),
+ ],
+ },
{
id: 'ups-2u',
label: 'UPS 2U',