{% extends 'admin/master.html' %} {% macro name_list(title, names, css) %} {% if names %}

{{ title }}: {{ names|length }} {{ names|join(', ') }}

{% endif %} {% endmacro %} {% block body %}

Import {{ admin_view.name }}

Takes what the Export of this page writes, as well as rules written by hand. Only rules of {{ rule_type }} are accepted. Back to the list Documentation

{% if error %}
{{ error }}
{% endif %} {% if result %}
Import finished {{ name_list('Imported', result.imported, 'success') }} {{ name_list('Replaced', result.replaced, 'warning') }} {{ name_list('Skipped, already exists', result.skipped, 'secondary') }} {{ name_list('Failed, not imported', result.failed, 'danger') }}
{% elif plan %}
{% if plan.ok %} Check passed, nothing was written yet. {% set existing = plan.rows|selectattr('status', 'equalto', 'exists')|list|length %} {{ plan.rows|length }} rule(s), {{ existing }} of them already exist. {% else %} Nothing was imported. Correct the problems below and try again. {% endif %} {% for message in plan.errors %}
{{ message }}
{% endfor %}
{% endif %} {% if plan and not result %} {% for note in plan.notes %}
{{ note }}
{% endfor %} {% if plan.rows %} {% set override = form_data.get('override') %}
{% for row in plan.rows %} {% endfor %}
PositionRuleEnabledWhat happens
{{ row.where }} {{ row.name }} {% if row.status != 'error' %}{{ 'yes' if row.enabled else 'no' }}{% endif %} {% if row.status == 'error' %} Error {% for message in row.errors %}
{{ message }}
{% endfor %} {% elif row.status == 'exists' and override %} Replaces {{ row.existing|join(', ') }} {% elif row.status == 'exists' %} Skipped, already exists {{ row.existing|join(', ') }} {% else %} New {% endif %} {% for message in row.warnings %}
{{ message }}
{% endfor %}
{% endif %} {% endif %}
One JSON object per line or a JSON list. A rule without _id gets a new one.
{% if path_allowed %}
Relative to the Files folder. Files ending in .syncer_json, .jsonl or .json up to {{ max_file_mb }} MB, no symbolic links.
{% endif %}
A rule exists if it has the same id or name. Without this option it stays as it is and the record is skipped.
This is too much text to paste. Put the file into the Files folder and give its path.
{% endblock %} {% block tail %} {{ super() }} {% endblock %}