v1.1.13: service highlight, dynamic btn text, defaultValue in dataDescriptor

This commit is contained in:
2026-07-29 09:05:23 +04:00
parent b763469c5c
commit 8f802c3a17
5 changed files with 8 additions and 4 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
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
VERSION = "1.1.12"
VERSION = "1.1.13"
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")
+1
View File
@@ -72,6 +72,7 @@ def get_params_with_current_values(client, op_id, instance_uid):
k: {
"dataType": v.get("dataType", ""),
"valueList": _normalize_value_list(v.get("valueList", "")),
"defaultValue": v.get("defaultValue", ""),
"isRequired": v.get("isRequired", False),
}
for k, v in dd.items()
+1 -1
View File
@@ -178,7 +178,7 @@ def api_params(op_id):
"defaultValue": p.get("defaultValue"),
"valueList": _normalize_value_list(p.get("valueList")),
"refSvcId": p.get("refSvcId"),
"dataDescriptor": {k: {"dataType": v.get("dataType",""), "valueList": _normalize_value_list(v.get("valueList","")), "isRequired": v.get("isRequired", False)} for k, v in dd.items()} if isinstance(dd, dict) else None,
"dataDescriptor": {k: {"dataType": v.get("dataType",""), "valueList": _normalize_value_list(v.get("valueList","")), "defaultValue": v.get("defaultValue",""), "isRequired": v.get("isRequired", False)} for k, v in dd.items()} if isinstance(dd, dict) else None,
})
_log(f"[api_params] DEFAULT returning {len(result)} params")
return jsonify({"params": result})
+4 -1
View File
@@ -47,6 +47,9 @@ async function selectService(svcId){
const d=await r.json();
svcInstances=d.instances||[];
currentSvcName=d.svc||'';
// Обновить текст кнопки создания
const btnSpan=document.querySelector('#create-btn-area span');
if(btnSpan) btnSpan.textContent='+ Создать новый инстанс '+(currentSvcName||'сервиса');
let html='';
svcInstances.forEach(i=>{
@@ -180,7 +183,7 @@ function showParams(opId,opName){
try{dflObj=JSON.parse(dfl||'{}');}catch(e){}
Object.keys(dd).forEach(subKey=>{
const sub=dd[subKey];
const subDfl=dflObj[subKey]!==undefined?dflObj[subKey]:'';
const subDfl=dflObj[subKey]!==undefined?dflObj[subKey]:(sub.defaultValue||'');
const subVl=sub.valueList;
const subReq=sub.isRequired;
const subNoDfl=subReq&&!subDfl&&subDfl!==0&&subDfl!==false;
+1 -1
View File
@@ -12,7 +12,7 @@
.col-svc { width:240px; flex-shrink:0; max-height:calc(100vh - 50px); overflow-y:auto; }
.col-main { flex:1; min-width:0; }
.svc-item { cursor:pointer; padding:4px 8px; font-size:12px; border-radius:4px; }
.svc-item:hover, .svc-item.active { background:var(--brand-grey-light); }
.svc-item:hover, .svc-item.active { background:#dbeafe; font-weight:600; }
.inst-item { cursor:pointer; display:flex; align-items:center; gap:6px; padding:4px 8px; font-size:12px; border-radius:4px; }
.inst-item:hover, .inst-item.active { background:var(--brand-grey-light); }
.inst-ops { display:none; margin-left:16px; }