module Web.View.ModelRoutingPolicies.Index where import Web.View.Prelude data IndexView = IndexView { policies :: ![ModelRoutingPolicy] , hubs :: ![Hub] , agents :: ![AgentRegistration] } instance View IndexView where html IndexView { .. } = [hsx|

Model Routing Policies

Add Policy
{forEach policies renderRow}
Hub Task Type Agent Priority Active
|] where hubName hid = maybe "Unknown" (.name) (find (\h -> h.id == hid) hubs) agentName aid = maybe "Unknown" (.name) (find (\a -> a.id == aid) agents) renderRow p = [hsx| {hubName p.hubId} {p.taskType} {agentName p.agentRegistrationId} {show p.priority} {if p.isActive then [hsx|Yes|] else [hsx|No|]} Delete |]