Commit Graph
10 Commits
Author SHA1 Message Date
naeel cc60f9401a 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
2026-07-31 12:29:43 +04:00
naeel 74c22d2612 v1.2.5: parameter editor with auto-load from API + params-render.js
Phase 1: paramDefsCache, step.params as {name:value}
Phase 2: resolveStepSvcOpId() → loadStepParams() via /api/params
Phase 3: <details> in step card, renderParamRow with pre-fill (clone def + saved values)
Phase 4: snapshotStepParams() before re-render, reset on operation change
Phase 5: collectFormSteps via collectParams() + numeric→name reverse mapping

Only scenario-form.js changed. params-render.js, api_test.py, _resolve_params unchanged.
Compatible with existing scenarios (symbolic names in DB).
2026-07-31 12:00:50 +04:00
naeel eb517594bc v1.2.4: collapsible help section in scenario editor modal
scenario-form.js: <details> block between name and steps:
- How steps work (operation → target)
- Create: service + output name
- Non-create: instance from scenario or cloud
- Parameters: key=value format with example
- Buttons: ↑↓ reorder, ✕ delete
2026-07-31 11:49:04 +04:00
naeel 622a7c7023 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
2026-07-31 11:40:29 +04:00
naeel 15f5ebe647 v1.2.2: modal scenario editor with dropdowns + output/ref
scenario-form.js — full rewrite:
- Full-screen modal (backdrop + content, 800px max-width)
- Services dropdown (GET /api/services, cached)
- Operations dropdown (GET /api/operations/{svcId}, cached)
- output field for create steps
- instance_ref dropdown (previous outputs) + explicit instance_uid
- [↑][↓] reorder buttons
- Auto-load operations on service change

index.html — modal CSS (#scenario-modal, .modal-backdrop, .modal-content)
2026-07-31 10:19:26 +04:00
naeel 353e07bfa8 v1.2.1: fix tracker_add in executor + labelCls + descr context + script order
Opus review fixes:
- executor.py: tracker_add inside executor after instance_uid, before params/run (A3, orphan protection)
- executor.py: descr parameter (version/context instead of hardcoded)
- api_test.py: pass client_id/stand/descr, remove duplicate tracker_add
- scenario.py: pass client_id/stand/descr with scenario context
- params-render.js: fix labelCls ReferenceError in renderMapFixedRow (pre-existing bug)
- index.html: params-render.js already before operations.js (verified)
2026-07-31 09:45:05 +04:00
naeel 91e97f6f75 v1.2.0: unified executor + flexible instance refs + params-render.js
Phase 1 — New modules:
- api/utils.py: find_uid(), uid_from_location() (replaces 2 duplicates)
- operations/poll.py: poll_until_done() (shared sync/async polling)
- operations/executor.py: execute_operation() (single CREATE/non-CREATE flow)

Phase 2 — Format + validation:
- routes/api_scenario_defs.py: _validate_steps with output/instance_ref/instance_uid
- operations/scenario.py: resolve instance_uid > instance_ref > service_id,
  use executor + poll_until_done, persist instance_bindings

Phase 3 — Migration:
- routes/api_test.py: create/non-create through executor, _finish_op through poll_until_done
- db/init_db.py: startup cleanup of stuck scenario_runs (>1h)

Phase 4 — UI shared module:
- static/js/params-render.js: renderParamRow, renderMapFixedRow, collectParams
- static/js/operations.js: use params-render.js (remove duplicates)
- templates/index.html: include params-render.js
- app.py: bump 1.1.57 → 1.2.0
2026-07-31 08:55:06 +04:00
naeel 38f58ddbd7 v1.1.57: fix scenario editor body bug + relativeTime columns + infra UUIDs
- scenario-form.js: fix ReferenceError body is not defined in renderEditor()
- utils.js: relativeTime(iso) → 3ч 12м / 2д 5ч / только что
- instances.js: columns created / modified with relativeTime()
- index.html: instanceUid under displayName in infra column
2026-07-30 22:22:19 +04:00
naeel 7ae172e863 v1.1.56: fix JS load order — selectService() moved to app.js (was calling stopPoll before operations.js loaded) 2026-07-30 22:09:26 +04:00
naeel a96658b9b5 v1.1.55: split large files + CRUD scenario editor
Backend (5→7 files):
- api_test.py: 622→479, terraform functions → operations/terraform.py (142)
- api_scenario.py: 241→split into run (153) + defs (108) with _validate_steps()
- db/scenario_defs.py: +client_id, stand, is_seed in list_definitions

Frontend (1→10 files):
- app.js: 554→16 (loader), split into:
  utils.js (45), instances.js (89), operations.js (249),
  history.js (35), scenario-list.js (90)
- New CRUD: scenario-form.js (128), create (25), edit (12), delete (13)

Max file size: JS 249, PY 479
2026-07-30 22:02:22 +04:00