{% import "partials/mcp_fields.html" as mcp %} {% from "components.html" import closer, scrim with context %} {% macro input(name, value, label="", placeholder="", mono=false, error="", inline=true) -%} {%- endmacro %} {% macro choose(name, value, options, label="", change="") -%} {%- endmacro %} {% macro credential(name, value) -%} {%- endmacro %} {% macro step(value, label, klass="policy__add") -%} {%- endmacro %} {% macro rules(name, title) -%} {% set items = form.items(name) %}

{{ title }} · {{ items | length }} OF {{ limits[name] }}

{% if items %}
Protocol Host IP
{% endif %} {% for item in items %}
{{ choose(name ~ "." ~ loop.index0 ~ ".protocol", item.protocol, protocols) }} {{ input(name ~ "." ~ loop.index0 ~ ".host", item.host, placeholder="—") }} {{ input(name ~ "." ~ loop.index0 ~ ".ip", item.ip, placeholder="—", mono=true) }} {{ step("drop:" ~ name ~ ":" ~ loop.index0, "×", "policy__drop") }}
{% endfor %} {% if not form.full(name) %}{{ step("add:" ~ name, "+ Add " ~ name ~ " rule") }}{% endif %} {%- endmacro %} {{ scrim("/policies") }}