diff --git a/web-interface/public/app-new.js b/web-interface/public/app-new.js index c48c381..a5178df 100644 --- a/web-interface/public/app-new.js +++ b/web-interface/public/app-new.js @@ -100,8 +100,8 @@ async function checkServiceStatus() { const statusIndicator = document.getElementById('serviceStatus'); try { - // Verificar o serviço WGET na porta 3002 (não 3001) - const response = await fetch('http://localhost:3002/health', { + // Verificar o serviço WGET via proxy do servidor (mesma origem) + const response = await fetch('/api/health', { method: 'GET' }); @@ -582,18 +582,18 @@ function saveSettings() { // Utility Functions function openClonedSite(directory) { // Try to open via server endpoint - fetch('http://localhost:8080', { + fetch('/api/health', { method: 'GET' }).then(response => { if (response.ok) { - // Server is running, open the site - const siteName = directory.split('\\').pop(); - window.open(`http://localhost:8080/${siteName}/`, '_blank'); + // Server is running, open the site via same origin + const siteName = directory.split('/').pop(); + window.open(`/${siteName}/index.html`, '_blank'); } else { - showToast('Servidor HTTP não está rodando. Inicie o servidor na porta 8080.', 'error'); + showToast('Servidor não está respondendo.', 'error'); } }).catch(error => { - showToast('Servidor HTTP não está rodando. Inicie o servidor na porta 8080.', 'error'); + showToast('Servidor não está respondendo.', 'error'); }); }