{{/* The limits tab of the people page. */}} {{define "limits_body"}} {{if not .BudgetsBind}} {{/* A budget is spend per period and spend comes from a price table. With no prices every request costs nothing, so these numbers read as limits and bind on nothing. Self-hosted models having no per-token price is ordinary; showing somebody a budget without saying so is not. */}}
{{end}} {{if .Error}}{{.Error}}
{{end}} {{if .Message}}{{.Message}}
{{end}} {{if .Rows}} {{/* The tree is the interface. A quota belongs to a branch, so the form to set one opens on that branch rather than asking somebody to name it again in a box at the bottom. */}}| {{t "quotas.col.where"}} | {{t "quotas.col.rpm"}} | {{t "quotas.col.tpm"}} | {{t "quotas.col.budget"}} | {{t "quotas.col.spent"}} | |
|---|---|---|---|---|---|
|
{{.Path}} {{t (print "quotas.kind." .Scope)}}
{{if .Models}} {{th "quotas.only_models" .Models}}
{{else if .ModelsFrom}}{{t "quotas.models_from" .ModelsFrom}} {{end}}
{{if .Member}}{{t "quotas.each_member" .Member}} {{end}}
{{if .Shadowed}}
{{/* A value that is written here and never reached. Resolution takes the
most restrictive along the chain, so without saying so the page would
show a number as though it applied. */}}
{{.Shadowed}} {{end}}
|
{{template "quota-value" dict "Own" .Shown.RPM "Up" .RPMUp "From" .RPMFrom}} | {{template "quota-value" dict "Own" .Shown.TPM "Up" .TPMUp "From" .TPMFrom}} | {{if .Budget}}{{.Shown.Budget}}{{if .Period}}/{{.Shown.Period}}{{end}} {{else}}{{template "quota-value" dict "Up" .BudgetUp "From" .BudgetFrom}}{{end}} | {{.Spend}} {{if .HasPct}} {{t "quotas.pct" .Percent}}{{end}} | {{if $.CSRF}} {{if .Editing}}{{t "quotas.close"}} {{else}}{{if .HasAny}}{{t "quotas.change"}}{{else}}{{t "quotas.set"}}{{end}}{{end}} {{if .MemberEditing}}{{t "quotas.close"}} {{else}}{{t "quotas.per_member"}}{{end}} {{end}} |
| {{template "quota-form" (dict "Scope" (printf "%s-member" .Scope) "ID" .ID "F" .MemberRaw "CSRF" $.CSRF "Title" (t "quotas.member_form.title" .Crumb) "Note" (t "quotas.member_form.note"))}} | |||||
| {{if $.CSRF}}{{end}} | |||||
{{th "quotas.legend"}}
{{else}}{{th "quotas.empty_tree"}}
{{end}}{{t "quotas.people.note"}} {{.Personal}}
{{if .People}}| {{t "quotas.col.person"}} | {{t "quotas.col.rpm"}} | {{t "quotas.col.tpm"}} | {{t "quotas.col.budget"}} | {{t "quotas.col.spent"}} | |
|---|---|---|---|---|---|
| {{.Email}}
{{if .Models}} {{th "quotas.only_models" .Models}} {{end}} |
{{or .Shown.RPM "—"}} | {{or .Shown.TPM "—"}} | {{if .Budget}}{{.Shown.Budget}}{{if .Period}}/{{.Shown.Period}}{{end}}{{else}}—{{end}} | {{.Spend}} {{if .HasPct}} {{t "quotas.pct" .Percent}}{{end}} | {{if $.CSRF}}{{if .Editing}}{{t "quotas.close"}} {{else}}{{if .HasAny}}{{t "quotas.change"}}{{else}}{{t "quotas.set"}}{{end}}{{end}}{{end}} |
| {{template "quota-form" (dict "Scope" "user" "ID" .ID "CSRF" $.CSRF "F" (dict "RPM" .RPM "TPM" .TPM "Budget" .Budget "Period" .Period "Models" .Models "HasAny" .HasAny) "Title" (t "quotas.person_form.title" .Email) "Note" (t "quotas.person_form.note"))}} | |||||
{{t "quotas.people.empty"}}
{{end}} {{if .HasCapacity}}{{t "capacity.note"}}
{{if .Capacity}}| {{t "quotas.col.where"}} | GPUs | {{t "capacity.col.cores"}} | {{t "capacity.col.memory"}} | {{t "capacity.col.set_by"}} | |
|---|---|---|---|---|---|
| {{or .Name .Scope}} | {{or .GPUs "—"}} | {{or .Cores "—"}} | {{or .Memory "—"}} | {{.UpdatedBy}} | {{t "quotas.change"}} {{if $.CSRF}}{{end}} |
{{t "capacity.legend"}}
{{else}}{{t "capacity.empty"}}
{{end}} {{if .Scopes}} {{if .CSRF}}{{end}} {{else}}{{th "capacity.empty_tree"}}
{{end}} {{end}}{{t "quotas.explain.chain"}}
{{th "quotas.explain.keys"}}