{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$d := .}}{{$a := .Row}}

← Agents

{{$a.Name}}{{if $a.BuiltIn}} built in{{end}}{{if eq $a.Status "disabled"}} turned off{{end}}

{{with .Problem}}{{end}}
{{template "agent-scopes" (dict "Scopes" $a.Modules "Grants" .Grants)}}

Keys

{{range $a.Keys}}{{else}}{{end}}
KeyMadeExpiresLast used
{{.Prefix}}… {{if not .Revoked.IsZero}} revoked {{ago .Revoked}} {{else if not (.Working $d.Now)}} stopped {{else if not .Retires.IsZero}} replaced: works until {{.Retires.Local.Format "2 Jan 15:04"}} {{else}} working{{end}} {{.Created.Local.Format "2 Jan 2006"}} {{if .Expires.IsZero}}never{{else}}{{.Expires.Local.Format "2 Jan 2006"}}{{end}} {{if .Used.IsZero}}never{{else}}{{ago .Used}}{{with .UsedFrom}} from {{.}}{{end}}{{end}} {{if .Working $d.Now}}
{{end}}
No keys.

Rotate makes a new key; the old one keeps working for a day, so whatever uses it can be switched over. After a leak, revoke it instead: it stops at once.

On its own

{{if .Allowed}}

What {{$a.Name}} may do without asking, approved on the Approvals page. Everything else it asks for waits there for a person.

{{range .Allowed}}{{end}}
{{.Label}}{{if .DailyCap}}up to {{.DailyCap}} a day{{else}}no cap{{end}}{{ago .Granted}}{{with by .GrantedBy}} {{.}}{{end}}
{{else}}

Nothing: everything it asks to send out (posts, emails, mailing-list adds, changes to the sites) waits on Approvals for a person.

{{end}} {{if .Asked}}

Lately

{{end}}
{{if eq $a.Status "disabled"}}
{{else}}
{{end}} {{if not $a.BuiltIn}}
{{end}}

Turned off, none of its keys work, until it's turned back on.

{{end}}{{template "settings-end"}}{{end}}