MCPcopy Create free account
hub / github.com/cppla/ServerStatus / renderConfigEditor

Function renderConfigEditor

web/js/app.js:727–735  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

725 renderConfigEditor(item);
726}
727function renderConfigEditor(item){
728 const def = activeConfigDef();
729 const editing = S.admin.selectedIndex >= 0 && item;
730 const current = item || {};
731 $('configEditorTitle').textContent = `${editing ? '编辑' : '新增'}${def.label}`;
732 $('configEditorHint').textContent = def.hint;
733 $('configFields').innerHTML = def.fields.map(field => fieldHTML(field, current)).join('');
734 $('deleteConfigItemBtn').disabled = !editing;
735}
736function fieldHTML(field, item){
737 const value = item[field.name] ?? field.default ?? '';
738 if(field.type === 'checkbox'){

Callers 4

loadConfigFunction · 0.85
selectConfigItemFunction · 0.85
clearConfigFormFunction · 0.85
bindAdminFunction · 0.85

Calls 3

activeConfigDefFunction · 0.85
$Function · 0.85
fieldHTMLFunction · 0.85

Tested by

no test coverage detected