Atualização automática: 2026-05-23 20:55:21

This commit is contained in:
Hermes
2026-05-23 20:55:21 +00:00
parent a81e273364
commit 7cfc1724d3
4 changed files with 73 additions and 33 deletions
+17 -5
View File
@@ -312,21 +312,33 @@ async function applyUltraModernRedesign(cloneDir) {
}
// Injetar o CSS de Redesign Ultra-Moderno gerado pela IA no site clonado
let newPreviewUrl = `/api/preview/${cloneDir.split('/').pop()}`;
try {
await fetch('/api/ai/inject-redesign', {
const response = await fetch('/api/ai/inject-redesign', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ cloneDir, appliedStyles, elementsRedesigned })
body: JSON.stringify({
cloneDir,
appliedStyles,
elementsRedesigned,
outputDir: settings.outputDir,
agentName: 'designer'
})
});
const data = await response.json();
if (data.newFolderName) {
newPreviewUrl = `/api/preview/${data.newFolderName}`;
if (agentsState.designer.currentClone) {
agentsState.designer.currentClone.directory = 'cloned-sites/' + data.newFolderName;
}
}
} catch (e) {
console.error("Erro ao injetar CSS de redesign:", e);
}
const previewUrl = `/api/preview/${cloneDir.split('/').pop()}`;
return {
success: true,
previewUrl,
previewUrl: newPreviewUrl,
appliedStyles,
elementsRedesigned
};
+10 -2
View File
@@ -304,7 +304,10 @@ async function startCloning(url, options) {
response = await fetch('/api/smart-clone', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url })
body: JSON.stringify({
url,
outputDir: settings.outputDir
})
});
} else {
// WGET logic
@@ -313,7 +316,8 @@ async function startCloning(url, options) {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
url,
depth: options.depth
depth: options.depth,
outputDir: settings.outputDir
})
});
}
@@ -584,9 +588,13 @@ function loadSettings() {
}
// Populate settings form (if needed)
const outDirInput = document.getElementById('settingsOutputDir');
if (outDirInput) outDirInput.value = settings.outputDir || '/root/Desktop/Clonados';
}
function saveSettings() {
const outDirInput = document.getElementById('settingsOutputDir');
if (outDirInput) settings.outputDir = outDirInput.value;
localStorage.setItem('cloneSettings', JSON.stringify(settings));
showToast('Configurações salvas!', 'success');
}
+3 -3
View File
@@ -250,8 +250,8 @@
<p>Local onde os sites clonados serão salvos</p>
</div>
<div class="setting-control">
<input type="text" class="form-control" value="M:\CLONEWEB\cloned-sites" readonly>
<button class="btn btn-secondary btn-sm">
<input type="text" id="settingsOutputDir" class="form-control" value="/root/Desktop/Clonados">
<button class="btn btn-secondary btn-sm" onclick="openCloneFolder(document.getElementById('settingsOutputDir').value)">
<i class="fas fa-folder-open"></i> Abrir
</button>
</div>
@@ -293,7 +293,7 @@
</div>
<div class="settings-actions">
<button class="btn btn-primary">
<button class="btn btn-primary" onclick="saveSettings()">
<i class="fas fa-save"></i> Salvar Configurações
</button>
<button class="btn btn-secondary">