SimpleChatTC:UI:ObjPropEdits handle objects, use for gMe
This commit is contained in:
parent
b771e42dc1
commit
756b128539
|
|
@ -1174,7 +1174,7 @@ class Me {
|
||||||
});
|
});
|
||||||
elDiv.appendChild(bb.div);
|
elDiv.appendChild(bb.div);
|
||||||
|
|
||||||
ui.ui_show_obj_props_edit(elDiv, this.apiRequestOptions, Object.keys(this.apiRequestOptions), "ApiRequestOptions")
|
ui.ui_show_obj_props_edit(elDiv, this, ["baseURL", "headers", "bStream", "bTools", "apiRequestOptions", "iRecentUserMsgCnt"], "Settings")
|
||||||
|
|
||||||
let sel = ui.el_creatediv_select("SetApiEP", "ApiEndPoint", ApiEP.Type, this.apiEP, (val)=>{
|
let sel = ui.el_creatediv_select("SetApiEP", "ApiEndPoint", ApiEP.Type, this.apiEP, (val)=>{
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ export function el_creatediv_input(id, label, type, defaultValue, cb, className=
|
||||||
/**
|
/**
|
||||||
* Auto create ui input elements for fields in apiRequestOptions
|
* Auto create ui input elements for fields in apiRequestOptions
|
||||||
* Currently supports text and number field types.
|
* Currently supports text and number field types.
|
||||||
* @param {HTMLDivElement} elDiv
|
* @param {HTMLDivElement|HTMLFieldSetElement} elDiv
|
||||||
* @param {any} oObj
|
* @param {any} oObj
|
||||||
* @param {Array<string>} lProps
|
* @param {Array<string>} lProps
|
||||||
* @param {string} sLegend
|
* @param {string} sLegend
|
||||||
|
|
@ -250,7 +250,7 @@ export function ui_show_obj_props_edit(elDiv, oObj, lProps, sLegend) {
|
||||||
legend.innerText = sLegend;
|
legend.innerText = sLegend;
|
||||||
fs.appendChild(legend);
|
fs.appendChild(legend);
|
||||||
elDiv.appendChild(fs);
|
elDiv.appendChild(fs);
|
||||||
for(const k in lProps) {
|
for(const k of lProps) {
|
||||||
let val = oObj[k];
|
let val = oObj[k];
|
||||||
let type = typeof(val);
|
let type = typeof(val);
|
||||||
if (((type == "string") || (type == "number"))) {
|
if (((type == "string") || (type == "number"))) {
|
||||||
|
|
@ -266,6 +266,8 @@ export function ui_show_obj_props_edit(elDiv, oObj, lProps, sLegend) {
|
||||||
oObj[k] = userVal;
|
oObj[k] = userVal;
|
||||||
});
|
});
|
||||||
fs.appendChild(bbtn.div);
|
fs.appendChild(bbtn.div);
|
||||||
|
} else if (type == "object") {
|
||||||
|
ui_show_obj_props_edit(fs, val, Object.keys(val), k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue