diff --git a/site/app.py b/site/app.py index 6faff28..c0b300d 100644 --- a/site/app.py +++ b/site/app.py @@ -18,7 +18,7 @@ from routes.api import bp as api_bp from routes.api_test import bp as api_test_bp # Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI. -VERSION = "1.0.95" +VERSION = "1.0.96" 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/app.js b/site/static/app.js index ca329e7..e91f8dc 100644 --- a/site/static/app.js +++ b/site/static/app.js @@ -267,6 +267,7 @@ async function executeOp(params){ if(sd.status==='OK'){ await refreshInstances(); } + if(historyOpen) await loadHistory(); } },2000); }catch(e){ @@ -311,6 +312,39 @@ async function refreshInstances(){ document.getElementById('inst-list').innerHTML=html; } +// === История тестов === +let historyOpen=false; +async function toggleHistory(){ + const body=document.getElementById('history-body'); + historyOpen=!historyOpen; + body.style.display=historyOpen?'block':'none'; + if(historyOpen) await loadHistory(); +} +async function loadHistory(){ + const body=document.getElementById('history-body'); + if(!body||body.style.display==='none') return; + try{ + const r=await fetch('/api/history'); + const rows=await r.json(); + if(!rows||!rows.length){body.innerHTML='Нет записей'; return;} + let html='
| Время | Операция | Инстанс | Статус | Длит. |
|---|---|---|---|---|
| ${time} | +${r.op_name||'?'} | +${r.display_name||r.instance_uid||'?'} | +${r.status||'?'} | +${r.duration_sec!=null?r.duration_sec.toFixed(1)+'s':'-'} | +