From a0a17e183f19c4fc83f288801533529c26bbbfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Thu, 30 Jul 2026 08:33:03 +0400 Subject: [PATCH] v1.1.38: operations per instance svcId + operation name header --- site/app.py | 2 +- site/static/app.js | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/site/app.py b/site/app.py index 0237966..d0de03c 100644 --- a/site/app.py +++ b/site/app.py @@ -18,7 +18,7 @@ from routes.api import bp as api_bp from routes.api_test import bp as api_test_bp # Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI. -VERSION = "1.1.37" +VERSION = "1.1.38" 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/app.js b/site/static/app.js index f6c34ac..d35ccc6 100644 --- a/site/static/app.js +++ b/site/static/app.js @@ -78,11 +78,12 @@ async function toggleInstance(iuid){ if(opsEl.classList.contains('open')){opsEl.classList.remove('open');return;} document.querySelectorAll('.inst-ops').forEach(e=>e.classList.remove('open')); - const r=await fetch('/api/operations/'+currentSvcId); + // Операции для ИНСТАНСА, не для выбранного сервиса + const inst=svcInstances.find(x=>x.instanceUid===iuid); + const svcId=inst?inst.serviceId:currentSvcId; + const r=await fetch('/api/operations/'+svcId); const d=await r.json(); let ops=d.operations.filter(o=>o.operation!=='reconcile'&&o.operation!=='create'); - // Для недосозданных инстансов — только delete - const inst=svcInstances.find(x=>x.instanceUid===iuid); if(inst&&(inst.status||inst.explainedStatus)==='not created'){ ops=ops.filter(o=>o.operation==='delete'); } @@ -160,8 +161,8 @@ function showParams(opId,opName){ const form=document.getElementById('params-form'); const displayNameValue=isCreate?makeCreateDisplayName():''; const createHeader=isCreate?`
Создание: ${currentSvcName}
`:''; - const emptyOpHeader=(!isCreate&¶ms.length===0)?`
Операция: ${_esc(opName)}${_esc(findInstName())}
`:''; - form.innerHTML=createHeader+emptyOpHeader+(opName==='create'?`
${AUTOTEST_PREFIX}
`:'') + const opHeader=!isCreate?`
${_esc(opName)} → ${_esc(findInstName())}
`:''; + form.innerHTML=createHeader+opHeader+(opName==='create'?`
${AUTOTEST_PREFIX}
`:'') + params.map(p=>{ const req=p.isRequired; const hasDfl=p.defaultValue!==null&&p.defaultValue!==undefined&&p.defaultValue!=='';