From 5bb8dece445cfd73129eb853f85b5345e25fca29 Mon Sep 17 00:00:00 2001 From: Jason Staack Date: Sat, 21 Mar 2026 12:36:29 -0500 Subject: [PATCH] feat(ui): add device workspace header with breadcrumb and metadata Co-Authored-By: Claude Opus 4.6 (1M context) --- .../tenants/$tenantId/devices/$deviceId.tsx | 105 ++++++++---------- 1 file changed, 49 insertions(+), 56 deletions(-) diff --git a/frontend/src/routes/_authenticated/tenants/$tenantId/devices/$deviceId.tsx b/frontend/src/routes/_authenticated/tenants/$tenantId/devices/$deviceId.tsx index 528a639..8e052fb 100644 --- a/frontend/src/routes/_authenticated/tenants/$tenantId/devices/$deviceId.tsx +++ b/frontend/src/routes/_authenticated/tenants/$tenantId/devices/$deviceId.tsx @@ -2,12 +2,10 @@ import { createFileRoute, Link, useNavigate } from '@tanstack/react-router' import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query' import { useState } from 'react' import { - ChevronRight, Eye, EyeOff, Pencil, Trash2, - Circle, Tag, FolderOpen, BellOff, @@ -189,21 +187,6 @@ function EditDeviceDialog({ ) } -function StatusBadge({ status }: { status: string }) { - const config: Record = { - online: { label: 'Online', className: 'text-success border-success/50 bg-success/10' }, - offline: { label: 'Offline', className: 'text-error border-error/50 bg-error/10' }, - unknown: { label: 'Unknown', className: 'text-text-muted border-border bg-elevated/50' }, - } - const c = config[status] ?? config.unknown - return ( - - - {c.label} - - ) -} - function TlsSecurityBadge({ tlsMode }: { tlsMode: string }) { const config: Record = { portal_ca: { @@ -465,57 +448,67 @@ function DeviceDetailPage() { return (
- {/* Breadcrumb */} -
- - Tenants - - - - {tenant?.name ?? tenantId} - - - {device.hostname} -
- - {/* Device header */} -
-
-
-

{device.hostname}

- - -
-

{device.ip_address}

-
-
- - {user?.role !== 'viewer' && ( -
- {device.routeros_version !== null && ( + {/* Device workspace header */} +
+
+
+ {/* Breadcrumb */} +
+ + Devices + + + {device.hostname} +
+ {/* Device name + status */} +
+
+

+ {device.hostname} +

+ +
+ {/* Metadata line */} +
+ {device.model ?? device.board_name ?? '\u2014'} + {' \u00b7 '} + {device.ip_address} + {device.routeros_version && ( <> - - + {' \u00b7 RouterOS '} + {device.routeros_version} )} -
- )} -
+
+ {/* Actions: right side */} +
+ + {user?.role !== 'viewer' && device.routeros_version !== null && ( + <> + + + + )} + {user?.role !== 'viewer' && ( + + )} {canWrite(user) && ( )} {canDelete(user) && ( )}