diff --git a/app.py b/app.py
index faea2eb..1af7cbc 100644
--- a/app.py
+++ b/app.py
@@ -690,10 +690,27 @@ def index():
state = load_state()
except Exception as exc:
state = ([], [], False, f"Cannot read Caddy config: {exc}", False, f"Cannot read dnsmasq config: {exc}")
+
+ dns_records = state[1]
+ xray_records = sorted(
+ (r for r in dns_records if r.service_key == "xray"),
+ key=lambda r: r.domain.lower(),
+ )
+ byedpi_records = sorted(
+ (r for r in dns_records if r.service_key == "byedpi"),
+ key=lambda r: r.domain.lower(),
+ )
+ other_dns_records = sorted(
+ (r for r in dns_records if r.service_key not in {"xray", "byedpi"}),
+ key=lambda r: r.domain.lower(),
+ )
+
return render_template_string(
TEMPLATE,
caddy_records=state[0],
- dns_records=state[1],
+ xray_records=xray_records,
+ byedpi_records=byedpi_records,
+ other_dns_records=other_dns_records,
caddy_ok=state[2],
caddy_status=state[3],
dns_ok=state[4],
@@ -985,6 +1002,12 @@ TEMPLATE = r"""
details { margin-top:10px; color:var(--muted); }
pre { white-space:pre-wrap; word-break:break-word; font-size:12px; }
.tag { display:inline-block; padding:2px 7px; border:1px solid #3a4657; border-radius:999px; color:#b8c6d9; font-size:11px; }
+ .dns-group { margin-top:18px; border:1px solid var(--line); border-radius:11px; overflow:hidden; background:#12161c; }
+ .dns-group-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:11px 13px; border-bottom:1px solid var(--line); }
+ .dns-group-title { display:flex; align-items:baseline; gap:8px; font-weight:700; }
+ .dns-group table { margin:0; }
+ .dns-group td:last-child, .dns-group th:last-child { width:1%; white-space:nowrap; }
+ .dns-warning { margin-top:18px; border-color:#735b2e; background:rgba(255,190,70,.04); }
@media (max-width:900px) { .grid { grid-template-columns:1fr; } }
@media (max-width:560px) { form.add { grid-template-columns:1fr; } .wide { grid-column:auto; } table { display:block; overflow-x:auto; } }
@@ -1063,26 +1086,96 @@ TEMPLATE = r"""
Экспортировать список доменов
-
- | Domain | Сервис | IPv4 | IPv6 | |
-
- {% for r in dns_records %}
-
- | {{ r.domain }} |
- {{ r.service_name }} |
- {{ r.ip }} |
- {% if r.ipv6_blocked %}заблокирован{% else %}нет local={% endif %} |
-
-
- |
-
- {% else %}| Записей не найдено. |
{% endfor %}
-
-
+
+
+
+ XRAY
+ {{ xray_records|length }} доменов
+
+
{{ dns_services['xray']['ip'] }}
+
+
+ | Domain | IPv6 | |
+
+ {% for r in xray_records %}
+
+ | {{ r.domain }} |
+ {% if r.ipv6_blocked %}заблокирован{% else %}нет local={% endif %} |
+
+
+ |
+
+ {% else %}
+ | Нет доменов, направленных через XRAY. |
+ {% endfor %}
+
+
+
+
+
+
+
+ ByeDPI
+ {{ byedpi_records|length }} доменов
+
+
{{ dns_services['byedpi']['ip'] }}
+
+
+ | Domain | IPv6 | |
+
+ {% for r in byedpi_records %}
+
+ | {{ r.domain }} |
+ {% if r.ipv6_blocked %}заблокирован{% else %}нет local={% endif %} |
+
+
+ |
+
+ {% else %}
+ | Нет доменов, направленных через ByeDPI. |
+ {% endfor %}
+
+
+
+
+ {% if other_dns_records %}
+
+
+
+ Другие маршруты
+ {{ other_dns_records|length }}
+
+
IP не соответствует XRAY/ByeDPI
+
+
+ | Domain | IPv4 | IPv6 | |
+
+ {% for r in other_dns_records %}
+
+ | {{ r.domain }} |
+ {{ r.ip }} |
+ {% if r.ipv6_blocked %}заблокирован{% else %}нет local={% endif %} |
+
+
+ |
+
+ {% endfor %}
+
+
+
+ {% endif %}
Результат dnsmasq --test
{{ dns_status }}