module Web.View.AgentRegistrations.Index where import IHP.ViewPrelude data IndexView = IndexView { agents :: ![AgentRegistration] , hubs :: ![Hub] } instance View IndexView where html IndexView { .. } = [hsx|

Agent Registry

Register Agent
{forEach agents renderRow}
Name Hub Provider Model Trust Status
|] where hubName agentHubId = case find (\h -> h.id == agentHubId) hubs of Just h -> h.name Nothing -> "Unknown" renderRow agent = [hsx| {agent.name} {hubName agent.hubId} {agent.provider} {agent.modelName} {trustBadge agent.trustLevel} {statusBadge agent.isActive} Edit |] trustBadge :: Text -> Html trustBadge "autonomous" = [hsx|autonomous|] trustBadge "elevated" = [hsx|elevated|] trustBadge _ = [hsx|advisory|] statusBadge :: Bool -> Html statusBadge True = [hsx|active|] statusBadge False = [hsx|inactive|]