v1.2.3: instance_ref shows cloud instances + bigger CRUD buttons

scenario-form.js:
- showScenarioEditor loads /api/instances/list alongside services
- renderStepRow: non-create instance_ref dropdown shows:
  🆕 outputs from previous create steps
  ☁ existing cloud instances filtered by service_id
- Removed separate instance_uid text field (now in dropdown)

scenario-list.js:
- CRUD buttons: ✏📋🗑 bigger (13px, padding), vertical layout
- Run button: full-width, left-aligned
This commit is contained in:
2026-07-31 11:40:29 +04:00
parent 15f5ebe647
commit 622a7c7023
3 changed files with 29 additions and 17 deletions
+8 -8
View File
@@ -18,17 +18,17 @@ async function loadScenarios(){
fetch('/api/scenario/status').then(r=>r.json()),
]);
let html='';
html+=`<button class="btn btn-sm" style="font-size:10px;margin-bottom:4px;" onclick="createScenario()">+ Создать сценарий</button>`;
html+=`<button class="btn btn-sm" style="font-size:11px;margin-bottom:4px;" onclick="createScenario()">+ Создать сценарий</button>`;
if(sr.length){
html+='<div style="display:flex;flex-wrap:wrap;gap:4px;margin-bottom:4px;">';
html+='<div style="display:flex;flex-direction:column;gap:4px;margin-bottom:4px;">';
sr.forEach(s=>{
const seed = s.is_seed;
html+=`<div style="display:inline-flex;gap:2px;align-items:center;">`;
html+=`<button class="btn btn-sm" style="font-size:11px;" onclick="runScenario(${s.id})" title="Запустить">▶ ${_esc(s.name)} <span style="color:var(--muted);">(${s.steps} шагов)</span></button>`;
if(!seed) html+=`<button class="btn btn-sm" style="font-size:9px;padding:0 4px;" onclick="editScenario(${s.id})" title="Редактировать">✏</button>`;
html+=`<button class="btn btn-sm" style="font-size:9px;padding:0 4px;" onclick="cloneScenario(${s.id},'${_esc(s.name)}')" title="Клонировать"></button>`;
if(!seed) html+=`<button class="btn btn-sm" style="font-size:9px;padding:0 4px;color:var(--destructive);" onclick="deleteScenario(${s.id},'${_esc(s.name)}')" title="Удалить">🗑</button>`;
if(seed) html+=`<span style="font-size:8px;color:var(--muted);">seed</span>`;
html+=`<div style="display:flex;align-items:center;gap:4px;">`;
html+=`<button class="btn btn-sm" style="font-size:12px;flex:1;text-align:left;" onclick="runScenario(${s.id})" title="Запустить">▶ ${_esc(s.name)} <span style="color:var(--muted);">(${s.steps} шагов)</span></button>`;
if(!seed) html+=`<button class="btn btn-sm" style="font-size:13px;padding:0 6px;" onclick="editScenario(${s.id})" title="Редактировать">✏</button>`;
html+=`<button class="btn btn-sm" style="font-size:13px;padding:0 6px;" onclick="cloneScenario(${s.id},'${_esc(s.name)}')" title="Копировать">📋</button>`;
if(!seed) html+=`<button class="btn btn-sm" style="font-size:13px;padding:0 6px;color:var(--destructive);" onclick="deleteScenario(${s.id},'${_esc(s.name)}')" title="Удалить">🗑</button>`;
if(seed) html+=`<span style="font-size:9px;color:var(--muted);padding:0 4px;">seed</span>`;
html+=`</div>`;
});
html+='</div>';