Rack: front and rear mounting, rack settings on the page #25

Merged
jared merged 1 commits from rack-rear-and-settings into main 2026-11-10 22:52:15 -05:00
Owner

Why

The current rack is a 4-post open frame. The RPDU and the shelf holding micro1 and monitor-02 are mounted from the rear, so a front-only drawing misplaced them and flagged false overlaps. The rack is also 25U, and the only way to set that was a config.json edit on the server.

What changes

Mounted: front / rear / full depth is a new field on cutsheet items.

  • On a 4-post rack, a front item and a rear item can share a unit. A full-depth item, such as a server, takes the unit on both sides.
  • Overlaps are now checked per side.
  • Items on a shelf inherit the shelf's side.
  • The rack page gets a Front / Rear switch (?face=rear). The rear view draws rear-mounted gear normally and shows full-depth gear as a hatched "back of …" plate. The Rear button shows how many items are mounted on that side.

Racks are edited in Gandalf and stored in a new cutsheet_racks table. Admins use Rack settings to set name, height and notes, and + Rack to add one; delete works once a rack is empty.

  • Renaming a rack moves its items with it.
  • The first save replaces the config default ("Rack 1") and carries its items over.
  • Rack names are unique regardless of case.
  • Config racks and rack remain the fallback until a rack is saved.

Faceplate stretch. A faceplate fills the full 19" width only when its drawing is within 15% of the slot's proportions. The PDU Pro drawing is about twice as tall as a real 1U, so it keeps its shape instead of being squashed.

Schema. The mount column and the cutsheet_racks table are created on first use.

After deploy

  1. On /rack, click Rack settings and set StarTech 25U, 25U.
  2. On the cutsheet, set Mounted: Rear on the RPDU's item and on the shelf micro1 and monitor-02 sit on.
  3. Set Full depth on any servers.

Testing

  • Automated: 364 tests pass (9 new):
    • shared units across sides
    • full depth blocking both sides, reported on both faces
    • mount validation, with shelf contents inheriting the shelf's side
    • rack validation
    • the rear API and the face check
    • saved racks replacing config
    • first-save carry-over, which is ignored for later racks
    • admin and validation checks on the rack endpoints
  • Local MariaDB:
    • migration
    • first save carrying an item from "Rack 1" over to "StarTech 25U"
    • case-insensitive duplicate refused
    • delete refused while the rack holds items
    • rename moving the items
  • Playwright (light, dark, 390 px):
    • the front/rear switch updates the URL and title
    • a hatched "back of" plate appears for the full-depth Rosewill
    • the RPDU shares U24 with the UDM
    • saving rack settings round-trips
    • no JS errors
  • flake8 and bandit are clean, and ESLint reports 0 errors.

Screenshots are in the comments.

🤖 Generated with Claude Code

