1// EverydayTechAgent Tray Menu Plugin
2// Cross-platform system tray menu using electron-tray
4const { app, Menu, Tray, shell } = require('electron');
5const path = require('path');
9function createTray(logger = console.log) {
10 const iconPath = path.join(__dirname, '../../everydaytech_icon.ico');
11 tray = new Tray(iconPath);
12 const contextMenu = Menu.buildFromTemplate([
13 { label: 'Agent Status: Running', enabled: false },
14 { type: 'separator' },
15 { label: 'Open Dashboard', click: () => { logger('Tray: Open Dashboard'); shell.openExternal('https://dashboard.everydaytech.com'); } },
16 { label: 'Create Ticket', click: () => { logger('Tray: Create Ticket'); shell.openExternal('https://support.everydaytech.com/new-ticket'); } },
17 { label: 'View Logs', click: () => { logger('Tray: View Logs'); shell.openPath(path.join(app.getPath('userData'), 'agent.log')); } },
18 { label: 'Restart Agent', click: () => { logger('Tray: Restart Agent'); shell.openExternal('https://dashboard.everydaytech.com/restart-agent'); } },
19 { type: 'separator' },
20 { label: 'About', click: () => { logger('Tray: About'); shell.openExternal('https://everydaytech.com/about'); } },
21 { label: 'Exit', click: () => { logger('Tray: Exit'); app.quit(); } }
23 tray.setToolTip('EverydayTechAgent');
24 tray.setContextMenu(contextMenu);
25 logger('Tray menu created');
28app.whenReady().then(() => createTray());