HAProxy Domain Manager

Backend Servers

Existing Domains

const domainList = document.getElementById('domainList'); domainList.innerHTML = ''; domains.forEach(domain => { const domainDiv = document.createElement('div'); domainDiv.className = 'domain-list-item'; domainDiv.innerHTML = ` function showStatus(message, type) { const statusDiv = document.createElement('div'); statusDiv.className = `status ${type}`; statusDiv.textContent = message; const container = document.querySelector('.container'); const domainList = document.querySelector('.domain-list'); if (container && domainList) { container.insertBefore(statusDiv, domainList); } else { document.body.appendChild(statusDiv); } setTimeout(() => { if (statusDiv.parentNode) { statusDiv.remove(); } }, 5000); } function loadDomains() { fetch('/api/domains') .then(response => response.json()) .then(domains => { const domainList = document.getElementById('domainList'); domainList.innerHTML = ''; domains.forEach(domain => { const domainDiv = document.createElement('div'); domainDiv.className = 'domain-list-item'; domainDiv.innerHTML = `

${domain.domain}

Backend: ${domain.backend_name}

SSL: ${domain.ssl_enabled ? 'Enabled' : 'Disabled'}

`; domainList.appendChild(domainDiv); }); }) .catch(error => { console.error('Error loading domains:', error); showStatus('Error loading domains: ' + error.message, 'error'); }); } addServerField(); loadDomains();