Commit Graph

15 Commits (76f9f49addef6c4b7550b60babbf41515bfdbaf7)

Author SHA1 Message Date
Joca ef063100f2
Model clone button on model list
Each model row now has a Clone button that duplicates the model with all
its ports, flags, and images, appending '(copy)' to the name. Saves
re-creating 48 ports when making a sibling switch model.
2026-06-09 20:15:18 -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 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 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 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 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