fix(ui): fix device header layout for narrow viewports
Two-row layout: top row is identity (breadcrumb › dot hostname status), bottom row is metadata left + actions right. Hostname truncates instead of wrapping. Metadata truncates. Actions stay on one line and push against the right edge. No overlap at any width. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -433,22 +433,16 @@ function DeviceDetailPage() {
|
||||
<div className={cn('space-y-4', mode === 'simple' ? 'max-w-5xl' : 'max-w-3xl')} data-testid="device-detail">
|
||||
{/* Device workspace header */}
|
||||
<div className="bg-sidebar border border-border-default rounded-sm px-3 py-1.5">
|
||||
<div className="flex justify-between items-center">
|
||||
<div className="min-w-0">
|
||||
{/* Breadcrumb */}
|
||||
<div className="mb-px">
|
||||
{/* Top row: device identity */}
|
||||
<div className="flex items-center gap-1.5 min-w-0">
|
||||
<Link
|
||||
to="/tenants/$tenantId/devices"
|
||||
params={{ tenantId }}
|
||||
className="text-[8px] text-text-muted hover:text-text-secondary transition-[color] duration-[50ms]"
|
||||
className="text-[8px] text-text-muted hover:text-text-secondary transition-[color] duration-[50ms] flex-shrink-0"
|
||||
>
|
||||
Devices
|
||||
</Link>
|
||||
<span className="text-[8px] text-text-muted mx-1">›</span>
|
||||
<span className="text-[8px] text-text-secondary">{device.hostname}</span>
|
||||
</div>
|
||||
{/* Device name + status dot + label */}
|
||||
<div className="flex items-center gap-1.5">
|
||||
<span className="text-[8px] text-text-muted flex-shrink-0">›</span>
|
||||
<div className={cn(
|
||||
'w-1.5 h-1.5 rounded-full flex-shrink-0',
|
||||
device.status === 'online' ? 'bg-online' :
|
||||
@@ -466,8 +460,9 @@ function DeviceDetailPage() {
|
||||
</span>
|
||||
<TlsSecurityBadge tlsMode={device.tls_mode} />
|
||||
</div>
|
||||
{/* Metadata */}
|
||||
<div className="text-[9px] text-text-secondary mt-px pl-[9px]">
|
||||
{/* Metadata + actions row */}
|
||||
<div className="flex items-center justify-between mt-0.5 gap-2">
|
||||
<div className="text-[9px] text-text-secondary truncate pl-[9px]">
|
||||
{device.model ?? device.board_name ?? '\u2014'}
|
||||
{' \u00b7 '}
|
||||
<span className="font-mono text-[8px]">{device.ip_address}</span>
|
||||
@@ -478,9 +473,7 @@ function DeviceDetailPage() {
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{/* Actions */}
|
||||
<div className="flex items-center gap-1 flex-shrink-0 ml-3">
|
||||
<div className="flex items-center gap-1 flex-shrink-0">
|
||||
<SimpleModeToggle mode={mode} onModeChange={toggleMode} />
|
||||
{user?.role !== 'viewer' && device.routeros_version !== null && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user