Examples > web-settings PLUGIN.JS (4/5) container.innerHTML = `

${esc(api.name)}

${FIELDS.map((f) => `
${control(f)}
`).join('')}

Stored unencrypted on the SD card: ${esc(api.dir)}/${CONFIG}

`; // Use the manifest title as heading. try { const list = await (await fetch('/api/plugins')).json(); const me = list.find((p) => p.name === api.name); if (me && me.title) $('h2').textContent = me.title; } catch (e) { /* keep the fallback heading */ } const out = (msg, ok = true) => { $('[data-out]').textContent = msg; $('[data-out]').style.color = ok ? 'var(--success-color)' : 'var(--danger-color)'; }; function fill(cfg) { for (const f of FIELDS) { const el = $(`[data-k="${f.key}"]`); const v = cfg[f.key] ?? f.value ?? ''; if (f.type === 'checkbox') el.checked = String(v) === '1'; else el.value = v; } } Next: 07 plugin.js (5/5)