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
+15 -6
View File
@@ -221,15 +221,19 @@ function renderStepRow(idx, step) {
} else if (op) {
let refOpts = '<option value="">— инстанс —</option>';
prevOutputs.forEach(o => { refOpts += `<option value="${o}" ${o == ref ? 'selected' : ''}>🆕 ${_esc(o)} (из шага)</option>`; });
if (st.cloudInstances && st.cloudInstances.length) {
// Облачные autotest-* инстансы (только если раскрыты)
if (step._showCloud && st.cloudInstances) {
refOpts += '<option disabled>── облако ──</option>';
st.cloudInstances.forEach(i => {
if (i.explainedStatus === 'deleted') return;
const dn = i.displayName || '';
if (!dn.startsWith('autotest-') || i.explainedStatus === 'deleted') return;
const sel = i.instanceUid == ref ? 'selected' : '';
refOpts += `<option value="${i.instanceUid}" ${sel}>☁ ${_esc(i.displayName)}${_esc(i.svc||'')} (${_esc(i.explainedStatus||'?')})</option>`;
refOpts += `<option value="${i.instanceUid}" ${sel}>☁ ${_esc(dn)}${_esc(i.svc||'')} (${_esc(i.explainedStatus||'?')})</option>`;
});
}
html += `<div><select id="step-${idx}-ref" style="padding:4px;font-size:12px;max-width:500px;">${refOpts}</select></div>`;
const btnLabel = step._showCloud ? '➖ Скрыть облако' : '📥 Из облака';
html += `<div style="display:flex;gap:4px;align-items:center;"><select id="step-${idx}-ref" style="padding:4px;font-size:12px;max-width:500px;">${refOpts}</select>`;
html += `<button class="btn btn-sm" style="font-size:10px;padding:0 6px;" onclick="toggleCloudInstances(${idx})">${btnLabel}</button></div>`;
}
// Параметры — свёрнутый <details>, заполняется асинхронно в loadStepParams
@@ -242,15 +246,20 @@ function renderStepRow(idx, step) {
// ── Действия ──
function onOpChange(idx) {
// Сброс params при смене операции (несовместимы)
scenarioEditorState.steps[idx].params = {};
scenarioEditorState.steps[idx]._svcOpId = null;
renderEditor();
}
function toggleCloudInstances(idx) {
snapshotAllParams();
scenarioEditorState.steps[idx]._showCloud = !scenarioEditorState.steps[idx]._showCloud;
renderEditor();
}
function addStep() {
snapshotAllParams();
scenarioEditorState.steps.push({ service_id: '', operation: '', output: '', instance_ref: '', instance_uid: '', params: {} });
scenarioEditorState.steps.push({ service_id: '', operation: '', output: '', instance_ref: '', instance_uid: '', params: {}, _showCloud: false });
renderEditor();
}