Commit Graph

25 Commits (8371ffa1f59b1fc5e934a3661b9d09a52eac4cb5)

Author SHA1 Message Date
Joca 8371ffa1f5
Multi-U device rows get continuous background tint
Rack table rows now carry .device-row class for every unit a device
occupies (not just the start row), giving multi-U devices a continuous
surface-colored background block. A bottom border on the last unit-row
visually separates it from the next device.
2026-06-09 20:14:15 -03:00
Joca 0e97029c59
Click-to-connect mode for rapid cabling
Added Connect Mode toggle button on rack and device views. When active,
clicking a port selects it (glowing accent border), clicking a second
port opens a mini form to choose connection type/color/labels and
create the cable in one flow. Escape or re-clicking deselects. Port
elements now use onclick JS instead of HTMX triggers to support both
normal inspection mode and connect mode.
2026-06-09 20:13:47 -03:00
Joca 75255d5551
Friendly duplicate-name errors on create/edit
UNIQUE constraint violations from rack/device/model creation and editing
now show readable messages like 'A rack named X already exists, onii-chan'
instead of raw SQLite error strings or silent redirects.
2026-06-09 20:11:52 -03:00
Joca 56c525cb26
Power strip visual in rack view with outlet grid
Added is_power_strip flag to device_models (schema migration, model,
form checkbox, DB CRUD). Power strip devices in rack view now render
a grid of plug-icon outlets instead of the regular port list, with
custom cable colors showing which outlets are in use.
2026-06-09 20:10:42 -03:00
Joca a845b242a2
Add port renaming on existing devices
Device view now has a 'Rename Ports' section with inline inputs for
every port. Port names are no longer immutable after device creation.
Added PortUpdateName to DB layer and POST /devices/{id}/ports/rename.
2026-06-09 19:11:16 -03:00
Joca 7bcfa73c19
Show device model images + Back to Rack link
Device view now displays front/back model images above the port list.
Added a 'Back to Rack' breadcrumb link when the device is rack-mounted.
2026-06-09 19:11:10 -03:00
Joca 6a14af2227
Show port count in model list table 2026-06-09 19:11:04 -03:00
Joca a75b7267c5
Un-collapse connection form + add New Device to nav
The 'Create Connection' form now shows directly when clicking an
unconnected port instead of being hidden inside a <details> element
requiring two clicks. Added a 'New Device' nav link that jumps to
the create form on the overview page.
2026-06-09 19:10:59 -03:00
Joca c56c512764
Show connection creation errors in modal
When a connection create fails (e.g. port already in use), the error
message now appears as a red alert in the modal instead of silently
re-rendering the 'no connection' state. Added Error field to
ConnectionModalData and created renderConnectionModalError helper.
2026-06-09 19:10:45 -03:00
Joca 3434d02e78
Show device count on rack cards in overview
Each rack card now displays the number of devices inside (racked +
unplaced). Introduced a RackCard wrapper in the overview handler to
pair each rack with its precomputed count.
2026-06-09 18:57:38 -03:00
Joca 444441861b
Show error when model deletion fails
ModelDelete now checks the DB error (e.g. FK constraint from devices still
using the model) and renders the model list with an alert instead of
silently redirecting with no feedback.
2026-06-09 18:56:40 -03:00
Joca 2aeb66de33
Add rack height field to create form
The rack creation form now includes a Height (U) input defaulting to 42.
The handler reads it instead of hardcoding. Previously every rack was
silently locked at 42U until you went to the rack page to edit it.
2026-06-09 18:56:23 -03:00
Joca b9ebc1d141
Use cable color instead of hardcoded green for connected port badges
Port spans now pick up the connection's actual color for border and a
light tint for background via inline styles. The .connected CSS class
only ups the border width to 2px for emphasis. Applied to _port_list.html
shared partial and wall_sockets.html inline rendering.
2026-06-09 18:55:48 -03:00
Joca cada7ab6c2
Add empty-state messages to overview page
Grid sections for Racks and Devices now show a dashed 'No X yet' message
when the collection is empty, using Go template {{else}} blocks. CSS
styles the placeholder with muted text and a dashed border.
2026-06-09 18:55:03 -03:00
Joca 842913659a
Model form: hide height when non-rack, disable side selector for patch panels
Added toggleRackHeight() to show/hide the height-in-units field when the
rack-mountable checkbox changes. Added togglePatchMode() to disable the
port side selector when is_patch_panel is checked, with an explanatory
note that all ports get doubled to front+back anyway. Also initializes
both states on page load so edit view reflects saved values.
2026-06-09 18:54:37 -03:00
Joca cfc4dc564a
Fix rack front/back column misalignment
Replaced independent flex columns with a single table where each rack
unit is a <tr> containing both front and back content. Row heights now
stay locked together regardless of device name length. Device-start
rows get a top border and surface background for visual grouping.
2026-06-09 18:54:04 -03:00
Joca 459eef5d10
Group ports by device in connection modal dropdown
Replaced the flat 1000-entry select with optgroup grouping by device.
Each device gets its own optgroup label, making it possible to find
the target port even with hundreds of ports in the system.
2026-06-09 18:53:21 -03:00
Joca d9e7fb1ab1
Device and wall-socket views now highlight connected ports
Extracted shared _port_list.html partial with connected-port checking,
loaded into every page's template set. DeviceView and WallSocket handlers
now load connection data and pass it to the template. Removed duplicate
inline port_list definition from rack.html.
2026-06-09 18:52:32 -03:00
Joca 3e20caa2d9
Fix ConnectionEdit silently NULLing out port references
The edit handler was fetching the connection twice but never using the
result, then constructing a new Connection struct without PortID1/PortID2
fields. The DB update would write NULL into both port columns, severing
the cable from both ends. Now the handler fetches the existing row once
and updates only the submitted metadata fields in place.
2026-06-09 18:49:46 -03:00
Joca fcb04be887
Fix modal overlay sticking on page changes
- CSS now uses .open class instead of conflicting display:flex rule
- Simplified closeModal() - removed broken event.target checks
- Escape key calls closeModal() directly
- Removed stale style attribute from overlay div
2026-06-03 23:42:41 -03:00
Joca 5979df3cb5
Remove binaries from tracking 2026-06-03 23:22:19 -03:00
Joca 67ef5be483
Connection modal properly refreshes after create/edit/delete
- Connection handlers now re-render modal inline instead of redirecting
- Rack slots rendered top-to-bottom (U42 first, U1 last)
- Shared renderConnectionModal helper for DRY handler code
- Full connection tracing works through patch panels and wall sockets
2026-06-03 23:22:03 -03:00
Joca 1a8799d711
Fixed template inheritance and SQLite connection pooling
- Each page template now parsed with base.html separately to avoid content block conflicts
- Connection fragments parsed standalone without base layout
- Increased SQLite max connections to 5 to prevent nested query deadlocks
- Verified connection tracing works through patch panels and wall sockets
2026-06-03 23:18:09 -03:00
Joca 037c4e5ce3
Add SQLite WAL files to .gitignore 2026-06-03 23:11:22 -03:00
Joca a0f05791f8
Initial commit: Go + HTMX network mapping tool
- Database schema (SQLite) with migrations
- Data models: racks, devices, device models, ports, connections
- CRUD store layer in internal/db/
- Connection tracing service
- HTTP handlers for overview, rack, device, model, connection, wall sockets
- HTML templates with HTMX for connection modal
- Dark-themed CSS
- Vanilla JS for modal overlay management
2026-06-03 23:11:15 -03:00