Atualização automática: 2026-05-18 20:12:35

This commit is contained in:
Hermes
2026-05-18 20:12:35 +00:00
parent 37612a7b81
commit e596342950
5 changed files with 92 additions and 23 deletions
+2 -14
View File
@@ -593,20 +593,8 @@ function saveSettings() {
// Utility Functions
function openClonedSite(directory) {
// Try to open via server endpoint
fetch('/api/health', {
method: 'GET'
}).then(response => {
if (response.ok) {
// Server is running, open the site via same origin
const siteName = directory.replace(/\\/g, '/').split('/').pop();
window.open(`/${siteName}/index.html`, '_blank');
} else {
showToast('Servidor não está respondendo.', 'error');
}
}).catch(error => {
showToast('Servidor não está respondendo.', 'error');
});
const siteName = directory.replace(/\\/g, '/').split('/').pop();
window.open(`/api/preview/${siteName}`, '_blank');
}
function openCloneFolder(directory) {
+1 -5
View File
@@ -15,12 +15,8 @@ urlInput.addEventListener('keypress', (e) => {
document.getElementById('btnOpenSite').addEventListener('click', () => {
if (clonedData && clonedData.data && clonedData.data.path) {
// Construct local URL. Server serves /<folderName>/index.html
// We know server serves static files from cloned-sites directly if configured?
// Wait, server.js serves ../cloned-sites as static.
// so path is just /FolderName/index.html
const dirName = clonedData.data.path.split('\\').pop().split('/').pop();
window.open(`/${dirName}/index.html`, '_blank');
window.open(`/api/preview/${dirName}`, '_blank');
}
});
+1 -3
View File
@@ -437,8 +437,6 @@ function openCloneFolder(directory) {
}
function openClonedSite(directory) {
// Extract folder name and open site in browser via window.open
const folderName = directory.split('/').pop();
const siteUrl = window.location.protocol + '//' + window.location.host + '/' + folderName + '/index.html';
window.open(siteUrl, '_blank');
window.open('/api/preview/' + folderName, '_blank');
}
+1 -1
View File
@@ -373,7 +373,7 @@ function confirmDeleteClone(cloneId) {
}
function openClone(cloneId) {
window.open(`/${cloneId}/index.html`, '_blank');
window.open(`/api/preview/${cloneId}`, '_blank');
}
function cloneSiteAgain(baseUrl) {