feat(devices): add console-only display name (console_name)
Lets staff set a friendly name for a device independent of whatever name the end user gave it in the app. console_name is never shown to app users and never synced from/to device_name; every display label across search, equipment/helpdesk name resolution, device search, and the Manage tab's issue linker now falls back through console_name -> device_name -> serial rather than device_name alone. Also includes an incidental one-line fix in devices/service.py: the nested-struct deep-merge in update_device() was missing the newly added device_health_settings key. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -632,9 +632,9 @@ export default function ManageTab({ device, canEdit, deviceUsers: propUsers, use
|
||||
defaultType="issue"
|
||||
prefilledLinks={issueModal.entry
|
||||
? undefined
|
||||
: [{ entity_type: 'device', entity_id: id, display_name: device?.device_name || sn, locked: true }]
|
||||
: [{ entity_type: 'device', entity_id: id, display_name: device?.console_name || device?.device_name || sn, locked: true }]
|
||||
}
|
||||
knownEntities={id ? { [id]: device?.device_name || sn } : undefined}
|
||||
knownEntities={id ? { [id]: device?.console_name || device?.device_name || sn } : undefined}
|
||||
onClose={() => setIssueModal({ open: false, entry: null })}
|
||||
onSaved={handleIssueSaved}
|
||||
onDelete={canEdit ? (entryId) => {
|
||||
|
||||
@@ -820,7 +820,7 @@ export default function UserDetail() {
|
||||
<option value="">Choose a device…</option>
|
||||
{availableDevices.map((d) => (
|
||||
<option key={d.id} value={d.id}>
|
||||
{d.device_name || 'Unnamed'} ({d.device_id || d.id})
|
||||
{d.console_name || d.device_name || 'Unnamed'} ({d.device_id || d.id})
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
@@ -848,7 +848,7 @@ export default function UserDetail() {
|
||||
onClick={() => navigate(`/devices/${device.id}`)}
|
||||
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 0, fontSize: 'var(--font-size-sm)', fontWeight: 'var(--font-weight-semibold)', color: 'var(--color-text-accent)', textAlign: 'left', display: 'block', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: '160px' }}
|
||||
>
|
||||
{device.device_name || 'Unnamed Device'}
|
||||
{device.console_name || device.device_name || 'Unnamed Device'}
|
||||
</button>
|
||||
<p style={{ fontFamily: 'var(--font-family-mono)', fontSize: 'var(--font-size-xs)', color: 'var(--color-text-muted)', marginTop: '2px' }}>
|
||||
{device.device_id || device.id}
|
||||
|
||||
@@ -405,7 +405,7 @@ function LinkedDevicesModal({ userId, userName, open, onClose }) {
|
||||
<Icon name="device" size={14} color="var(--color-primary)" />
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontWeight: 'var(--font-weight-medium)', color: 'var(--color-text-primary)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{d.device_name || d.device_id || d.id}
|
||||
{d.console_name || d.device_name || d.device_id || d.id}
|
||||
</div>
|
||||
{d.device_id && (
|
||||
<div style={{ color: 'var(--color-text-muted)', fontSize: 'var(--font-size-xs)', fontFamily: 'var(--font-family-mono)' }}>
|
||||
|
||||
Reference in New Issue
Block a user