Fix: Prioritize custom hardware label over account name in UI
This commit is contained in:
1 parent
a4dc705a3d
commit
7bc28a6a37
1 file changed
+3
-3
@@ -57,7 +57,7 @@ export function getAgentColumns({
|
||||
accessor: (row) => {
|
||||
const uuid = row.uuid || row.serial;
|
||||
const dynamicLabel = resolveAgentLabel(uuid, managedUsers);
|
||||
const displayLabel = dynamicLabel !== uuid ? dynamicLabel : (row.label || uuid);
|
||||
const displayLabel = row.label || (dynamicLabel !== uuid ? dynamicLabel : uuid);
|
||||
return (
|
||||
<div className="flex items-center justify-center gap-2 mx-auto max-w-full">
|
||||
<button
|
||||
@@ -65,7 +65,7 @@ export function getAgentColumns({
|
||||
className="text-center hover:text-white transition-colors truncate"
|
||||
title={displayLabel}
|
||||
>
|
||||
{dynamicLabel !== uuid ? dynamicLabel : (row.label || <span className="text-muted-foreground italic font-mono text-xs">{uuid}</span>)}
|
||||
{displayLabel !== uuid ? displayLabel : <span className="text-muted-foreground italic font-mono text-xs">{uuid}</span>}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
@@ -118,7 +118,7 @@ export function getAgentColumns({
|
||||
const dynamicLabel = resolveAgentLabel(uuid, managedUsers);
|
||||
const existingUser = managedUsers.find(u => u.agent_uuid === uuid && u.role === 'AGENT_VIEWER') || null;
|
||||
const isViewAsLoading = viewAsLoading === uuid;
|
||||
const agentLabel = dynamicLabel !== uuid ? dynamicLabel : (row.label || uuid);
|
||||
const agentLabel = row.label || (dynamicLabel !== uuid ? dynamicLabel : uuid);
|
||||
return (
|
||||
<div className="flex items-center justify-center gap-1 mx-auto">
|
||||
<button onClick={() => setDetailAgent(row)} className="p-1 text-blue-400 hover:text-blue-300 hover:bg-blue-950/30 rounded transition-colors" title="Detail Agent">
|
||||
|
||||
Reference in new issue
Block a user