Skip to content

Commit 96775f2

Browse files
authored
Merge pull request #217 from entrylabs/develop
version up : 2.1.24
2 parents e2542dc + e99f81b commit 96775f2

File tree

6 files changed

+58
-31
lines changed

6 files changed

+58
-31
lines changed

build/entryx64.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!define MUI_UNICON "icon.ico"
1414
!define PRODUCT_NAME "Entry"
1515
!define APP_NAME "Entry.exe"
16-
!define PRODUCT_VERSION "2.1.23"
16+
!define PRODUCT_VERSION "2.1.24"
1717
!define PRODUCT_PUBLISHER "EntryLabs"
1818
!define PRODUCT_WEB_SITE "http://www.playentry.org/"
1919

build/entryx86.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!define MUI_UNICON "icon.ico"
1414
!define PRODUCT_NAME "Entry"
1515
!define APP_NAME "Entry.exe"
16-
!define PRODUCT_VERSION "2.1.23"
16+
!define PRODUCT_VERSION "2.1.24"
1717
!define PRODUCT_PUBLISHER "EntryLabs"
1818
!define PRODUCT_WEB_SITE "http://www.playentry.org/"
1919

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"private": true,
33
"productName": "Entry",
44
"name": "entry",
5-
"version": "2.1.23",
5+
"version": "2.1.24",
66
"description": "Entry for offline",
77
"main": "src/main_build/main.bundle.js",
88
"scripts": {
9-
"start": "cross-env NODE_ENV=development electron . --debug",
9+
"start": "cross-env NODE_ENV=development SERVER_DOMAIN_DEV='http://local2.playentry.org' HW_LOG_ENDPOINT='/api/hwActionLog' electron . --debug",
1010
"debug": "cross-env NODE_ENV=development electron --inspect .",
1111
"prod:debug": "cross-env NODE_ENV=production electron --inspect . --debug",
1212
"prod:debug:brk": "cross-env NODE_ENV=production electron --inspect-brk=5858 .",
@@ -19,7 +19,7 @@
1919
"dist:win64": "cross-env NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider webpack && electron-builder -c --win --x64",
2020
"dist:win": "cross-env NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider webpack && electron-builder -c --win --x64 && electron-builder -c --win --ia32",
2121
"dist:mac:notarize": "cross-env NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider webpack && cross-env NOTARIZE=true electron-builder -c --mac",
22-
"dist:mac": "cross-env NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider webpack && cross-env NOTARIZE=false electron-builder -c --mac",
22+
"dist:mac": "cross-env SERVER_DOMAIN_DEV='http://local2.playentry.org' HW_LOG_ENDPOINT='/api/hwActionLog' NODE_ENV=production NODE_OPTIONS=--openssl-legacy-provider webpack && cross-env NOTARIZE=false electron-builder -c --mac",
2323
"rebuild": "electron-rebuild -f",
2424
"postinstall": "yarn run rebuild && yarn run webpack:dev"
2525
},
@@ -39,8 +39,8 @@
3939
"async-csv": "^2.1.3",
4040
"axios": "^0.19.2",
4141
"cross-spawn": "^7.0.3",
42-
"entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.61_2",
43-
"entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.23",
42+
"entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.62",
43+
"entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.24",
4444
"entry-tool": "git+https://github.com/entrylabs/entry-tool.git#dist/20231026",
4545
"@entrylabs/legacy-video": "^1.0.0",
4646
"excel4node": "^1.7.0",
@@ -54,6 +54,7 @@
5454
"music-metadata": "^6.3.0",
5555
"node-abi": "^3.28.0",
5656
"node-xlsx": "^0.15.0",
57+
"systeminformation": "^5.22.11",
5758
"puid": "^1.0.7",
5859
"rimraf": "^2.6.3",
5960
"sass": "^1.57.1",

src/main/commonUtils.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,20 @@ class CommonUtils {
6262
const filename = entryObject.filename;
6363
const extension = CommonUtils.sanitizeExtension(
6464
entryObject.ext || entryObject.extension,
65-
defaultExtension,
65+
defaultExtension
6666
);
6767

6868
return `${filename}${extension}`;
6969
}
7070

71+
static getEntryDomain() {
72+
if (process.env.NODE_ENV === 'production') {
73+
return 'https://playentry.org';
74+
} else {
75+
return process.env.SERVER_DOMAIN_DEV ? process.env.SERVER_DOMAIN_DEV : undefined;
76+
}
77+
}
78+
7179
static lpad(str: string, len: number) {
7280
const strLen = str.length;
7381
let paddedString = str;
@@ -79,20 +87,15 @@ class CommonUtils {
7987
return String(paddedString);
8088
}
8189

82-
static getPaddedVersion(version: string | number) {
90+
static getPaddedVersion = (version: string | undefined) => {
8391
if (!version) {
84-
return '';
92+
return;
8593
}
86-
const versionString = String(version);
87-
88-
const padded: string[] = [];
89-
const splitVersion = versionString.split('.');
90-
splitVersion.forEach((item) => {
91-
padded.push(this.lpad(item, 4));
92-
});
93-
94-
return padded.join('.');
95-
}
94+
return version
95+
.split('.')
96+
.map((number) => number.padStart(4, '0'))
97+
.join('.');
98+
};
9699
}
97100

