From b2cb189d25f974f2c7906d82920f05cd58694936 Mon Sep 17 00:00:00 2001 From: Fedorov Dmitriy Date: Sun, 18 Oct 2026 22:22:48 +0300 Subject: [PATCH] =?UTF-8?q?work:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B4=D0=BE=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=B2=20=D0=B4=D0=B2=D0=B0=20=D1=81=D1=82=D0=BE=D0=BB=D0=B1?= =?UTF-8?q?=D1=86=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 135 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 114 insertions(+), 21 deletions(-) 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"""

Экспортировать список доменов

- - - - {% for r in dns_records %} - - - - - - - - {% else %}{% endfor %} - -
DomainСервисIPv4IPv6
{{ r.domain }}{{ r.service_name }}{{ r.ip }}{% if r.ipv6_blocked %}заблокирован{% else %}нет local={% endif %} -
- - - -
-
Записей не найдено.
+
+
+
+ XRAY + {{ xray_records|length }} доменов +
+ {{ dns_services['xray']['ip'] }} +
+ + + + {% for r in xray_records %} + + + + + + {% else %} + + {% endfor %} + +
DomainIPv6
{{ r.domain }}{% if r.ipv6_blocked %}заблокирован{% else %}нет local={% endif %} +
+ + + +
+
Нет доменов, направленных через XRAY.
+
+ +
+
+
+ ByeDPI + {{ byedpi_records|length }} доменов +
+ {{ dns_services['byedpi']['ip'] }} +
+ + + + {% for r in byedpi_records %} + + + + + + {% else %} + + {% endfor %} + +
DomainIPv6
{{ r.domain }}{% if r.ipv6_blocked %}заблокирован{% else %}нет local={% endif %} +
+ + + +
+
Нет доменов, направленных через ByeDPI.
+
+ + {% if other_dns_records %} +
+
+
+ Другие маршруты + {{ other_dns_records|length }} +
+ IP не соответствует XRAY/ByeDPI +
+ + + + {% for r in other_dns_records %} + + + + + + + {% endfor %} + +
DomainIPv4IPv6
{{ r.domain }}{{ r.ip }}{% if r.ipv6_blocked %}заблокирован{% else %}нет local={% endif %} +
+ + + +
+
+
+ {% endif %}
Результат dnsmasq --test
{{ dns_status }}