Skip to content
Merged

Stage #9301

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"electron-store": "^8.1.0",
"electron-updater": "^6.1.7",
"electron-util": "^0.18.1",
"express": "^5.1.0",
"express": "^5.2.1",
"locutus": "^2.0.30",
"moment": "^2.30.1",
"moment-duration-format": "^2.3.2",
Expand Down
17 changes: 12 additions & 5 deletions apps/agent/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { NgModule } from '@angular/core';
import { ExtraOptions, RouterModule, Routes } from '@angular/router';
import {
AboutComponent,
AgentDashboardComponent,
AlwaysOnComponent,
AuthConnectionGuard,
ScreenCaptureComponent,
ServerDownPage,
SettingsComponent,
SetupComponent,
SplashScreenComponent,
UpdaterComponent,
ScreenCaptureComponent,
AgentDashboardComponent,
AlwaysOnComponent
UpdaterComponent
} from '@gauzy/desktop-ui-lib';
import { AppModuleGuard } from './app.module.guards';

Expand All @@ -23,6 +24,12 @@ const routes: Routes = [
loadChildren: () => import('@gauzy/desktop-ui-lib').then((m) => m.authRoutes),
canActivate: [AppModuleGuard]
},
{
path: 'plugins',
canActivate: [AuthConnectionGuard],
loadComponent: () => import('@gauzy/desktop-ui-lib').then((m) => m.PluginLayoutComponent),
loadChildren: () => import('@gauzy/desktop-ui-lib').then((m) => m.pluginRoutes)
},
{
path: 'settings',
component: SettingsComponent,
Expand Down Expand Up @@ -70,4 +77,4 @@ const config: ExtraOptions = {
imports: [RouterModule.forRoot(routes, config)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export class AppRoutingModule {}
4 changes: 3 additions & 1 deletion apps/agent/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
NgxLoginModule,
NoAuthGuard,
OrganizationInterceptor,
PluginsModule,
RefreshTokenInterceptor,
ScreenCaptureModule,
ServerConnectionService,
Expand Down Expand Up @@ -119,7 +120,8 @@ if (environment.SENTRY_DSN) {
NbDatepickerModule.forRoot(),
AboutModule,
AgentDashboardModule,
AlwaysOnModule
AlwaysOnModule,
PluginsModule
],
providers: [
AppService,
Expand Down
53 changes: 26 additions & 27 deletions apps/agent/src/main/tray.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import {
Tray,
nativeImage,
shell,
app,
Menu,
MenuItemConstructorOptions,
} from 'electron';
import { RegisteredWindow, WindowManager } from '@gauzy/desktop-core';
import { TranslateService } from '@gauzy/desktop-lib';
import AppWindow from './window-manager';
import MainEvent from './events/events';
import { MAIN_EVENT, MAIN_EVENT_TYPE } from '../constant';
import { PluginMarketplaceWindow } from '@gauzy/desktop-window';
import { app, Menu, MenuItemConstructorOptions, nativeImage, shell, Tray } from 'electron';
import * as path from 'path';
import { MAIN_EVENT, MAIN_EVENT_TYPE } from '../constant';
import MainEvent from './events/events';
import AppWindow from './window-manager';

type ISiteUrl = {
helpSiteUrl: string
}
helpSiteUrl: string;
};
const appWindow = AppWindow.getInstance(path.join(__dirname, '..'));
const mainEvent = MainEvent.getInstance();

Expand All @@ -24,19 +19,15 @@ class TrayMenu {
width: number;
height: number;
} = {
width: 16,
height: 16
};
width: 16,
height: 16
};
private TrayMenuList: MenuItemConstructorOptions[] = [];
private tray: Tray | null = null;
private useCommonMenu: boolean;
private siteUrls: ISiteUrl;
static instance: TrayMenu;
constructor(
trayIconPath: string,
useCommonMenu: boolean,
siteUrls: ISiteUrl,
) {
constructor(trayIconPath: string, useCommonMenu: boolean, siteUrls: ISiteUrl) {
if (!TrayMenu.instance) {
TrayMenu.instance = this;
this.trayIconPath = trayIconPath;
Expand Down Expand Up @@ -146,6 +137,19 @@ class TrayMenu {
await appWindow.initAboutWindow();
}
},
{
id: 'tray_plugins',
label: TranslateService.instant('TIMER_TRACKER.SETTINGS.PLUGINS'),
async click() {
let window = WindowManager.getInstance().getOne(RegisteredWindow.PLUGINS);
if (!window) {
const plugin = new PluginMarketplaceWindow(appWindow.getUiPath('plugins'));
await plugin.loadURL();
window = WindowManager.getInstance().getOne(RegisteredWindow.PLUGINS);
}
window.show();
}
},
{
id: 'tray_exit',
label: `${TranslateService.instant('BUTTONS.EXIT')}`,
Expand All @@ -164,7 +168,6 @@ class TrayMenu {
this.tray?.setContextMenu(Menu.buildFromTemplate(this.TrayMenuList));
}


private initTray() {
this.tray = new Tray(this.nativeIconPath());
this.tray.setTitle('State: Startup', {
Expand All @@ -173,10 +176,7 @@ class TrayMenu {
this.tray.setToolTip('Agent is starting up');
}

public updateStatus(
menuId: 'keyboard_mouse' | 'network' | 'afk',
checked: boolean = false
) {
public updateStatus(menuId: 'keyboard_mouse' | 'network' | 'afk', checked: boolean = false) {
const menuIdx = this.TrayMenuList.findIndex((menu) => menu.id === menuId);
if (menuIdx !== -1) {
this.TrayMenuList[menuIdx].checked = checked;
Expand All @@ -197,7 +197,6 @@ class TrayMenu {
this.tray.setTitle(`Status: ${status}`);
this.tray.setToolTip(`Agent is ${status}`);
}

}

public updateTimerMenu(isStarted: boolean) {
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@grpc/grpc-js": "^1.6.7",
"@mikro-orm/core": "^6.4.13",
"@mikro-orm/nestjs": "^6.1.1",
"@nestjs/common": "^11.1.0",
"@nestjs/core": "^11.1.0",
"@nestjs/common": "^11.1.10",
"@nestjs/core": "^11.1.10",
"@nestjs/typeorm": "^11.0.0",
"@gauzy/plugin-integration-wakatime": "^0.1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop-timer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"electron-store": "^8.1.0",
"electron-updater": "^6.1.7",
"electron-util": "^0.18.1",
"express": "^5.1.0",
"express": "^5.2.1",
"locutus": "^2.0.30",
"moment": "^2.30.1",
"moment-duration-format": "^2.3.2",
Expand Down
7 changes: 6 additions & 1 deletion apps/desktop-timer/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ const routes: Routes = [
},
{
path: 'settings',
component: SettingsComponent,
component: SettingsComponent
},
{
path: 'plugins',
canActivate: [AuthConnectionGuard],
loadComponent: () => import('@gauzy/desktop-ui-lib').then((m) => m.PluginLayoutComponent),
loadChildren: () => import('@gauzy/desktop-ui-lib').then((m) => m.pluginRoutes)
},
{
Expand Down
2 changes: 2 additions & 0 deletions apps/desktop-timer/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
NgxLoginModule,
NoAuthGuard,
OrganizationInterceptor,
PluginsModule,
RecapModule,
RefreshTokenInterceptor,
ScreenCaptureModule,
Expand Down Expand Up @@ -120,6 +121,7 @@ if (environment.SENTRY_DSN) {
NbDatepickerModule.forRoot(),
AboutModule,
ActivityWatchModule,
PluginsModule,
RecapModule,
TaskTableModule
],
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop-timer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
createSetupWindow,
createTimeTrackerWindow,
createUpdaterWindow,
PluginMarketplaceWindow,
ScreenCaptureNotification,
SplashScreen,
timeTrackerPage
Expand Down Expand Up @@ -406,8 +407,10 @@ app.on('ready', async () => {
settingsWindow = await createSettingsWindow(settingsWindow, pathWindow.timeTrackerUi, pathWindow.preloadPath);
updaterWindow = await createUpdaterWindow(updaterWindow, pathWindow.timeTrackerUi, pathWindow.preloadPath);
imageView = await createImageViewerWindow(imageView, pathWindow.timeTrackerUi, pathWindow.preloadPath);
const marketplace = new PluginMarketplaceWindow(pathWindow.timeTrackerUi);
alwaysOn = new AlwaysOn(pathWindow.timeTrackerUi);
await alwaysOn.loadURL();
await marketplace.loadURL();

if (configs && configs.isSetup) {
global.variableGlobal = {
Expand Down
Loading
Loading