Skip to content

Commit

Permalink
fix: typo wording
Browse files Browse the repository at this point in the history
  • Loading branch information
syns2191 committed Jun 16, 2024
1 parent a38a500 commit 334e172
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 30 deletions.
2 changes: 1 addition & 1 deletion apps/server-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
},
"dmg": {
"icon": "icon.icns",
"sign": true,
"sign": false,
"contents": [
{
"x": 130,
Expand Down
46 changes: 23 additions & 23 deletions apps/server-web/src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { EventLists, SettingPageTypeMessage } from './helpers/constant';
import { resolveHtmlPath } from './util';
import Updater from './updater';

const eventEmiter = new EventEmitter();
const eventEmitter = new EventEmitter();

const controller = new AbortController();
const { signal } = controller;
const isPack = app.isPackaged;
const desktopServer = new DesktopServer(false, eventEmiter);
const desktopServer = new DesktopServer(false, eventEmitter);
const isProd = process.env.NODE_ENV === 'production';

// const appPath = app.getAppPath();
Expand All @@ -22,9 +22,9 @@ let isServerRun: boolean;

let tray:Tray;
let settingWindow: BrowserWindow | null = null;
const updater = new Updater(eventEmiter);
const updater = new Updater(eventEmitter);

const trayMenuItems = defaultTrayMenuItem(eventEmiter);
const trayMenuItems = defaultTrayMenuItem(eventEmitter);

const RESOURCES_PATH = app.isPackaged
? path.join(process.resourcesPath, 'assets/icons/gauzy')
Expand Down Expand Up @@ -150,34 +150,34 @@ const SendMessageToSettingWindow = (type: string, data: any) => {
const onInitApplication = () => {
LocalStore.setDefaultServerConfig(); // check and set default config
tray = _initTray(trayMenuItems, getAssetPath('icon.png'));
eventEmiter.on(EventLists.webServerStart, async () => {
updateTrayMenu('SERVER_START', { enabled: false }, eventEmiter, tray, trayMenuItems);
eventEmitter.on(EventLists.webServerStart, async () => {
updateTrayMenu('SERVER_START', { enabled: false }, eventEmitter, tray, trayMenuItems);
isServerRun = true;
await runServer();
})

eventEmiter.on(EventLists.webServerStop, async () => {
eventEmitter.on(EventLists.webServerStop, async () => {
isServerRun = false;
await stopServer();
})

eventEmiter.on(EventLists.webServerStarted, () => {
eventEmitter.on(EventLists.webServerStarted, () => {
console.log(EventLists.webServerStarted)
updateTrayMenu('SERVER_START', { enabled: false }, eventEmiter, tray, trayMenuItems);
updateTrayMenu('SERVER_STOP', { enabled: true }, eventEmiter, tray, trayMenuItems);
updateTrayMenu('SERVER_STATUS', { label: 'Status: Started' }, eventEmiter, tray, trayMenuItems);
updateTrayMenu('SERVER_START', { enabled: false }, eventEmitter, tray, trayMenuItems);
updateTrayMenu('SERVER_STOP', { enabled: true }, eventEmitter, tray, trayMenuItems);
updateTrayMenu('SERVER_STATUS', { label: 'Status: Started' }, eventEmitter, tray, trayMenuItems);
isServerRun = true;
})

eventEmiter.on(EventLists.webServerStopped, () => {
eventEmitter.on(EventLists.webServerStopped, () => {
console.log(EventLists.webServerStopped);
updateTrayMenu('SERVER_STOP', { enabled: false }, eventEmiter, tray, trayMenuItems);
updateTrayMenu('SERVER_START', { enabled: true }, eventEmiter, tray, trayMenuItems);
updateTrayMenu('SERVER_STATUS', { label: 'Status: Stopped' }, eventEmiter, tray, trayMenuItems);
updateTrayMenu('SERVER_STOP', { enabled: false }, eventEmitter, tray, trayMenuItems);
updateTrayMenu('SERVER_START', { enabled: true }, eventEmitter, tray, trayMenuItems);
updateTrayMenu('SERVER_STATUS', { label: 'Status: Stopped' }, eventEmitter, tray, trayMenuItems);
isServerRun = false;
})

eventEmiter.on(EventLists.gotoSetting, async () => {
eventEmitter.on(EventLists.gotoSetting, async () => {
if (!settingWindow) {
await createWindow()
}
Expand All @@ -189,32 +189,32 @@ const onInitApplication = () => {
})
})

eventEmiter.on(EventLists.UPDATE_AVAILABLE, (data)=> {
eventEmitter.on(EventLists.UPDATE_AVAILABLE, (data)=> {
console.log('UPDATE_AVAILABLE', data);
SendMessageToSettingWindow(SettingPageTypeMessage.updateAvailable, data);
})

eventEmiter.on(EventLists.UPDATE_ERROR, (data)=> {
eventEmitter.on(EventLists.UPDATE_ERROR, (data)=> {
console.log('UPDATE_ERROR', data);
SendMessageToSettingWindow(SettingPageTypeMessage.updateError, {message: JSON.stringify(data)});
})

eventEmiter.on(EventLists.UPDATE_NOT_AVAILABLE, (data)=> {
eventEmitter.on(EventLists.UPDATE_NOT_AVAILABLE, (data)=> {
console.log('UPDATE_NOT_AVAILABLE', data);
SendMessageToSettingWindow(SettingPageTypeMessage.upToDate, data);
})

eventEmiter.on(EventLists.UPDATE_PROGRESS, (data)=> {
eventEmitter.on(EventLists.UPDATE_PROGRESS, (data)=> {
console.log('UPDATE_PROGRESS', data.percent);
SendMessageToSettingWindow(SettingPageTypeMessage.downloadingUpdate, {percent: data.percent});
SendMessageToSettingWindow(SettingPageTypeMessage.downloadingUpdate, {percent: Math.floor(data.percent || 0)});
})

eventEmiter.on(EventLists.UPDATE_DOWNLOADED, (data)=> {
eventEmitter.on(EventLists.UPDATE_DOWNLOADED, (data)=> {
console.log('UPDATE_DOWNLOADED', data);
SendMessageToSettingWindow(SettingPageTypeMessage.downloaded, data);
})

eventEmiter.on(EventLists.UPDATE_CANCELLED, (data)=> {
eventEmitter.on(EventLists.UPDATE_CANCELLED, (data)=> {
console.log('UPDATE_CANCELLED', data);
})
}
Expand Down
4 changes: 3 additions & 1 deletion apps/server-web/src/renderer/components/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export function Popup(props: Props) {
{props.type == 'success' ? 'Success' : 'Error'}
</h3>
<div className="mt-2">
<p className="text-sm text-gray-500">{props.message}</p>
<p className="text-sm text-gray-500 text-pretty break-words">
{props.message}
</p>
</div>
</div>
</div>
Expand Down
5 changes: 0 additions & 5 deletions apps/server-web/src/renderer/components/Server.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { useEffect, useState } from 'react';
import { SettingPageTypeMessage } from '../../main/helpers/constant';

interface IPopup {
tyoe: 'success' | 'error' | 'none';
isShow: boolean;
}

interface IServerSetting {
PORT: number;
GAUZY_API_SERVER_URL: string;
Expand Down

0 comments on commit 334e172

Please sign in to comment.