@plasosdk/plaso-electron-sdk 1.3.14 → 1.3.15-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -13
- package/README.md +772 -751
- package/index.html +275 -275
- package/index.js +6 -6
- package/js/macro.js +88 -86
- package/js/main.js +34 -34
- package/js/render.js +434 -420
- package/js/util.js +109 -109
- package/package.json +28 -28
- package/scripts/getConfig.js +16 -16
- package/scripts/install.js +165 -165
- package/scripts/logger.js +138 -138
package/js/macro.js
CHANGED
|
@@ -1,86 +1,88 @@
|
|
|
1
|
-
const ERROR_CODE = {
|
|
2
|
-
/** 非 electron 环境 */
|
|
3
|
-
NO_ELECTRON_ENVIRONMENT: -1,
|
|
4
|
-
/** 获取remote 失败 */
|
|
5
|
-
GET_REMOTE_FAIL: -2,
|
|
6
|
-
/** 获取 屏幕信息 失败 */
|
|
7
|
-
GET_DISPLAY_INFO_FAIL: -3,
|
|
8
|
-
/** 课堂窗口同时仅能存在一个 */
|
|
9
|
-
CLASS_WINODW_GREATER_THAN_ONE: -4,
|
|
10
|
-
/** 未知的异常错误 */
|
|
11
|
-
COMMOM_ERROR: -99,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const LESSON_TYPE = {
|
|
15
|
-
/** 课堂 */
|
|
16
|
-
LIVECLASS: 'liveClass',
|
|
17
|
-
/** 备课 */
|
|
18
|
-
PREPARE_LESSONS: 'prepareLesson',
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/** 课堂窗口与外部窗口通讯的消息 */
|
|
22
|
-
const CLASS_WINDOW_MESG_TYPE = {
|
|
23
|
-
/** 课堂dom渲染成功后告知外部应用窗口,传参用户信息 */
|
|
24
|
-
LIVE_WINDOW_READY: 'liveWindowReady',
|
|
25
|
-
/** 课堂结束 */
|
|
26
|
-
ON_CLASS_FINISHED: 'onClassFinished',
|
|
27
|
-
/** 初始化 globalAppInfo */
|
|
28
|
-
INIT_GLOBAL_APPINFO: 'init_global_appinfo',
|
|
29
|
-
/** html ready */
|
|
30
|
-
HTML_READY: 'html_ready',
|
|
31
|
-
/** 保存白板文件 */
|
|
32
|
-
SAVE_BOARD: 'save_board',
|
|
33
|
-
/** 响应保存白板文件 */
|
|
34
|
-
RESP_SAVE_BOARD: 'resp_save_board',
|
|
35
|
-
/** 插入白板文件 */
|
|
36
|
-
INSERT_BOARD: 'insert_board',
|
|
37
|
-
/** 打开资料中心 */
|
|
38
|
-
OPEN_RESOURCE_CENTER: 'open_resource_center',
|
|
39
|
-
/** 插入文件 */
|
|
40
|
-
INSERT_OBJECT: 'insertObject',
|
|
41
|
-
/** 通知外部调用getExtFileName */
|
|
42
|
-
GET_EXT_FILE_NAME: 'getExtFileName',
|
|
43
|
-
/** 响应getExtFileName */
|
|
44
|
-
RESP_GET_EXT_FILE_NAME: 'respGetExtFileName',
|
|
45
|
-
/** 通知外部调用getPreParseFileName */
|
|
46
|
-
GET_PRE_PARSE_FILE_NAME: 'getPreParseFileName',
|
|
47
|
-
/** 响应getPreParseFileName */
|
|
48
|
-
RESP_GET_PRE_PARSE_FILE_NAME: 'respGetPreParseFileName',
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
const ERROR_CODE = {
|
|
2
|
+
/** 非 electron 环境 */
|
|
3
|
+
NO_ELECTRON_ENVIRONMENT: -1,
|
|
4
|
+
/** 获取remote 失败 */
|
|
5
|
+
GET_REMOTE_FAIL: -2,
|
|
6
|
+
/** 获取 屏幕信息 失败 */
|
|
7
|
+
GET_DISPLAY_INFO_FAIL: -3,
|
|
8
|
+
/** 课堂窗口同时仅能存在一个 */
|
|
9
|
+
CLASS_WINODW_GREATER_THAN_ONE: -4,
|
|
10
|
+
/** 未知的异常错误 */
|
|
11
|
+
COMMOM_ERROR: -99,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const LESSON_TYPE = {
|
|
15
|
+
/** 课堂 */
|
|
16
|
+
LIVECLASS: 'liveClass',
|
|
17
|
+
/** 备课 */
|
|
18
|
+
PREPARE_LESSONS: 'prepareLesson',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** 课堂窗口与外部窗口通讯的消息 */
|
|
22
|
+
const CLASS_WINDOW_MESG_TYPE = {
|
|
23
|
+
/** 课堂dom渲染成功后告知外部应用窗口,传参用户信息 */
|
|
24
|
+
LIVE_WINDOW_READY: 'liveWindowReady',
|
|
25
|
+
/** 课堂结束 */
|
|
26
|
+
ON_CLASS_FINISHED: 'onClassFinished',
|
|
27
|
+
/** 初始化 globalAppInfo */
|
|
28
|
+
INIT_GLOBAL_APPINFO: 'init_global_appinfo',
|
|
29
|
+
/** html ready */
|
|
30
|
+
HTML_READY: 'html_ready',
|
|
31
|
+
/** 保存白板文件 */
|
|
32
|
+
SAVE_BOARD: 'save_board',
|
|
33
|
+
/** 响应保存白板文件 */
|
|
34
|
+
RESP_SAVE_BOARD: 'resp_save_board',
|
|
35
|
+
/** 插入白板文件 */
|
|
36
|
+
INSERT_BOARD: 'insert_board',
|
|
37
|
+
/** 打开资料中心 */
|
|
38
|
+
OPEN_RESOURCE_CENTER: 'open_resource_center',
|
|
39
|
+
/** 插入文件 */
|
|
40
|
+
INSERT_OBJECT: 'insertObject',
|
|
41
|
+
/** 通知外部调用getExtFileName */
|
|
42
|
+
GET_EXT_FILE_NAME: 'getExtFileName',
|
|
43
|
+
/** 响应getExtFileName */
|
|
44
|
+
RESP_GET_EXT_FILE_NAME: 'respGetExtFileName',
|
|
45
|
+
/** 通知外部调用getPreParseFileName */
|
|
46
|
+
GET_PRE_PARSE_FILE_NAME: 'getPreParseFileName',
|
|
47
|
+
/** 响应getPreParseFileName */
|
|
48
|
+
RESP_GET_PRE_PARSE_FILE_NAME: 'respGetPreParseFileName',
|
|
49
|
+
/** 上报问题 */
|
|
50
|
+
REPORT_ISSUES: 'reportIssues',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const LEVEL = {
|
|
54
|
+
error: 3,
|
|
55
|
+
warn: 2,
|
|
56
|
+
info: 1,
|
|
57
|
+
debug: 0,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** 渲染进程——》主进程通讯的消息 */
|
|
61
|
+
const RENDER_TO_MAIN_MESG_TYPE = {
|
|
62
|
+
/** 初始化dump生成位置 */
|
|
63
|
+
PLASO_INIT_LOG_PATH: 'plaso-init-log-path',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** 插入的文件类型 */
|
|
67
|
+
const FILE_TYPE = {
|
|
68
|
+
PPT: 1,
|
|
69
|
+
IMAGE: 2,
|
|
70
|
+
PDF: 3,
|
|
71
|
+
WORD: 4,
|
|
72
|
+
EXCEL: 5,
|
|
73
|
+
AUDIO: 6,
|
|
74
|
+
VIDEO: 7,
|
|
75
|
+
DOC: 14,
|
|
76
|
+
XLS: 15,
|
|
77
|
+
ISPRINGPPT: 21,
|
|
78
|
+
PREPARE_LESSONS: 22,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
module.exports = {
|
|
82
|
+
LESSON_TYPE,
|
|
83
|
+
ERROR_CODE,
|
|
84
|
+
CLASS_WINDOW_MESG_TYPE,
|
|
85
|
+
LEVEL,
|
|
86
|
+
RENDER_TO_MAIN_MESG_TYPE,
|
|
87
|
+
FILE_TYPE,
|
|
88
|
+
};
|
package/js/main.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
const isElectron = !!process.versions['electron'];
|
|
2
|
-
if (isElectron) {
|
|
3
|
-
try {
|
|
4
|
-
require('@plasosdk/winproxy');
|
|
5
|
-
require('@plasosdk/screenshot');
|
|
6
|
-
} catch (error) {
|
|
7
|
-
console.error(error);
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
const { RENDER_TO_MAIN_MESG_TYPE } = require('./macro');
|
|
11
|
-
|
|
12
|
-
const { app, ipcMain, crashReporter } = require('electron');
|
|
13
|
-
|
|
14
|
-
// 首次添加此开关是为了解决一些GPU导致的渲染问题的,比如进课堂白屏,历史课堂播放进度条不动。
|
|
15
|
-
// 支持虚拟声卡需要添加此开关
|
|
16
|
-
app.commandLine.appendSwitch('--no-sandbox');
|
|
17
|
-
|
|
18
|
-
ipcMain.on(RENDER_TO_MAIN_MESG_TYPE.PLASO_INIT_LOG_PATH, function (e, logFilePath) {
|
|
19
|
-
app.setPath('crashDumps', logFilePath);
|
|
20
|
-
crashReporter.start({ submitURL: '', uploadToServer: false });
|
|
21
|
-
});
|
|
22
|
-
} catch (e) {
|
|
23
|
-
console.error(e);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function initRemoteMain(remoteMain) {
|
|
28
|
-
const { initRemoteMain } = require('@plasosdk/winproxy');
|
|
29
|
-
if (remoteMain) initRemoteMain(remoteMain);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = {
|
|
33
|
-
initRemoteMain: initRemoteMain,
|
|
34
|
-
};
|
|
1
|
+
const isElectron = !!process.versions['electron'];
|
|
2
|
+
if (isElectron) {
|
|
3
|
+
try {
|
|
4
|
+
require('@plasosdk/winproxy');
|
|
5
|
+
require('@plasosdk/screenshot');
|
|
6
|
+
} catch (error) {
|
|
7
|
+
console.error(error);
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const { RENDER_TO_MAIN_MESG_TYPE } = require('./macro');
|
|
11
|
+
|
|
12
|
+
const { app, ipcMain, crashReporter } = require('electron');
|
|
13
|
+
|
|
14
|
+
// 首次添加此开关是为了解决一些GPU导致的渲染问题的,比如进课堂白屏,历史课堂播放进度条不动。
|
|
15
|
+
// 支持虚拟声卡需要添加此开关
|
|
16
|
+
app.commandLine.appendSwitch('--no-sandbox');
|
|
17
|
+
|
|
18
|
+
ipcMain.on(RENDER_TO_MAIN_MESG_TYPE.PLASO_INIT_LOG_PATH, function (e, logFilePath) {
|
|
19
|
+
app.setPath('crashDumps', logFilePath);
|
|
20
|
+
crashReporter.start({ submitURL: '', uploadToServer: false });
|
|
21
|
+
});
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.error(e);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function initRemoteMain(remoteMain) {
|
|
28
|
+
const { initRemoteMain } = require('@plasosdk/winproxy');
|
|
29
|
+
if (remoteMain) initRemoteMain(remoteMain);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
initRemoteMain: initRemoteMain,
|
|
34
|
+
};
|