From 4915d17555613f396c1ee9b69628e25a46adb8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Mon, 3 Aug 2026 09:13:57 +0400 Subject: [PATCH] =?UTF-8?q?feat:=20=D1=80=D0=B0=D0=B4=D0=B8=D0=BE=D0=BA?= =?UTF-8?q?=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=BE=20select=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B5=D0=B6=D0=B8?= =?UTF-8?q?=D0=BC=D0=B0/=D1=81=D1=82=D0=B5=D0=BD=D0=B4=D0=B0=20(v1.2.32)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - index.html: radio buttons (🎭/☁️ для режима, DEV/TEST/PROD для стенда) - main.py: set_mode сохраняет polygon_stand из cookie если не в форме (нужно при Облако→Эмуляция — радио стенда нет в DOM) --- site/app.py | 2 +- site/routes/main.py | 4 +++- site/templates/index.html | 28 +++++++++++++++++++--------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/site/app.py b/site/app.py index 330d13c..74322ed 100644 --- a/site/app.py +++ b/site/app.py @@ -32,7 +32,7 @@ from routes.api_scenario_defs import bp_defs as api_scenario_defs_bp # Версия — показывается в топбаре UI. Меняется при КАЖДОМ изменении кода. # Нужна для фильтрации истории (пользователь видит только записи своей версии). -VERSION = "1.2.31" +VERSION = "1.2.32" # Flask-приложение с Jinja2-шаблонами из папки templates/ app = Flask(__name__, template_folder="templates", static_folder="static") diff --git a/site/routes/main.py b/site/routes/main.py index 27a0b37..ba41dd7 100644 --- a/site/routes/main.py +++ b/site/routes/main.py @@ -107,7 +107,9 @@ def index(): # Обработка action=set_mode: сохранить режим и стенд в cookie if action == "set_mode": new_mode = request.form.get("mode", "polygon") - new_stand = request.form.get("polygon_stand", "test") + # polygon_stand: из формы, иначе — сохранить предыдущее значение из cookie + # (нужно при переключении Облако→Эмуляция — радио стенда нет в DOM) + new_stand = request.form.get("polygon_stand") or request.cookies.get("polygon_stand", "test") resp = make_response(redirect("/")) resp.set_cookie("mode", new_mode, max_age=60*60*24*365, httponly=True, samesite="Strict", secure=True) resp.set_cookie("polygon_stand", new_stand, max_age=60*60*24*365, httponly=True, samesite="Strict", secure=True) diff --git a/site/templates/index.html b/site/templates/index.html index d7ef667..87213e9 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -62,16 +62,26 @@ {% if polygon_enabled %}
- +
+ + +
{% if mode == 'polygon' %} - +
+ + + +
{% endif %}
{% endif %}