v1.1.13: service highlight, dynamic btn text, defaultValue in dataDescriptor
This commit is contained in:
+1
-1
@@ -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.12"
|
VERSION = "1.1.13"
|
||||||
|
|
||||||
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")
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ def get_params_with_current_values(client, op_id, instance_uid):
|
|||||||
k: {
|
k: {
|
||||||
"dataType": v.get("dataType", ""),
|
"dataType": v.get("dataType", ""),
|
||||||
"valueList": _normalize_value_list(v.get("valueList", "")),
|
"valueList": _normalize_value_list(v.get("valueList", "")),
|
||||||
|
"defaultValue": v.get("defaultValue", ""),
|
||||||
"isRequired": v.get("isRequired", False),
|
"isRequired": v.get("isRequired", False),
|
||||||
}
|
}
|
||||||
for k, v in dd.items()
|
for k, v in dd.items()
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ def api_params(op_id):
|
|||||||
"defaultValue": p.get("defaultValue"),
|
"defaultValue": p.get("defaultValue"),
|
||||||
"valueList": _normalize_value_list(p.get("valueList")),
|
"valueList": _normalize_value_list(p.get("valueList")),
|
||||||
"refSvcId": p.get("refSvcId"),
|
"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")
|
_log(f"[api_params] DEFAULT returning {len(result)} params")
|
||||||
return jsonify({"params": result})
|
return jsonify({"params": result})
|
||||||
|
|||||||
+4
-1
@@ -47,6 +47,9 @@ async function selectService(svcId){
|
|||||||
const d=await r.json();
|
const d=await r.json();
|
||||||
svcInstances=d.instances||[];
|
svcInstances=d.instances||[];
|
||||||
currentSvcName=d.svc||'';
|
currentSvcName=d.svc||'';
|
||||||
|
// Обновить текст кнопки создания
|
||||||
|
const btnSpan=document.querySelector('#create-btn-area span');
|
||||||
|
if(btnSpan) btnSpan.textContent='+ Создать новый инстанс '+(currentSvcName||'сервиса');
|
||||||
|
|
||||||
let html='';
|
let html='';
|
||||||
svcInstances.forEach(i=>{
|
svcInstances.forEach(i=>{
|
||||||
@@ -180,7 +183,7 @@ function showParams(opId,opName){
|
|||||||
try{dflObj=JSON.parse(dfl||'{}');}catch(e){}
|
try{dflObj=JSON.parse(dfl||'{}');}catch(e){}
|
||||||
Object.keys(dd).forEach(subKey=>{
|
Object.keys(dd).forEach(subKey=>{
|
||||||
const sub=dd[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 subVl=sub.valueList;
|
||||||
const subReq=sub.isRequired;
|
const subReq=sub.isRequired;
|
||||||
const subNoDfl=subReq&&!subDfl&&subDfl!==0&&subDfl!==false;
|
const subNoDfl=subReq&&!subDfl&&subDfl!==0&&subDfl!==false;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
.col-svc { width:240px; flex-shrink:0; max-height:calc(100vh - 50px); overflow-y:auto; }
|
.col-svc { width:240px; flex-shrink:0; max-height:calc(100vh - 50px); overflow-y:auto; }
|
||||||
.col-main { flex:1; min-width:0; }
|
.col-main { flex:1; min-width:0; }
|
||||||
.svc-item { cursor:pointer; padding:4px 8px; font-size:12px; border-radius:4px; }
|
.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 { 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-item:hover, .inst-item.active { background:var(--brand-grey-light); }
|
||||||
.inst-ops { display:none; margin-left:16px; }
|
.inst-ops { display:none; margin-left:16px; }
|
||||||
|
|||||||
Reference in New Issue
Block a user