Files
autotest/DOCS/opus-instance-dropdown-questions.md

46 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Вопросы к Опусу — instance dropdown + RUNNING highlight
## Контекст
Проект: Nubes Autotest v1.2.5, Flask + vanilla JS + PostgreSQL.
Файл: `/home/naeel/nubes/autotest/app-autotest/site/static/js/scenario-form.js`
Для не-create операций (modify, delete, suspend, resume, redeploy) нужно выбрать инстанс.
**Что уже сделано (в рабочей копии, не закоммичено):**
- Дропдаун показывает ТОЛЬКО 🆕 output'ы предыдущих create-шагов
- Кнопка «📥 Из облака» — есть в разметке, функция `toggleCloudInstances(idx)` не написана
- Облачные инстансы загружены в `scenarioEditorState.cloudInstances`
## Вопросы
### 1. Фильтр облачных инстансов
Показывать только `displayName.startsWith('autotest-')`. Чужие инстансы — опасно.
### 2. Реализация кнопки «📥 Из облака»
При клике:
- Отфильтровать `st.cloudInstances`: `autotest-*` + `explainedStatus !== 'deleted'`
- Добавить `<option disabled>── облако ──</option>` в основной `<select id="step-{idx}-ref">`
- Затем добавить `<option>` для каждого: `☁ displayName — svc (status)`, value = instanceUid
- При повторном клике — убрать облачные option'ы (оставить output'ы)
Фильтр по `service_id` — не нужен, показывать все `autotest-*`.
### 3. Яркий фон для RUNNING
Файл: `/home/naeel/nubes/autotest/app-autotest/site/static/js/scenario-list.js`
В `loadScenarios()` строка:
```
html+=`<div style="...">Последний: ${icon} ${...} — ${last.status} ...</div>`;
```
Если `last.status === 'RUNNING'``background:#fef3c7;padding:2px 4px;border-radius:3px;`.
На кнопке `▶` — не надо.
---
Пиши ответ прямо в чат текстом.