diff --git a/site/app.py b/site/app.py index 4be2fba..0ec72e0 100644 --- a/site/app.py +++ b/site/app.py @@ -19,7 +19,7 @@ from routes.api_scenario_run import bp_run as api_scenario_run_bp from routes.api_scenario_defs import bp_defs as api_scenario_defs_bp # Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI. -VERSION = "1.2.8" +VERSION = "1.2.9" app = Flask(__name__, template_folder="templates", static_folder="static") app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc") diff --git a/site/static/js/views.js b/site/static/js/views.js new file mode 100644 index 0000000..8f65f6b --- /dev/null +++ b/site/static/js/views.js @@ -0,0 +1,22 @@ +// views.js — переключение видов (sidebar navigation) + +function switchView(viewId) { + document.querySelectorAll('.view').forEach(v => v.classList.add('hidden')); + const target = document.getElementById('view-' + viewId); + if (target) target.classList.remove('hidden'); + // Подсветка активного пункта + document.querySelectorAll('.sidebar-item').forEach(el => el.classList.remove('active')); + const btn = document.querySelector('.sidebar-item[data-view="' + viewId + '"]'); + if (btn) btn.classList.add('active'); + // Автозагрузка при открытии вида + if (viewId === 'history-view' && typeof toggleHistory === 'function') { + if (!historyOpen) toggleHistory(); + } + if (viewId === 'scenarios-view' && typeof toggleScenario === 'function') { + if (!scenarioOpen) toggleScenario(); + } + if (viewId === 'logs-view' && typeof toggleLog === 'function') { + const lp = document.getElementById('log-panel'); + if (lp && lp.style.display === 'none') toggleLog(); + } +} diff --git a/site/templates/index.html b/site/templates/index.html index ea6193a..8995382 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -6,15 +6,9 @@ - + -
- Nubes - v{{ config.VERSION }} - {% if token_info.email %}EMail: {{ token_info.email }} | Профиль: {{ token_info.company }} | Стенд: {{ stand.upper() }}{% endif %} - -
- - - {% if has_user_token %}{% endif %} -
- {% if error %}{{ error }}{% endif %} + +
+
Верстак
+
+
+
+
Сервисы
+
+ {% for svc in services %}{% if svc.svcId in config.service_ids %}
{{ svc.svcId }}. {{ svc.svc }}
{% endif %}{% endfor %} +
+
+
+
+
+
Инстансы
+
+ Загрузка... +
+
+ +
+
+ + Создать новый инстанс +
+
+
+
-
- -
- {% if organization %} -
-
Организация
-
- {{ organization.displayName }}{% if client_id %} ({{ client_id }}){% endif %}
- {{ organization.explainedStatus or "OK" }} -
+ + - -
-
-
Сервисы
-
- {% for svc in services %}{% if svc.svcId in config.service_ids %}
{{ svc.svcId }}. {{ svc.svc }}
{% endif %}{% endfor %} -
+ + - -
-
-
Инстансы
-
- Загрузка... -
-
- -
-
- + Создать новый инстанс -
-
-
-
История (последние 50)
- -
-
-
Сценарии (автотесты)
- + + + + + + @@ -165,8 +178,8 @@ window.APP = { - - + + - \ No newline at end of file +