v1.2.12: scenario list — clean header row + action buttons in expanded view

- Header: name | step count | seed badge (no CRUD buttons)
- Expanded view: ▶ Запустить ✏ Редактировать 📋 Копировать 🗑 Удалить
  (same size, aligned, with labels)
- Delete hidden for seed scenarios
This commit is contained in:
2026-07-31 14:02:50 +04:00
parent bfa21accf5
commit beaff3f1cf
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -24,13 +24,10 @@ async function loadScenarios(){
sr.forEach(s=>{
const seed = s.is_seed;
html+=`<div style="border:1px solid var(--brand-gray);border-radius:4px;padding:4px 6px;">`;
html+=`<div style="display:flex;align-items:center;gap:4px;cursor:pointer;" onclick="toggleScenarioSteps(${s.id})">`;
html+=`<div style="display:flex;align-items:center;gap:8px;cursor:pointer;padding:4px 0;" onclick="toggleScenarioSteps(${s.id})">`;
html+=`<span style="font-size:13px;font-weight:600;flex:1;">${_esc(s.name)}</span>`;
html+=`<span style="color:var(--muted);font-size:11px;">${s.steps} шагов</span>`;
if(!seed) html+=`<button class="btn btn-sm" style="font-size:12px;padding:0 6px;" onclick="event.stopPropagation();editScenario(${s.id})" title="Редактировать">✏</button>`;
html+=`<button class="btn btn-sm" style="font-size:12px;padding:0 6px;" onclick="event.stopPropagation();cloneScenario(${s.id},'${_esc(s.name)}')" title="Копировать">📋</button>`;
if(!seed) html+=`<button class="btn btn-sm" style="font-size:12px;padding:0 6px;color:var(--destructive);" onclick="event.stopPropagation();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+=`<span style="color:var(--muted);font-size:11px;min-width:50px;">${s.steps} шаг.</span>`;
if(seed) html+=`<span style="font-size:9px;color:var(--muted);">seed</span>`;
html+=`</div>`;
html+=`<div id="scenario-steps-${s.id}" style="display:none;margin-top:4px;padding-left:8px;"></div>`;
html+=`</div>`;
@@ -75,6 +72,9 @@ async function toggleScenarioSteps(defId) {
html += '</div>';
});
html += `<button class="btn btn-sm" style="margin-top:4px;font-size:11px;background:var(--brand-primary);color:#fff;" onclick="event.stopPropagation();runScenario(${defId})">▶ Запустить</button>`;
html += `<button class="btn btn-sm" style="margin-top:4px;margin-left:4px;font-size:11px;" onclick="event.stopPropagation();editScenario(${defId})">✏ Редактировать</button>`;
html += `<button class="btn btn-sm" style="margin-top:4px;margin-left:4px;font-size:11px;" onclick="event.stopPropagation();cloneScenario(${defId},'${_esc(def.name)}')">📋 Копировать</button>`;
if (!def.is_seed) html += `<button class="btn btn-sm" style="margin-top:4px;margin-left:4px;font-size:11px;color:var(--destructive);" onclick="event.stopPropagation();deleteScenario(${defId},'${_esc(def.name)}')">🗑 Удалить</button>`;
html += '</div>';
el.innerHTML = html;
el.style.display = 'block';