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 %}
{% endif %}