module Web.View.AgentRegistrations.Show where import Web.View.Prelude import Web.View.AgentRegistrations.Index (trustBadge, statusBadge) data ShowView = ShowView { agent :: !AgentRegistration , policies :: ![ModelRoutingPolicy] , recentProposals :: ![AgentProposal] , mPerformance :: !(Maybe AgentPerformanceRecord) } instance View ShowView where html ShowView { .. } = [hsx|
{agent.slug}
Provider
{agent.provider}
Model
{agent.modelName}
Description
{fromMaybe "—" agent.description}
No routing policies. Add one.
|] else policiesTable}No proposals yet.
|] else proposalsTable}| Task Type | Priority | Active |
|---|---|---|
| {p.taskType} | {show p.priority} | {statusBadge p.isActive} |
| Type | Status | Tokens In/Out | Created |
|---|---|---|---|
| {p.proposalType} | {p.status} | {maybe "—" show p.tokensIn} / {maybe "—" show p.tokensOut} | {timeAgo p.createdAt} |
{show p.proposalsGenerated}
Generated
{show p.proposalsAccepted}
Accepted
{show p.proposalsRejected}
Rejected
{show acceptPct}%
Acceptance rate
Mean confidence: —
|] Just c -> [hsx|Mean confidence: {printf "%.2f" c :: String}
|] }