98101
export default CommonUtils;

src/main/utils/serverProcessManager.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import EntryServer from 'entry-hw-server';
22
import { app } from 'electron';
3+
import CommonUtils from '../commonUtils';
34
import HardwareModuleManager from './hardwareModuleManager';
45
import path from 'path';
56

@@ -33,7 +34,9 @@ class ServerProcessManager {
3334

3435
open() {
3536
this._receiveFromChildEventRegister();
36-
this.childProcess.open();
37+
const offlineVersion = CommonUtils.getPaddedVersion(global.sharedObject.version);
38+
const getEntryDomain = CommonUtils.getEntryDomain();
39+
this.childProcess.open(offlineVersion, getEntryDomain);
3740
}
3841

3942
close() {
@@ -52,6 +55,14 @@ class ServerProcessManager {
5255
this.childProcess.sendToClient(data);
5356
}
5457

58+
connectHardwareSuccess(hardwareId: string) {
59+
this.childProcess.connectHardwareSuccess(hardwareId);
60+
}
61+
62+
connectHardwareFailed() {
63+
this.childProcess.connectHardwareFailed();
64+
}
65+
5566
_receiveFromChildEventRegister() {
5667
this.childProcess.on('cloudModeChanged', (mode: string) => {
5768
this.router.notifyCloudModeChanged(mode);
@@ -62,9 +73,7 @@ class ServerProcessManager {
6273
this.childProcess.on('data', (message: any) => {
6374
this.router.handleServerData(message);
6475
});
65-
this.childProcess.on('close', () => {
66-
67-
});
76+
this.childProcess.on('close', () => {});
6877
}
6978
}
7079

yarn.lock

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5208,13 +5208,15 @@ entities@^2.0.0:
52085208

52095209
"entry-hw-server@git+https://github.com/entrylabs/entry-hw-server.git#master":
52105210
version "2.0.0"
5211-
resolved "git+https://github.com/entrylabs/entry-hw-server.git#d8cf9abafdd2beee9f480fc1dfa7953233273cba"
5211+
resolved "git+https://github.com/entrylabs/entry-hw-server.git#c4718d51ac06b3f7e767561b335e946410378cf2"
52125212
dependencies:
52135213
crypto-js "^4.0.0"
5214+
node-fetch "^2.7.0"
5215+
systeminformation "^5.22.11"
52145216

5215-
"entry-hw@git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.61_2":
5216-
version "1.9.61"
5217-
resolved "git+https://github.com/entrylabs/entry-hw.git#882fcea120ed448d3200d6058c4e5a94b75d18a7"
5217+
"entry-hw@git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.62":
5218+
version "1.9.62"
5219+
resolved "git+https://github.com/entrylabs/entry-hw.git#4dd433374df09e5fcb839581fcd712402b503105"
52185220
dependencies:
52195221
cross-spawn "^7.0.0"
52205222
fs-extra "^8.1.0"
@@ -5229,9 +5231,9 @@ entities@^2.0.0:
52295231
winston "^3.2.1"
52305232
winston-daily-rotate-file "^4.4.2"
52315233

5232-
"entry-js@git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.23":
5233-
version "4.0.14"
5234-
resolved "git+https://github.com/entrylabs/entryjs.git#0920d5d4049c314536ec4596c28d969c281b6c06"
5234+
"entry-js@git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.24":
5235+
version "4.0.17"
5236+
resolved "git+https://github.com/entrylabs/entryjs.git#517f7e3615639af46728cf4e5dfaa250d552c119"
52355237
dependencies:
52365238
uid "^0.0.2"
52375239
"@entrylabs/event" "^1.0.3"
@@ -9251,6 +9253,13 @@ node-fetch@^1.0.1:
92519253
encoding "^0.1.11"
92529254
is-stream "^1.0.1"
92539255

9256+
node-fetch@^2.7.0:
9257+
version "2.7.0"
9258+
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
9259+
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
9260+
dependencies:
9261+
whatwg-url "^5.0.0"
9262+
92549263
node-fetch@~2.1.2:
92559264
version "2.1.2"
92569265
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5"
@@ -12008,6 +12017,11 @@ symbol-tree@^3.2.2:
1200812017
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
1200912018
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
1201012019

12020+
systeminformation@^5.22.11:
12021+
version "5.25.11"
12022+
resolved "https://registry.yarnpkg.com/systeminformation/-/systeminformation-5.25.11.tgz#7d47a14dafbc9cf6c21bc02d19a2121a8c770d88"
12023+
integrity sha512-jI01fn/t47rrLTQB0FTlMCC+5dYx8o0RRF+R4BPiUNsvg5OdY0s9DKMFmJGrx5SwMZQ4cag0Gl6v8oycso9b/g==
12024+
1201112025
table@^6.0.9:
1201212026
version "6.8.1"
1201312027
resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf"

0 commit comments

Comments
 (0)