feat: Affichage de la version dans l'interface et la barre de titre

- Ajout de l'affichage de la version à côté du logo dans l'interface
- Ajout de la version dans le titre de la fenêtre (barre macOS/Windows/Linux)
- Création du handler IPC get-app-version pour exposer la version
- Mise à jour dynamique du titre lors de la connexion/déconnexion agent
- Style élégant pour la version affichée dans l'interface (gris clair, opacité 0.8)

Fichiers modifiés :
- index.html : ajout du span pour la version
- renderer.js : récupération et affichage de la version via IPC
- main.js : handler IPC et mise à jour des titres de fenêtre
- styles-modern.css : style pour .app-version
This commit is contained in:
Pierre Marx
2025-10-21 11:30:27 -04:00
parent 057504a65f
commit 7b9679e4dc
4 changed files with 26 additions and 6 deletions

View File

@@ -72,7 +72,7 @@
<!-- Header et onglets combinés --> <!-- Header et onglets combinés -->
<header class="header-with-tabs"> <header class="header-with-tabs">
<div class="header-left"> <div class="header-left">
<h1>SimpleConnect</h1> <h1>SimpleConnect <span id="appVersion" class="app-version"></span></h1>
<span id="agentName" class="agent-name"></span> <span id="agentName" class="agent-name"></span>
</div> </div>

11
main.js
View File

@@ -67,7 +67,7 @@ function createWindow() {
webSecurity: false webSecurity: false
}, },
icon: path.join(__dirname, 'icon.png'), icon: path.join(__dirname, 'icon.png'),
title: 'SimpleConnect', title: `SimpleConnect v${app.getVersion()}`,
autoHideMenuBar: true // Cache la barre de menu par défaut autoHideMenuBar: true // Cache la barre de menu par défaut
}); });
@@ -411,6 +411,11 @@ ipcMain.handle('get-config', () => {
return config; return config;
}); });
// Obtenir la version de l'application
ipcMain.handle('get-app-version', () => {
return app.getVersion();
});
// Obtenir le statut SignalR // Obtenir le statut SignalR
ipcMain.handle('get-signalr-status', () => { ipcMain.handle('get-signalr-status', () => {
return signalRStatus; return signalRStatus;
@@ -532,7 +537,7 @@ ipcMain.handle('login-agent', async (event, credentials) => {
// Mettre à jour le titre de la fenêtre // Mettre à jour le titre de la fenêtre
if (mainWindow) { if (mainWindow) {
mainWindow.setTitle( mainWindow.setTitle(
`SimpleConnect - Agent: ${currentAgent.accessCode} (${result.firstName} ${result.lastName}) - Tel: ${credentials.terminal}` `SimpleConnect v${app.getVersion()} - Agent: ${currentAgent.accessCode} (${result.firstName} ${result.lastName}) - Tel: ${credentials.terminal}`
); );
} }
@@ -631,7 +636,7 @@ ipcMain.handle('logout', async () => {
// Réinitialiser le titre de la fenêtre // Réinitialiser le titre de la fenêtre
if (mainWindow) { if (mainWindow) {
mainWindow.setTitle('SimpleConnect - Gestion Centralisée des Plannings'); mainWindow.setTitle(`SimpleConnect v${app.getVersion()}`);
} }
return { success: true }; return { success: true };

View File

@@ -18,15 +18,22 @@ let notesStartX = 0;
// === GESTION DE LA CONNEXION === // === GESTION DE LA CONNEXION ===
document.addEventListener('DOMContentLoaded', async () => { document.addEventListener('DOMContentLoaded', async () => {
// Afficher la version de l'application
const appVersion = await ipcRenderer.invoke('get-app-version');
const versionElement = document.getElementById('appVersion');
if (versionElement && appVersion) {
versionElement.textContent = `v${appVersion}`;
}
// Initialiser l'indicateur SignalR // Initialiser l'indicateur SignalR
// Écouter les changements de statut SignalR // Écouter les changements de statut SignalR
ipcRenderer.on('signalr-status', (event, status) => { ipcRenderer.on('signalr-status', (event, status) => {
updateSignalRIndicator(status); updateSignalRIndicator(status);
// Recharger les terminaux à chaque changement de statut // Recharger les terminaux à chaque changement de statut
loadTerminals(); loadTerminals();
}); });
// Obtenir le statut initial SignalR // Obtenir le statut initial SignalR
const initialStatus = await ipcRenderer.invoke('get-signalr-status'); const initialStatus = await ipcRenderer.invoke('get-signalr-status');
updateSignalRIndicator(initialStatus); updateSignalRIndicator(initialStatus);

View File

@@ -322,6 +322,14 @@ body {
margin: 0; margin: 0;
} }
.app-version {
font-size: 12px;
color: #999;
font-weight: 400;
margin-left: 8px;
opacity: 0.8;
}
.agent-name { .agent-name {
font-size: 14px; font-size: 14px;
color: #666; color: #666;