{% macro field(name, label, value='', type='text', errors={}, hint='', wide=false, placeholder='', attrs='') -%}
{% if errors.get(name) %}{{ errors[name] }}{% endif %} {% if hint %}{{ hint }}{% endif %}
{%- endmacro %} {% macro select(name, label, options, current, errors={}, hint='') -%}
{% if errors.get(name) %}{{ errors[name] }}{% endif %} {% if hint %}{{ hint }}{% endif %}
{%- endmacro %} {% macro check(name, label, checked, hint='', wide=false) -%}
{% if hint %}{{ hint }}{% endif %}
{%- endmacro %} {% macro csrf_field(csrf) %}{% endmacro %} {% macro state_badge(m) -%} {% set labels = SFTP_STATE_LABELS if m.type == MountType.SFTP else STATE_LABELS %} {% set cls = {'mounted': 'ok', 'degraded': 'warn', 'error': 'err'}.get(m.state.value, '') %} {{ labels[m.state] }} {%- endmacro %} {% macro run_badge(status) -%} {% set cls = {'ok': 'ok', 'partial': 'warn', 'error': 'err'}.get(status.value, '') %} {{ RUN_LABELS[status] }} {%- endmacro %}