major updates to device and links management in admin

This commit is contained in:
user
2026-03-28 15:34:03 +02:00
parent e8c5986df6
commit 6639bcd799
32 changed files with 3304 additions and 496 deletions

View File

@@ -11,7 +11,7 @@ Update rule:
---
### 0 (genesis)
### 0 - Genesis
- init
@@ -30,7 +30,7 @@ Update rule:
- Device CRUD page at /devices — list table, create dialog, delete with confirmation, status dots, refresh
- Link CRUD page at /links — list table, generate link dialog (device select + expiry), revoke, delete, copy token
- Remote functions for both domains (*SQ queries, *SC commands)
- View models (*.vm.svelte.ts) with optimistic UI updates (create appends, delete filters locally)
- View models (\*.vm.svelte.ts) with optimistic UI updates (create appends, delete filters locally)
- Fixed bug: table not refreshing after create (was SvelteKit query cache — switched to optimistic local state)
- Fixed bug: /links auth failure (hooks.server.ts path check matching "/link" inside "/links")
@@ -42,3 +42,51 @@ Update rule:
- Deployed via Dokploy with Traefik domain routing
- Networking: redroid on bridge, ws-scrcpy on dokploy overlay — connected via host bridge gateway (172.17.0.1:5555)
- ws-scrcpy live and streaming redroid at iotam-ws-scrcpy.snapyra.com
### 4 — Device Detail Page
- Implemented `/devices/[id]` admin detail page with metadata, refresh/open actions, and an embedded live ws-scrcpy iframe
- Added a dedicated device details VM and derived the viewer URL from stored device host/wsPort data
- Updated `/devices` so device entries navigate into their detail page
### 5 — README Product Flow Update
- Updated the implementation plan to reflect the app-leasing model: links target a specific app on a device, front triggers orchestrator reset/launch during loading, and devices need explicit `inUse` tracking
### 6 — Admin App Leasing Model
- Added `inUse` to the device schema/domain and surfaced it in the devices admin list/detail views
- Extended links to store required leased app data (`appName`, `appPackage`) alongside the assigned device
- Updated the admin links creation flow and listing UI so links are created against a specific device and app package
### 7 — Required Device Connection Fields
- Propagated `containerId` and `wsPort` as required device fields across validation, repository create logic, and the admin device creation form to match the non-null schema
### 8 — Reused Device Edit Form
- Added a shared device form component under the device domain and reused it for create/edit flows
- Added manual device editing in the devices list and device detail page, including overrides for host, container ID, ws port, status, `isActive`, and `inUse`
### 9 — Supported App Link Creation
- Updated admin link creation to select from `SUPPORTED_APPS` in constants instead of accepting freeform app name/package input
### 10 — Device Detail Page Layout Improvement
- Restructured device detail layout: Metadata + Edit Device side-by-side in top row, Live Device Session full-width below
- Iframe now uses `h-[75vh] min-h-[480px]` instead of fixed 720px height, making it fill available space
- Added "Pop out" link in the Live Device Session card header for quick external access
- Tightened metadata card with inline grid rows (port/in-use, created/updated) and smaller labels
- Styled backtick code refs in Edit Device description with `<code>` tags
- Updated skeleton loading state to match the new two-row layout
### 11 — Merged Devices Page into Dashboard
- Moved device list (table, create/edit/delete dialogs) from `/devices` into `/dashboard` — dashboard is now the devices home
- Moved device detail page from `/devices/[id]` to `/dashboard/[id]`
- Removed `/devices` route directory entirely
- Removed "Devices" entry from `mainNavTree` sidebar navigation (was index 2)
- Cleaned up unused `Smartphone` import from constants.ts
- Updated detail page breadcrumbs to go Dashboard > Device instead of Dashboard > Devices > Device
- Updated `goto` calls to navigate to `/dashboard/:id` instead of `/devices/:id`