fix: adiciona versao dinamica na interface e notificacao de update
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<div class="brand-domain">rx.scoreodonto.com</div>
|
||||
<span style="font-size: 10px; background: rgba(130,87,229,0.15); color: rgba(180,160,255,0.8); padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(130,87,229,0.2); font-family: 'JetBrains Mono', monospace; letter-spacing: 0.5px;">Client v1.1.0</span>
|
||||
<span id="app-version-badge" style="font-size: 10px; background: rgba(130,87,229,0.15); color: rgba(180,160,255,0.8); padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(130,87,229,0.2); font-family: 'JetBrains Mono', monospace; letter-spacing: 0.5px;">Client v...</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -40,6 +40,12 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
|
||||
// Initialize layout and load config
|
||||
try {
|
||||
if (window.api && window.api.getVersion) {
|
||||
const version = await window.api.getVersion();
|
||||
const badge = document.getElementById('app-version-badge');
|
||||
if (badge) badge.innerText = `Client v${version}`;
|
||||
}
|
||||
|
||||
loadedConfig = await window.api.getConfig();
|
||||
|
||||
// Populate settings form
|
||||
|
||||
@@ -17,6 +17,13 @@ autoUpdater.on('checking-for-update', () => {
|
||||
|
||||
autoUpdater.on('update-available', (info) => {
|
||||
console.log('🔄 Nova versão disponível:', info.version);
|
||||
if (tray) {
|
||||
tray.displayBalloon({
|
||||
title: 'Nova Atualização Encontrada',
|
||||
content: `A versão ${info.version} está sendo baixada silenciosamente em segundo plano...`,
|
||||
iconType: 'info'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
autoUpdater.on('update-not-available', () => {
|
||||
@@ -286,6 +293,10 @@ ipcMain.handle('get-config', () => {
|
||||
return loadConfig();
|
||||
});
|
||||
|
||||
ipcMain.handle('get-version', () => {
|
||||
return app.getVersion();
|
||||
});
|
||||
|
||||
ipcMain.handle('save-config', (event, newConfig) => {
|
||||
const success = saveConfig(newConfig);
|
||||
if (success) {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rx.scoreodonto.com-client",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"author": "ScoreOdonto",
|
||||
"description": "Cliente Windows para envio de imagens dentais da ScoreOdonto",
|
||||
"main": "index.js",
|
||||
|
||||
@@ -2,6 +2,7 @@ const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
contextBridge.exposeInMainWorld('api', {
|
||||
getConfig: () => ipcRenderer.invoke('get-config'),
|
||||
getVersion: () => ipcRenderer.invoke('get-version'),
|
||||
saveConfig: (config) => ipcRenderer.invoke('save-config', config),
|
||||
testServer: (url) => ipcRenderer.invoke('test-server', url),
|
||||
verifyCredentials: (url, email, password, token) => ipcRenderer.invoke('verify-credentials', url, email, password, token),
|
||||
|
||||
Reference in New Issue
Block a user