diff --git a/site/app.py b/site/app.py
index 75f1193..c92df55 100644
--- a/site/app.py
+++ b/site/app.py
@@ -19,7 +19,7 @@ from routes.api_scenario_run import bp_run as api_scenario_run_bp
from routes.api_scenario_defs import bp_defs as api_scenario_defs_bp
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
-VERSION = "1.2.3"
+VERSION = "1.2.4"
app = Flask(__name__, template_folder="templates", static_folder="static")
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc")
diff --git a/site/static/js/scenario-form.js b/site/static/js/scenario-form.js
index 47a3765..a30a395 100644
--- a/site/static/js/scenario-form.js
+++ b/site/static/js/scenario-form.js
@@ -55,6 +55,18 @@ function renderEditor() {
html += '
';
html += ``;
html += '
';
+ // Справка
+ html += `
+ 📖 Как заполнять
+
+ Шаг: выбери операцию → укажи цель.
+ Create: выбери сервис + задай output (имя, например d1). Другие шаги смогут ссылаться на него.
+ Остальные операции: выбери инстанс — 🆕 из create-шагов этого сценария или ☁ из облака.
+ Параметры: key = value (символические коды, как в API).
+ Пример: durationMs = 5000
+ [↑][↓] — порядок шагов, [✕] — удалить шаг.
+
+ `;
// Шаги
html += '
Шаги
';
st.steps.forEach((s, idx) => { html += renderStepRow(idx, s); });
@@ -69,25 +81,10 @@ function renderEditor() {
function renderStepRow(idx, step) {
const st = scenarioEditorState;
- const svcId = step.service_id;
const op = step.operation;
const out = step.output || '';
const ref = step.instance_ref || '';
- // Сервисы — dropdown
- let svcOpts = '';
- st.services.forEach(s => {
- svcOpts += ``;
- });
-
- // Операции — dropdown (из кеша или базовый)
- let opOpts = '';
- const ops = st.opsCache[svcId] || ['create', 'delete', 'modify', 'suspend', 'resume', 'redeploy'];
- ops.forEach(o => {
- const oName = typeof o === 'string' ? o : o.operation;
- opOpts += ``;
- });
-
// Output refs из предыдущих create-шагов
const prevOutputs = [];
for (let i = 0; i < idx; i++) {
@@ -103,31 +100,37 @@ function renderStepRow(idx, step) {
html += ``;
html += ``;
- // Сервис + Операция в одной строке
- html += `
`;
- html += ``;
- html += ``;
- html += `
`;
+ // 1. Операция ВСЕГДА первая
+ const allOps = ['create', 'delete', 'modify', 'suspend', 'resume', 'redeploy'];
+ let opOpts = '';
+ allOps.forEach(o => { opOpts += ``; });
+ html += ``;
- // Output / instance_ref / instance_uid
- html += '
';
+ // 2. В зависимости от операции
if (op === 'create') {
- html += ``;
- } else if (op) {
- // Предыдущие output'ы + облачные инстансы этого сервиса
- let refOpts = '';
- // output'ы из предыдущих create-шагов
- prevOutputs.forEach(o => { refOpts += ``; });
- // Облачные инстансы того же сервиса
- const cloudInsts = (st.cloudInstances || []).filter(i => i.serviceId == svcId && i.explainedStatus !== 'deleted');
- if (cloudInsts.length) refOpts += '';
- cloudInsts.forEach(i => {
- const sel = i.instanceUid == ref ? 'selected' : '';
- refOpts += ``;
+ // Сервис
+ let svcOpts = '';
+ st.services.forEach(s => {
+ svcOpts += ``;
});
- html += ``;
+ html += ``;
+ html += ``;
+ } else if (op) {
+ // Инстанс — облачные + предыдущие output'ы
+ let refOpts = '';
+ // output'ы из create-шагов
+ prevOutputs.forEach(o => { refOpts += ``; });
+ // Облачные инстансы
+ if (st.cloudInstances && st.cloudInstances.length) {
+ refOpts += '';
+ st.cloudInstances.forEach(i => {
+ if (i.explainedStatus === 'deleted') return;
+ const sel = i.instanceUid == ref ? 'selected' : '';
+ refOpts += ``;
+ });
+ }
+ html += ``;
}
- html += '