v1.2.6: instance dropdown: outputs only + cloud button + RUNNING highlight

scenario-form.js:
- renderStepRow: non-create dropdown shows only 🆕 outputs by default
- «📥 Из облака» button toggles cloud autotest-* instances in same select
- toggleCloudInstances(idx): snapshot, flip _showCloud flag, re-render
- Button label: 📥 Из облака ↔  Скрыть облако

scenario-list.js:
- RUNNING status: yellow background #fef3c7 on both loadScenarios() and runScenario() polling
This commit is contained in:
2026-07-31 12:29:43 +04:00
parent 74c22d2612
commit cc60f9401a
3 changed files with 20 additions and 9 deletions
+4 -2
View File
@@ -41,7 +41,8 @@ async function loadScenarios(){
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+=`<div style="font-size:11px;margin-top:4px;color:var(--muted);">Последний: ${icon} ${_esc(last.scenario_name)}${last.status} (шаг ${last.current_step}/${last.total_steps}) ${last.duration_sec!=null?last.duration_sec.toFixed(1)+'s':''}${time}</div>`;
const runningStyle = last.status==='RUNNING' ? 'background:#fef3c7;padding:2px 4px;border-radius:3px;' : '';
html+=`<div style="font-size:11px;margin-top:4px;color:var(--muted);${runningStyle}">Последний: ${icon} ${_esc(last.scenario_name)}${last.status} (шаг ${last.current_step}/${last.total_steps}) ${last.duration_sec!=null?last.duration_sec.toFixed(1)+'s':''}${time}</div>`;
if(last.error_log) html+=`<div style="font-size:10px;color:var(--destructive);">${_esc(last.error_log)}</div>`;
}
body.innerHTML=html;
@@ -68,7 +69,8 @@ async function runScenario(defId){
if(!last||last.error) return;
const icon=last.status==='OK'?'✅':last.status==='FAIL'?'❌':last.status==='RUNNING'?'⏳':'⏱';
const time=last.created_at?last.created_at.replace('T',' ').substring(0,19):'?';
let html=`<div style="font-size:11px;">${icon} ${_esc(last.scenario_name)}${last.status} (шаг ${last.current_step}/${last.total_steps}) ${last.duration_sec!=null?last.duration_sec.toFixed(1)+'s':''}${time}</div>`;
const runningBg = last.status==='RUNNING' ? 'background:#fef3c7;padding:2px 4px;border-radius:3px;' : '';
let html=`<div style="font-size:11px;${runningBg}">${icon} ${_esc(last.scenario_name)}${last.status} (шаг ${last.current_step}/${last.total_steps}) ${last.duration_sec!=null?last.duration_sec.toFixed(1)+'s':''}${time}</div>`;
if(last.error_log) html+=`<div style="font-size:10px;color:var(--destructive);">${_esc(last.error_log)}</div>`;
body.innerHTML=html;
if(last.status!=='RUNNING'){