From e89a018a7862a23dfb1a770ef4ecc3178cb8cf3c Mon Sep 17 00:00:00 2001 From: VPS 4 Builder Date: Thu, 28 May 2026 02:44:34 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20adiciona=20bot=C3=A3o=20na=20sidebar=20?= =?UTF-8?q?para=20download=20do=20client=20desktop=20(.exe)=20e=20rota=20d?= =?UTF-8?q?e=20download=20din=C3=A2mico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dental-server/public/index.html | 3 +++ dental-server/server.js | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/dental-server/public/index.html b/dental-server/public/index.html index a67a720..0212ec5 100644 --- a/dental-server/public/index.html +++ b/dental-server/public/index.html @@ -49,6 +49,9 @@ Dispositivos / Sync + + Baixar Cliente (.exe) + Plugins / Wasabi diff --git a/dental-server/server.js b/dental-server/server.js index 2ded4f2..1ef0aad 100644 --- a/dental-server/server.js +++ b/dental-server/server.js @@ -587,6 +587,23 @@ app.use('/updates', express.static(path.join(__dirname, 'updates'), { } })); +// Rota para baixar o instalador do cliente diretamente pelo painel +app.get('/download-client', async (req, res) => { + try { + const updatesDir = path.join(__dirname, 'updates'); + const files = await fs.readdir(updatesDir); + const exeFile = files.find(f => f.endsWith('.exe')); + + if (exeFile) { + res.download(path.join(updatesDir, exeFile), 'ScoreOdonto-Cliente-Setup.exe'); + } else { + res.status(404).send('Instalador do cliente ainda não disponível para download.'); + } + } catch (error) { + res.status(500).send('Erro ao buscar o instalador do cliente.'); + } +}); + // ================================================================ // SOCKET.IO - CONEXÕES EM TEMPO REAL // ================================================================