Atualização automática: 2026-05-18 20:12:35
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user