From 1c44bb161744c8909a5245b6b64f0c71fc94fa83 Mon Sep 17 00:00:00 2001 From: Hermes Date: Mon, 18 May 2026 11:42:47 +0000 Subject: [PATCH] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20autom=C3=A1tica:=202026?= =?UTF-8?q?-05-18=2011:42:47?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-interface/public/app-new.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web-interface/public/app-new.js b/web-interface/public/app-new.js index db695f6..44ea404 100644 --- a/web-interface/public/app-new.js +++ b/web-interface/public/app-new.js @@ -600,7 +600,7 @@ function openClonedSite(directory) { }).then(response => { if (response.ok) { // Server is running, open the site via same origin - const siteName = directory.split('/').pop(); + const siteName = directory.replace(/\\/g, '/').split('/').pop(); window.open(`/${siteName}/index.html`, '_blank'); } else { showToast('Servidor não está respondendo.', 'error'); @@ -611,9 +611,16 @@ function openClonedSite(directory) { } function openCloneFolder(directory) { - showToast('Abrindo pasta: ' + directory, 'info'); - // In a real app, this would use an API endpoint to open the folder - console.log('Open folder:', directory); + showToast('Abrindo pasta no sistema da VPS: ' + directory, 'info'); + fetch('/api/open-folder', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ path: directory }) + }).then(res => res.json()) + .then(data => { + if (!data.success) showToast('Erro ao abrir pasta: ' + (data.error || ''), 'error'); + }) + .catch(err => console.error('Erro ao chamar open-folder:', err)); } function showToast(message, type = 'info') {