{{define "content"}} {{$csrf := .CSRF}}

Client Networks

Subnets that DNS policies are applied to. A query is matched against the most specific network containing the client's address.

Add Network
{{if not .Data.Policies}}
There are no policies to assign yet. A network without a policy is matched but filters nothing. Create a policy first.
{{end}}
{{if .Data.Networks}}
{{range .Data.Networks}}

{{.Name}}

{{.CIDR}}
{{statusWord .Enabled}}
{{if .Description}}

{{.Description}}

{{end}}
DNS Policies
{{if .Policies}}
{{range .Policies}} {{.Name}} · {{.BlockAction.Label}} {{end}}
{{else}} No policies assigned — queries from this network are not filtered. {{end}}
Edit policies {{template "postform" dict "Action" (printf "/policies/networks/%d/toggle" .ID) "CSRF" $csrf "ReturnTo" "/policies/networks" "Fields" (dict "enabled" (boolstr (not .Enabled))) "Icon" (toggleIcon .Enabled) "Label" (toggleVerb .Enabled) "Class" "btn btn-sm btn-outline-secondary"}} {{template "confirmform" dict "Action" (printf "/policies/networks/%d/delete" .ID) "CSRF" $csrf "Icon" "bi-trash" "Label" "Delete" "Message" (printf "Delete the network %q (%s)? Clients in this range will stop matching any policy." .Name .CIDR)}}
{{end}}
{{else if .Data.Search}} {{template "empty" dict "Icon" "bi-search" "Title" "No networks match that search" "Message" "Try a different term, or clear the search box."}} {{else}} {{template "empty" dict "Icon" "bi-router" "Title" "No client networks yet" "Message" "A client network binds a subnet to one or more policies. For example, a guest Wi-Fi range on 100.64.30.0/24 might use the adult content, gambling and malware blacklists, while a trusted LAN uses malware only."}} {{end}}
{{end}}