diff --git a/site/app.py b/site/app.py index 95de4d3..06890ac 100644 --- a/site/app.py +++ b/site/app.py @@ -18,7 +18,7 @@ from routes.api_test import bp as api_test_bp from routes.api_scenario import bp as api_scenario_bp # Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI. -VERSION = "1.1.52" +VERSION = "1.1.53" 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/routes/api_scenario.py b/site/routes/api_scenario.py index 0bd70be..a4595d6 100644 --- a/site/routes/api_scenario.py +++ b/site/routes/api_scenario.py @@ -120,7 +120,7 @@ def api_scenario_run_status(run_id): cur = conn.cursor() cur.execute(""" SELECT id, created_at, scenario_name, status, current_step, total_steps, - duration_sec, error_log + duration_sec, error_log, app_version FROM scenario_runs WHERE id = %s AND client_id = %s AND stand = %s """, (run_id, get_client_id(), get_stand())) @@ -148,7 +148,7 @@ def api_scenario_status(): cur = conn.cursor() cur.execute(""" SELECT id, created_at, scenario_name, status, current_step, total_steps, - duration_sec, error_log + duration_sec, error_log, app_version FROM scenario_runs WHERE client_id = %s AND stand = %s ORDER BY created_at DESC diff --git a/site/static/app.js b/site/static/app.js index 24e4115..31704b4 100644 --- a/site/static/app.js +++ b/site/static/app.js @@ -497,9 +497,11 @@ async function loadScenarios(){ }else{ html+='Нет сценариев в БД'; } - // Последний запуск - if(srHistory && srHistory.length){ - const last=srHistory[0]; + // Последний запуск — только для текущей версии приложения + const curVer=window.APP&&window.APP.version||''; + const verHistory=srHistory&&srHistory.filter(r=>r.app_version===curVer); + if(verHistory && verHistory.length){ + const last=verHistory[0]; const icon=last.status==='OK'?'✅':last.status==='FAIL'?'❌':last.status==='RUNNING'?'⏳':'⏱'; const time=last.created_at?last.created_at.replace('T',' ').substring(0,19):'?'; html+=`