feat: селектор режима и стенда (v1.2.30)
Новое: - Селектор режима (🎭 Эмуляция / ☁️ Облако) над версией - Селектор стенда (DEV/TEST/PROD) в режиме эмуляции - В эмуляции — всё в полигон (/stand/api/v1/svc) - В эмуляции — токен дезактивирован - По умолчанию: эмуляция + TEST Изменено: - auth.py: get_mode(), get_polygon_stand(), get_client() с префиксом стенда - main.py: action=set_mode, единый get_client() вместо real_client/inst_client - index.html: селекторы, disable токена - service_list.py: обрезка polygon_ префикса - api_test.py: get_real_client → get_client Задокументировано в HISTORY/2026-08-03-session.md.
This commit is contained in:
@@ -59,11 +59,27 @@
|
||||
<button class="sidebar-item" data-view="logs-view" onclick="switchView('logs-view')">📜 Логи</button>
|
||||
</div>
|
||||
<div class="sidebar-bottom">
|
||||
<div style="padding:4px 12px;font-size:10px;color:var(--muted);">v{{ config.VERSION }} | {{ stand.upper() }}</div>
|
||||
{% 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>
|
||||
{% 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>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endif %}
|
||||
<div style="padding:4px 12px;font-size:10px;color:var(--muted);">v{{ config.VERSION }} | {{ stand.upper().replace('_', ' ') }}</div>
|
||||
{% if token_info.email %}<div style="padding:0 12px 4px;font-size:10px;color:var(--muted);">{{ token_info.email }}</div>{% endif %}
|
||||
<form method="post" class="token-row">
|
||||
<input type="password" name="token" placeholder="env: {{ env_token_masked }}" value="{{ '' if not has_user_token else '••••••••' }}" />
|
||||
<button type="submit" name="action" value="save" class="btn btn-sm">OK</button>
|
||||
<input type="password" name="token" placeholder="env: {{ env_token_masked }}" value="{{ '' if not has_user_token else '••••••••' }}" {% if mode == 'polygon' %}disabled style="opacity:0.4;"{% endif %} />
|
||||
<button type="submit" name="action" value="save" class="btn btn-sm" {% if mode == 'polygon' %}disabled{% endif %}>OK</button>
|
||||
{% if has_user_token %}<button type="submit" name="action" value="clear" class="btn btn-sm" style="color:var(--destructive);">✕</button>{% endif %}
|
||||
</form>
|
||||
{% if error %}<div style="padding:4px 12px;font-size:10px;color:var(--destructive);">{{ error }}</div>{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user