Full Terraform logic: svcOperationId, /run, dtFinish, stages in UI, v1.0.41
This commit is contained in:
@@ -91,6 +91,7 @@
|
||||
<button class="btn btn-primary btn-sm" onclick="runTest()" id="btn-test" style="display:none;">Запустить тест</button>
|
||||
<span id="test-status" style="font-size:11px;margin-left:8px;"></span>
|
||||
</div>
|
||||
<div id="stages-box" style="display:none;padding:0 8px 8px;max-height:200px;overflow-y:auto;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -198,6 +199,9 @@ async function runTest(){
|
||||
const btn=document.getElementById('btn-test');
|
||||
btn.disabled=true;
|
||||
document.getElementById('test-status').textContent=' ⏳ выполняется...';
|
||||
const stagesBox=document.getElementById('stages-box');
|
||||
stagesBox.style.display='block';
|
||||
stagesBox.innerHTML='';
|
||||
|
||||
const params={};
|
||||
document.querySelectorAll('#params-form [name^="p_"]').forEach(el=>{
|
||||
@@ -220,7 +224,19 @@ async function runTest(){
|
||||
const d=await r.json();
|
||||
const cls=d.status==='OK'?'badge badge-success':'badge';
|
||||
document.getElementById('test-status').innerHTML=` <span class="${cls}">${d.status}</span> ${d.error||''} ${d.duration||''}s`;
|
||||
if(d.status==='OK'){await selectService(SVC_ID);}
|
||||
|
||||
// Показать стадии
|
||||
if(d.stages&&d.stages.length){
|
||||
let sh='<div style="font-size:11px;font-weight:600;color:var(--muted);margin-top:4px;">Этапы</div>';
|
||||
d.stages.forEach(s=>{
|
||||
const ok=s.isSuccessful;
|
||||
const icon=ok===true?'✅':ok===false?'❌':'⏳';
|
||||
sh+=`<div style="font-size:11px;padding:2px 0;">${icon} ${s.stage} — ${(s.duration||0).toFixed(1)}s</div>`;
|
||||
});
|
||||
stagesBox.innerHTML=sh;
|
||||
}
|
||||
|
||||
if(d.status==='OK'&&selectedOp.opName==='create'){await selectService(SVC_ID);}
|
||||
}catch(e){
|
||||
document.getElementById('test-status').textContent=' Ошибка: '+e.message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user