v1.1.38: operations per instance svcId + operation name header

This commit is contained in:
2026-07-30 08:33:03 +04:00
parent f79301b245
commit a0a17e183f
2 changed files with 7 additions and 6 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.37" VERSION = "1.1.38"
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 -5
View File
@@ -78,11 +78,12 @@ async function toggleInstance(iuid){
if(opsEl.classList.contains('open')){opsEl.classList.remove('open');return;} if(opsEl.classList.contains('open')){opsEl.classList.remove('open');return;}
document.querySelectorAll('.inst-ops').forEach(e=>e.classList.remove('open')); 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(); const d=await r.json();
let 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'){ if(inst&&(inst.status||inst.explainedStatus)==='not created'){
ops=ops.filter(o=>o.operation==='delete'); ops=ops.filter(o=>o.operation==='delete');
} }
@@ -160,8 +161,8 @@ function showParams(opId,opName){
const form=document.getElementById('params-form'); const form=document.getElementById('params-form');
const displayNameValue=isCreate?makeCreateDisplayName():''; const displayNameValue=isCreate?makeCreateDisplayName():'';
const createHeader=isCreate?`<div style="font-weight:600;font-size:13px;margin-bottom:8px;color:var(--brand-primary);">Создание: ${currentSvcName}</div>`:''; const createHeader=isCreate?`<div style="font-weight:600;font-size:13px;margin-bottom:8px;color:var(--brand-primary);">Создание: ${currentSvcName}</div>`:'';
const emptyOpHeader=(!isCreate&&params.length===0)?`<div style="font-size:13px;margin-bottom:8px;color:var(--muted);">Операция: <b>${_esc(opName)}</b> → <b>${_esc(findInstName())}</b></div>`:''; const opHeader=!isCreate?`<div style="font-weight:600;font-size:13px;margin-bottom:8px;color:var(--brand-primary);">${_esc(opName)}${_esc(findInstName())}</div>`:'';
form.innerHTML=createHeader+emptyOpHeader+(opName==='create'?`<div class="param-row"><label class="req">displayName</label><span style="font-size:12px;color:var(--muted);white-space:nowrap;">${AUTOTEST_PREFIX}</span><input type="text" id="param-displayname" value="${_esc(displayNameValue)}" autocomplete="off"></div>`:'') form.innerHTML=createHeader+opHeader+(opName==='create'?`<div class="param-row"><label class="req">displayName</label><span style="font-size:12px;color:var(--muted);white-space:nowrap;">${AUTOTEST_PREFIX}</span><input type="text" id="param-displayname" value="${_esc(displayNameValue)}" autocomplete="off"></div>`:'')
+ params.map(p=>{ + params.map(p=>{
const req=p.isRequired; const req=p.isRequired;
const hasDfl=p.defaultValue!==null&&p.defaultValue!==undefined&&p.defaultValue!==''; const hasDfl=p.defaultValue!==null&&p.defaultValue!==undefined&&p.defaultValue!=='';