feat: update agent status display to use role labels instead of status
This commit is contained in:
@@ -1158,11 +1158,18 @@ export default function BoardDetailPage() {
|
|||||||
return emoji ?? agentInitials(agent);
|
return emoji ?? agentInitials(agent);
|
||||||
};
|
};
|
||||||
|
|
||||||
const agentStatusLabel = (agent: Agent) => {
|
const agentRoleLabel = (agent: Agent) => {
|
||||||
if (workingAgentIds.has(agent.id)) return "Working";
|
// Prefer the configured identity role from the API.
|
||||||
if (agent.status === "online") return "Active";
|
if (agent.identity_profile && typeof agent.identity_profile === "object") {
|
||||||
if (agent.status === "provisioning") return "Provisioning";
|
const rawRole = (agent.identity_profile as Record<string, unknown>).role;
|
||||||
return "Offline";
|
if (typeof rawRole === "string") {
|
||||||
|
const trimmed = rawRole.trim();
|
||||||
|
if (trimmed) return trimmed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (agent.is_board_lead) return "Board lead";
|
||||||
|
if (agent.is_gateway_main) return "Gateway main";
|
||||||
|
return "Agent";
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatCommentTimestamp = (value: string) => {
|
const formatCommentTimestamp = (value: string) => {
|
||||||
@@ -1464,7 +1471,7 @@ export default function BoardDetailPage() {
|
|||||||
{agent.name}
|
{agent.name}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-[11px] text-slate-500">
|
<p className="text-[11px] text-slate-500">
|
||||||
{agentStatusLabel(agent)}
|
{agentRoleLabel(agent)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user