WorkerFactory.js
2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* @Author: cen
* @Date: 2026-04-01 15:45:43
* @Description:
* @FilePath: /gl_tape/ws/WorkerFactory.js
* @LastEditTime: 2026-04-08 15:30:11
* @LastEditors: cenchengwei@foreverht.com
* 可以输入预定的版权声明、个性签名、空行等
*/
import LogsWorker from './workers/LogsWorker'
import CommonWorker from './workers/CommonWorker'
import MessageWorker from './workers/MessageWorker'
import StorageWorker from './workers/StorageWorker'
import RecordsWorker from './workers/RecordsWorker'
import RemoveLogWorker from './workers/RemoveLogWorker'
import GetLogListWorker from './workers/GetLogListWorker'
import StopPollingWorker from './workers/StopPollingWorker'
import RemoveRecordWorker from './workers/RemoveRecordWorker'
import StartPollingWorker from './workers/StartPollingWorker'
import SetPollingIntervalWorker from './workers/SetPollingIntervalWorker'
import TempRecordsWorker from './workers/TempRecordsWorker'
import RemoveTempRecordWorker from './workers/RemoveTempRecordWorker'
import AddTempRecordWorker from './workers/AddTempRecordWorker'
import AddRecordWorker from './workers/AddRecordWorker'
import SqlWorker from './workers/SqlWorker'
import LiveLogWorker from './workers/LiveLogWorker'
import FileExplorerWorker from './workers/FileExplorerWorker'
import UploadFileWorker from './workers/UploadFileWorker'
import { Command } from './constants'
const Workers = {
[Command.GetLog]: LogsWorker,
[Command.Records]: RecordsWorker,
[Command.Message]: MessageWorker,
[Command.RemoveLog]: RemoveLogWorker,
[Command.GetStorage]: StorageWorker,
[Command.GetLogList]: GetLogListWorker,
[Command.StopPolling]: StopPollingWorker,
[Command.RemoveRecord]: RemoveRecordWorker,
[Command.StartPolling]: StartPollingWorker,
[Command.SetPollingInterval]: SetPollingIntervalWorker,
[Command.TempRecords]: TempRecordsWorker,
[Command.RemoveTempRecord]: RemoveTempRecordWorker,
[Command.AddTempRecord]: AddTempRecordWorker,
[Command.AddRecord]: AddRecordWorker,
[Command.ExecuteSql]: SqlWorker,
[Command.LiveLog]: LiveLogWorker,
[Command.FileExplorer]: FileExplorerWorker,
[Command.UploadFile]: UploadFileWorker
}
export default {
create: cmd => Workers[cmd] || CommonWorker
}