{{/* Bindings page (/bindings): services table plus base/derived/auto binding tables. HTMX partial: block binding_groups */}} {{/* binding_service renders the service name and type for a binding row */}} {{ define "binding_service" }} {{ if .service_name }} {{ .service_name }} {{ end }} {{ if .service_type }} {{ .service_type }} {{ else if not .service_name }} config only {{ end }} {{ end }} {{/* binding_config renders the config keys summary cell content */}} {{ define "binding_config" }} {{ if .config_keys }} {{ len .config_keys }} keys {{ else }} - {{ end }} {{ end }} {{/* binding_badges renders the staged changes marker */}} {{ define "binding_badges" }} {{ if .has_staged }} pending {{ end }} {{ end }} {{/* binding_updated renders the update age cell content */}} {{ define "binding_updated" }} {{ if .update_time }} {{ template "time_ago" .update_time }} {{ end }} {{ end }} {{/* binding_actions renders the row action buttons. Context: dict with Path, AppPath, Editable (grants can be updated) and Perms (the user's management permissions) */}} {{ define "binding_actions" }}
{{ if .Editable }} {{ end }}
{{ end }} {{ template "head" . }}
{{ template "drawer_toggle" }}
{{ template "page_progress" }}
{{ block "binding_groups" . }} {{ template "flash_alerts" .Data }}

Services

{{ len .Data.Services }} services - bindings connect apps to these
{{ if .Data.ServicesError }}

{{ .Data.ServicesError }}

{{ else if .Data.Services }}
{{ range .Data.Services }} {{ end }}
Service Actions
{{ .id }} {{ if .is_default }} default {{ end }}
{{ else }}
No services configured yet + New service
{{ end }}
{{ if .Data.Base }}

Base bindings

bind directly to a service
{{ range .Data.Base }} {{ end }}
Binding Service Actions
{{ .path }} {{ template "binding_badges" . }} {{ template "binding_service" . }} {{ template "binding_actions" (dict "Path" .path "AppPath" $.AppPath "Editable" false "Perms" $.Data.Perms) }}
{{ end }} {{ if .Data.Derived }}

Derived bindings

extend a base binding with grants and config overrides
{{ range .Data.Derived }} {{ end }}
Binding Base binding Grants Actions
{{ .path }} {{ template "binding_badges" . }} {{ .derived_from }} {{ range .grants }} {{ . }} {{ else }} no grants {{ end }} {{ template "binding_actions" (dict "Path" .path "AppPath" $.AppPath "Editable" true "Perms" $.Data.Perms) }}
{{ end }} {{ if .Data.Auto }}
auto

Auto bindings

created automatically when an app references a service directly
{{ range .Data.Auto }} {{ end }}
App Service
{{ .app_path }} {{ template "binding_badges" . }} {{ template "binding_service" . }}
{{ end }} {{ if and (not .Data.Base) (not .Data.Derived) (not .Data.Auto) }}
{{ if .Data.Query }}

No bindings match "{{ .Data.Query }}"

{{ else }}

No bindings configured yet

+ New binding {{ end }}
{{ end }} {{ end }}
{{ template "sidebar" . }}