## Why The current rack is a 4-post open frame. The RPDU and the shelf holding micro1 and monitor-02 are mounted from the rear, so a front-only drawing misplaced them and flagged false overlaps. The rack is also 25U, and the only way to set that was a `config.json` edit on the server. ## What changes **Mounted: front / rear / full depth** is a new field on cutsheet items. - On a 4-post rack, a front item and a rear item can share a unit. A full-depth item, such as a server, takes the unit on both sides. - Overlaps are now checked per side. - Items on a shelf inherit the shelf's side. - The rack page gets a **Front / Rear** switch (`?face=rear`). The rear view draws rear-mounted gear normally and shows full-depth gear as a hatched "back of …" plate. The Rear button shows how many items are mounted on that side. **Racks are edited in Gandalf** and stored in a new `cutsheet_racks` table. Admins use **Rack settings** to set name, height and notes, and **+ Rack** to add one; delete works once a rack is empty. - Renaming a rack moves its items with it. - The first save replaces the config default ("Rack 1") and carries its items over. - Rack names are unique regardless of case. - Config `racks` and `rack` remain the fallback until a rack is saved. **Faceplate stretch.** A faceplate fills the full 19" width only when its drawing is within 15% of the slot's proportions. The PDU Pro drawing is about twice as tall as a real 1U, so it keeps its shape instead of being squashed. **Schema.** The `mount` column and the `cutsheet_racks` table are created on first use. ## After deploy 1. On /rack, click **Rack settings** and set **StarTech 25U**, 25U. 2. On the cutsheet, set **Mounted: Rear** on the RPDU's item and on the shelf micro1 and monitor-02 sit on. 3. Set **Full depth** on any servers. ## Testing - **Automated:** 364 tests pass (9 new): - shared units across sides - full depth blocking both sides, reported on both faces - mount validation, with shelf contents inheriting the shelf's side - rack validation - the rear API and the `face` check - saved racks replacing config - first-save carry-over, which is ignored for later racks - admin and validation checks on the rack endpoints - **Local MariaDB:** - migration - first save carrying an item from "Rack 1" over to "StarTech 25U" - case-insensitive duplicate refused - delete refused while the rack holds items - rename moving the items - **Playwright** (light, dark, 390 px): - the front/rear switch updates the URL and title - a hatched "back of" plate appears for the full-depth Rosewill - the RPDU shares U24 with the UDM - saving rack settings round-trips - no JS errors - flake8 and bandit are clean, and ESLint reports 0 errors. Screenshots are in the comments. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jared added 1 commit 2026-11-10 22:35:58 -05:00
Rack: front and rear mounting, rack settings in the page
Lint / JS (eslint) (push) Successful in 7s
Lint / Python (flake8) (push) Successful in 49s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 51s
Lint / Python (flake8) (pull_request) Successful in 55s
Test / Python Tests (pytest) (push) Successful in 1m4s
Lint / JS (eslint) (pull_request) Successful in 7s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 52s
Test / Python Tests (pytest) (pull_request) Successful in 55s
c50e1f8322
Items are mounted from the front, the rear, or full depth. On a 4-post
rack a front and a rear item can share a unit; a full-depth one takes
both sides, and the rear view shows its back. Overlaps are checked per
side. Shelf contents take the shelf's side. A Front / Rear switch flips
the drawing.

Racks are saved in Gandalf (new cutsheet_racks table) and edited on the
rack page by admins: name, height, notes, add and delete. Renaming moves
the rack's items; saving the first rack carries over the items of the
config default it replaces. Config racks remain the fallback.

Faceplates are stretched to the full width only when the drawing is
close to the slot's proportions, so the PDU is not squashed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Screenshots (local preview, set up like the StarTech 25U)

Front. The Rosewill (large1) is full depth, so it shows on both faces. The Rear button says 3 items are mounted on that side.

Front

Rear. The RPDU sits at U24, behind the UDM. The shelf at U18 holds micro1 and monitor-02, and the Rosewill shows its back. Front-only units appear as free space.

Rear

Rear, dark mode.

Rear dark

Rack settings.

Settings

## Screenshots (local preview, set up like the StarTech 25U) **Front.** The Rosewill (large1) is full depth, so it shows on both faces. The Rear button says 3 items are mounted on that side. ![Front](https://code.lotusguild.org/LotusGuild/gandalf/raw/branch/pr-25-screenshots/1-front.png) **Rear.** The RPDU sits at U24, behind the UDM. The shelf at U18 holds micro1 and monitor-02, and the Rosewill shows its back. Front-only units appear as free space. ![Rear](https://code.lotusguild.org/LotusGuild/gandalf/raw/branch/pr-25-screenshots/2-rear.png) **Rear, dark mode.** ![Rear dark](https://code.lotusguild.org/LotusGuild/gandalf/raw/branch/pr-25-screenshots/3-rear-dark.png) **Rack settings.** ![Settings](https://code.lotusguild.org/LotusGuild/gandalf/raw/branch/pr-25-screenshots/4-settings.png)
jared merged commit bee260f1cd into main 2026-11-10 22:52:15 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/gandalf#25