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 @@
- + -