From 858e2d9dd4c53189c58f98fcf03bd2c9639bbfd8 Mon Sep 17 00:00:00 2001 From: Hermes Date: Sun, 24 May 2026 01:35:40 +0000 Subject: [PATCH] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20autom=C3=A1tica:=202026?= =?UTF-8?q?-05-24=2001:35:40?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-interface/public/agents-panel.js | 24 +++++------------------- web-interface/public/index-new.html | 7 +------ web-interface/server.js | 21 ++++++--------------- 3 files changed, 12 insertions(+), 40 deletions(-) diff --git a/web-interface/public/agents-panel.js b/web-interface/public/agents-panel.js index 9f648b8..366ef87 100644 --- a/web-interface/public/agents-panel.js +++ b/web-interface/public/agents-panel.js @@ -230,34 +230,21 @@ async function loadDesignerClonesSelect() { async function startDesign() { const selectEl = document.getElementById('designerCloneSelect'); const urlEl = document.getElementById('designUrl'); - const customPathEl = document.getElementById('designerCustomPath'); - const customPath = customPathEl?.value?.trim(); - - // Se informou caminho específico (nova funcionalidade) - if (customPath) { - agentsState.designer.currentClone = { - directory: customPath, - name: customPath.split('/').pop() || 'Site Customizado', - url: customPath, - isCustomPath: true - }; - } // Se escolheu na droplist - else if (selectEl && selectEl.value) { + if (selectEl && selectEl.value) { agentsState.designer.currentClone = { directory: 'cloned-sites/' + selectEl.value, name: selectEl.value.split('_')[0], - url: 'https://' + selectEl.value.split('_')[0], - isCustomPath: false + url: 'https://' + selectEl.value.split('_')[0] }; } else { const url = urlEl?.value?.trim(); if (!url) { - showAgentError('Designer', 'Selecione um site, insira uma URL ou informe um Caminho Específico de pasta.'); + showAgentError('Designer', 'Selecione um site já clonado na lista ou insira uma URL válida.'); return; } - agentsState.designer.currentClone = { url, name: 'Site selecionado', isCustomPath: false }; + agentsState.designer.currentClone = { url, name: 'Site selecionado' }; } setDesignerWorking(true); @@ -336,8 +323,7 @@ async function applyUltraModernRedesign(cloneDir) { appliedStyles, elementsRedesigned, outputDir: settings.outputDir, - agentName: 'designer', - isCustomPath: agentsState.designer?.currentClone?.isCustomPath || false + agentName: 'designer' }) }); const data = await response.json(); diff --git a/web-interface/public/index-new.html b/web-interface/public/index-new.html index 2462b6f..9247a5d 100644 --- a/web-interface/public/index-new.html +++ b/web-interface/public/index-new.html @@ -422,12 +422,7 @@
-
- - - Se preenchido, o agente usará esta pasta exata ignorando a seleção acima. -
-
diff --git a/web-interface/server.js b/web-interface/server.js index b15beca..20a7534 100644 --- a/web-interface/server.js +++ b/web-interface/server.js @@ -670,27 +670,18 @@ app.post('/api/ai/agent', async (req, res) => { // AI Inject Redesign Route (Pilar 1 - Agente Designer Real) app.post('/api/ai/inject-redesign', (req, res) => { - const { cloneDir, appliedStyles, elementsRedesigned, outputDir, agentName, isCustomPath } = req.body; + const { cloneDir, appliedStyles, elementsRedesigned, outputDir, agentName } = req.body; if (!cloneDir) return res.status(400).json({ error: 'cloneDir is required' }); let originalFolderName = ''; let folderPath = ''; let newFolderPath = ''; - if (isCustomPath) { - // Se for um caminho customizado absoluto fornecido pelo usuário - folderPath = cloneDir; - const cleanPath = cloneDir.endsWith('/') ? cloneDir.slice(0, -1) : cloneDir; - originalFolderName = path.basename(cleanPath); - // Sempre salvar a versão do designer em cloned-sites para o preview funcionar - newFolderPath = path.join(__dirname, '..', 'cloned-sites', `${originalFolderName}_${agentName || 'designer'}`); - } else { - // Comportamento padrão (lendo da storage interna cloned-sites) - const cleanDir = cloneDir.endsWith('/') ? cloneDir.slice(0, -1) : cloneDir; - originalFolderName = cleanDir.split('/').pop(); - folderPath = path.join(__dirname, '..', 'cloned-sites', originalFolderName); - newFolderPath = path.join(__dirname, '..', 'cloned-sites', `${originalFolderName}_${agentName || 'designer'}`); - } + // Sempre usar o diretório interno (cloned-sites) + const cleanDir = cloneDir.endsWith('/') ? cloneDir.slice(0, -1) : cloneDir; + originalFolderName = cleanDir.split('/').pop(); + folderPath = path.join(__dirname, '..', 'cloned-sites', originalFolderName); + newFolderPath = path.join(__dirname, '..', 'cloned-sites', `${originalFolderName}_${agentName || 'designer'}`); if (!fs.existsSync(folderPath)) { return res.status(404).json({ error: 'Cloned site folder not found' });