feat: радиокнопки вместо select для режима/стенда (v1.2.32)

- index.html: radio buttons (🎭/☁️ для режима, DEV/TEST/PROD для стенда)
- main.py: set_mode сохраняет polygon_stand из cookie если не в форме
  (нужно при Облако→Эмуляция — радио стенда нет в DOM)
This commit is contained in:
2026-08-03 09:13:57 +04:00
parent 9a801e6bff
commit 4915d17555
3 changed files with 23 additions and 11 deletions
+19 -9
View File
@@ -62,16 +62,26 @@
{% if polygon_enabled %}
<form method="post" style="padding:4px 12px 2px;">
<input type="hidden" name="action" value="set_mode" />
<select name="mode" onchange="this.form.submit()" style="width:100%;height:26px;font-size:11px;padding:0 4px;border:1px solid var(--brand-gray);border-radius:3px;background:#fff;margin-bottom:3px;">
<option value="polygon" {% if mode == 'polygon' %}selected{% endif %}>🎭 Эмуляция</option>
<option value="cloud" {% if mode == 'cloud' %}selected{% endif %}>☁️ Облако</option>
</select>
<div style="display:flex;gap:8px;margin-bottom:4px;">
<label style="font-size:10px;cursor:pointer;display:flex;align-items:center;gap:2px;color:var(--muted);">
<input type="radio" name="mode" value="polygon" onclick="this.form.submit()" {% if mode == 'polygon' %}checked{% endif %} /> 🎭
</label>
<label style="font-size:10px;cursor:pointer;display:flex;align-items:center;gap:2px;color:var(--muted);">
<input type="radio" name="mode" value="cloud" onclick="this.form.submit()" {% if mode == 'cloud' %}checked{% endif %} /> ☁️
</label>
</div>
{% if mode == 'polygon' %}
<select name="polygon_stand" onchange="this.form.submit()" style="width:100%;height:26px;font-size:11px;padding:0 4px;border:1px solid var(--brand-gray);border-radius:3px;background:#fff;">
<option value="dev" {% if polygon_stand == 'dev' %}selected{% endif %}>DEV</option>
<option value="test" {% if polygon_stand == 'test' %}selected{% endif %}>TEST</option>
<option value="prod" {% if polygon_stand == 'prod' %}selected{% endif %}>PROD</option>
</select>
<div style="display:flex;gap:6px;">
<label style="font-size:10px;cursor:pointer;color:var(--muted);">
<input type="radio" name="polygon_stand" value="dev" onclick="this.form.submit()" {% if polygon_stand == 'dev' %}checked{% endif %} /> DEV
</label>
<label style="font-size:10px;cursor:pointer;color:var(--muted);">
<input type="radio" name="polygon_stand" value="test" onclick="this.form.submit()" {% if polygon_stand == 'test' %}checked{% endif %} /> TEST
</label>
<label style="font-size:10px;cursor:pointer;color:var(--muted);">
<input type="radio" name="polygon_stand" value="prod" onclick="this.form.submit()" {% if polygon_stand == 'prod' %}checked{% endif %} /> PROD
</label>
</div>
{% endif %}
</form>
{% endif %}