// Admin System/Proxy Settings Module (ESM)
// Depends on globals: axios, window.API_BASE, window.authToken
function setInputValue(id, val) { const el = document.getElementById(id); if (el) el.value = val ?? ''; }
function getInputValue(id) { const el = document.getElementById(id); return el ? el.value : ''; }
function setSelectValue(id, val) { const el = document.getElementById(id); if (el) el.value = val; }
function getSelectValue(id) { const el = document.getElementById(id); return el ? el.value : ''; }
function escapeHtml(text) {
if (!text) return '';
const div = document.createElement('div');
div.textContent = text;
return div.innerHTML;
}
function renderEffectiveProxySettings(d) {
const containerId = 'effectiveProxySettings';
let container = document.getElementById(containerId);
if (!container) {
const sys = document.getElementById('content-system');
if (!sys) return;
container = document.createElement('div');
container.id = containerId;
container.className = 'mt-6 bg-gray-50 border rounded-md p-4';
sys.appendChild(container);
}
try {
const sources = d?.sources || {};
const eff = d?.effective || {};
const nl = arr => Array.isArray(arr) && arr.length ? arr.map(x => `${escapeHtml(String(x))}`).join(' ') : '(空)';
container.innerHTML = `