v1.1.32: not-created instances — only show delete operation

This commit is contained in:
2026-07-29 13:57:51 +04:00
parent d17c84548d
commit b6a497400c
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ from routes.api import bp as api_bp
from routes.api_test import bp as api_test_bp from routes.api_test import bp as api_test_bp
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI. # Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
VERSION = "1.1.31" VERSION = "1.1.32"
app = Flask(__name__, template_folder="templates", static_folder="static") 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") app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc")
+6 -1
View File
@@ -80,7 +80,12 @@ async function toggleInstance(iuid){
const r=await fetch('/api/operations/'+currentSvcId); const r=await fetch('/api/operations/'+currentSvcId);
const d=await r.json(); const d=await r.json();
const ops=d.operations.filter(o=>o.operation!=='reconcile'&&o.operation!=='create'); 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');
}
opsEl.innerHTML=ops.map(o=> opsEl.innerHTML=ops.map(o=>
`<button class="btn btn-sm op-btn ${opClass(o.operation)}" onclick="runOp('${o.operation}',${o.svcOperationId})">${o.operation}</button>` `<button class="btn btn-sm op-btn ${opClass(o.operation)}" onclick="runOp('${o.operation}',${o.svcOperationId})">${o.operation}</button>`
).join(''); ).join('');