Files
evo-sync/web/templates/sync.html
mguschin 75b3872170 feat: per-task on/off switches on /sync page for staged rollout
Adds evo_mirror_enabled and vk_mirror_enabled flags to SyncConfig.
Each of the three background tasks (Зеркало Эвотор / Зеркало ВК /
Синхронизация) can now be enabled independently from the /sync page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 23:32:02 +03:00

72 lines
3.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}Синхронизация — ЭВОСИНК{% endblock %}
{% block content %}
<div class="d-flex justify-between align-center mb-3">
<h1 style="font-size:1.3rem; margin:0;"><i class="bi bi-arrow-repeat me-2"></i>Синхронизация</h1>
</div>
{% if saved %}
<div role="alert" class="alert alert-success"><p>Настройки сохранены.</p></div>
{% endif %}
<form method="post" action="/sync/settings">
<article class="card mb-3">
<h2 style="font-size:1.1rem; margin-bottom:1.25rem;">Фоновые задачи</h2>
<p class="text-muted small" style="margin-bottom:1.25rem;">Включайте поочерёдно: сначала проверьте зеркало Эвотор, затем ВК, затем синхронизацию.</p>
<div style="display:flex; flex-direction:column; gap:1rem;">
<label style="display:flex; align-items:flex-start; gap:0.75rem; cursor:pointer;">
<input type="hidden" name="evo_mirror_enabled" value="0">
<input type="checkbox" name="evo_mirror_enabled" value="1" role="switch"
{% if config and config.evo_mirror_enabled %}checked{% endif %}
style="margin-top:0.2rem; flex-shrink:0;">
<span>
<strong>Зеркало Эвотор</strong><br>
<span class="text-muted small">Периодически импортирует товары, группы и магазины из Эвотор в локальную базу.</span>
</span>
</label>
<label style="display:flex; align-items:flex-start; gap:0.75rem; cursor:pointer;">
<input type="hidden" name="vk_mirror_enabled" value="0">
<input type="checkbox" name="vk_mirror_enabled" value="1" role="switch"
{% if config and config.vk_mirror_enabled %}checked{% endif %}
style="margin-top:0.2rem; flex-shrink:0;">
<span>
<strong>Зеркало ВК</strong><br>
<span class="text-muted small">Периодически импортирует альбомы и товары из VK Market в локальный кэш.</span>
</span>
</label>
<label style="display:flex; align-items:flex-start; gap:0.75rem; cursor:pointer;">
<input type="hidden" name="is_enabled" value="0">
<input type="checkbox" name="is_enabled" value="1" role="switch"
{% if config and config.is_enabled %}checked{% endif %}
style="margin-top:0.2rem; flex-shrink:0;">
<span>
<strong>Синхронизация</strong><br>
<span class="text-muted small">Зеркалит каталог Эвотор в VK Market: создаёт, обновляет и удаляет товары.</span>
</span>
</label>
</div>
</article>
<article class="card mb-3">
<h2 style="font-size:1.1rem; margin-bottom:1.25rem;">Настройки цены</h2>
<label style="max-width:320px;">
Множитель цены
<input type="number" name="price_multiplier" step="0.0001" min="0.0001"
value="{{ config.price_multiplier if config else '1' }}"
placeholder="1">
<small class="text-muted">Цена из Эвотор умножается на это значение перед отправкой в ВК. По умолчанию: 1.</small>
</label>
</article>
<button type="submit">Сохранить</button>
</form>
{% endblock %}