feat(client): envia clinicName no identify e migra upload para Presigned URLs

- client-monitor.js: adiciona clinicName no client-identify (fallback para auth legada)
- Direct Upload via Presigned URLs (bypass VPS) como caminho principal
- Fallback automático para envio via VPS se Wasabi não disponível
- Thumbnail gerado localmente via IPC com index.js (remove dependência sharp)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
VPS 4 Builder
2026-05-31 02:06:19 +02:00
parent 32f27ebe56
commit 2a26f72460
4 changed files with 139 additions and 64 deletions
+15 -2
View File
@@ -1,4 +1,4 @@
const { app, BrowserWindow, Tray, Menu, ipcMain, shell, dialog } = require('electron');
const { app, BrowserWindow, Tray, Menu, ipcMain, shell, dialog, nativeImage } = require('electron');
const path = require('path');
const fs = require('fs');
const { fork } = require('child_process');
@@ -152,6 +152,14 @@ function startMonitorProcess() {
if (configWindow && !configWindow.isDestroyed()) {
configWindow.webContents.send('new-log', message.log);
}
} else if (message && message.event === 'resize-image') {
try {
const img = nativeImage.createFromBuffer(Buffer.from(message.base64, 'base64'));
const thumb = img.resize({ width: 300, quality: "good" }).toJPEG(80);
monitorProcess.send({ event: 'resize-result', id: message.id, success: true, thumbBase64: thumb.toString('base64') });
} catch (e) {
monitorProcess.send({ event: 'resize-result', id: message.id, success: false, error: e.message });
}
}
});
@@ -210,7 +218,12 @@ function updateTrayMenu() {
// Se houver um download em andamento, mostra a barra no menu
if (downloadProgress !== null) {
if (downloadProgress === "Pronto") {
template.push({ label: '📦 Atualização pronta para instalar (reinicie o app)', enabled: false });
template.push({
label: '📦 Instalar Nova Versão (Reiniciar)',
click: () => {
autoUpdater.quitAndInstall();
}
});
} else {
template.push({ label: `⬇️ Baixando atualização: ${downloadProgress}%`, enabled: false });
}