verteilen-core 1.2.4 → 1.2.7

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.
Files changed (142) hide show
  1. package/dist/client/analysis.d.ts +35 -0
  2. package/dist/client/analysis.js +382 -0
  3. package/dist/client/client.d.ts +25 -0
  4. package/dist/client/client.js +227 -0
  5. package/dist/client/cluster.d.ts +1 -0
  6. package/dist/{src/client → client}/cluster.js +1 -2
  7. package/dist/client/database.d.ts +13 -0
  8. package/dist/client/database.js +37 -0
  9. package/dist/client/execute.d.ts +24 -0
  10. package/dist/{src/client → client}/execute.js +61 -51
  11. package/dist/client/http.d.ts +7 -0
  12. package/dist/client/http.js +40 -0
  13. package/dist/client/javascript.d.ts +47 -0
  14. package/dist/{src/client → client}/javascript.js +110 -136
  15. package/dist/client/job_database.d.ts +10 -0
  16. package/dist/client/job_database.js +34 -0
  17. package/dist/client/job_execute.d.ts +20 -0
  18. package/dist/client/job_execute.js +173 -0
  19. package/dist/client/os.d.ts +29 -0
  20. package/dist/client/os.js +197 -0
  21. package/dist/client/resource.d.ts +7 -0
  22. package/dist/client/resource.js +107 -0
  23. package/dist/client/shell.d.ts +16 -0
  24. package/dist/client/shell.js +122 -0
  25. package/dist/computed.d.ts +13 -0
  26. package/dist/index.d.ts +3 -0
  27. package/dist/index.js +3 -3
  28. package/dist/interface/base.d.ts +70 -0
  29. package/dist/interface/bus.d.ts +90 -0
  30. package/dist/interface/enum.d.ts +143 -0
  31. package/dist/interface/execute.d.ts +20 -0
  32. package/dist/interface/record.d.ts +93 -0
  33. package/dist/interface/server.d.ts +76 -0
  34. package/dist/interface/struct.d.ts +182 -0
  35. package/dist/interface/table.d.ts +20 -0
  36. package/dist/interface/ui.d.ts +29 -0
  37. package/dist/interface.d.ts +29 -0
  38. package/dist/plugins/i18n.d.ts +1666 -0
  39. package/dist/script/console_manager.d.ts +18 -0
  40. package/dist/script/console_manager.js +131 -0
  41. package/dist/script/console_server_manager.d.ts +13 -0
  42. package/dist/script/console_server_manager.js +40 -0
  43. package/dist/script/execute/base.d.ts +45 -0
  44. package/dist/script/execute/base.js +200 -0
  45. package/dist/script/execute/feedback.d.ts +12 -0
  46. package/dist/script/execute/feedback.js +179 -0
  47. package/dist/script/execute/interface.d.ts +8 -0
  48. package/dist/script/execute/region_job.d.ts +5 -0
  49. package/dist/{src/script → script}/execute/region_job.js +1 -0
  50. package/dist/script/execute/region_project.d.ts +10 -0
  51. package/dist/{src/script → script}/execute/region_project.js +4 -0
  52. package/dist/script/execute/region_subtask.d.ts +5 -0
  53. package/dist/{src/script → script}/execute/region_subtask.js +1 -0
  54. package/dist/script/execute/region_task.d.ts +10 -0
  55. package/dist/{src/script → script}/execute/region_task.js +4 -0
  56. package/dist/script/execute/runner.d.ts +14 -0
  57. package/dist/script/execute/runner.js +264 -0
  58. package/dist/script/execute/util_parser.d.ts +14 -0
  59. package/dist/script/execute/util_parser.js +135 -0
  60. package/dist/script/execute_manager.d.ts +25 -0
  61. package/dist/script/execute_manager.js +297 -0
  62. package/dist/script/socket_manager.d.ts +31 -0
  63. package/dist/script/socket_manager.js +263 -0
  64. package/dist/script/webhook_manager.d.ts +3 -0
  65. package/dist/script/webhook_server_manager.d.ts +13 -0
  66. package/dist/script/webhook_server_manager.js +133 -0
  67. package/dist/server/detail.d.ts +72 -0
  68. package/dist/server/detail.js +451 -0
  69. package/dist/server/io.d.ts +46 -0
  70. package/dist/{src/server → server}/io.js +42 -51
  71. package/dist/server/plugin.d.ts +18 -0
  72. package/dist/{src/server → server}/plugin.js +45 -54
  73. package/dist/server/server.d.ts +27 -0
  74. package/dist/server/server.js +53 -0
  75. package/dist/server.d.ts +4 -0
  76. package/dist/util/console_handle.d.ts +20 -0
  77. package/dist/util/console_handle.js +244 -0
  78. package/dist/util/log_handle.d.ts +23 -0
  79. package/dist/util/log_handle.js +224 -0
  80. package/index.ts +1 -6
  81. package/package.json +1 -1
  82. package/src/index.ts +6 -0
  83. package/test/TEST.d.ts +1 -0
  84. package/test/TEST.js +88 -0
  85. package/test/client/execute.test.d.ts +1 -0
  86. package/{dist/test → test}/client/execute.test.js +6 -15
  87. package/test/client/javascript.test.d.ts +1 -0
  88. package/{dist/test → test}/client/javascript.test.js +21 -30
  89. package/test/client/server.test.d.ts +1 -0
  90. package/test/client/task.test.d.ts +1 -0
  91. package/{dist/test → test}/client/task.test.js +1 -1
  92. package/test/script/parser.test.d.ts +1 -0
  93. package/test/script/socket.test.d.ts +1 -0
  94. package/tsconfig.json +8 -4
  95. package/dist/jest.config.js +0 -8
  96. package/dist/src/client/analysis.js +0 -383
  97. package/dist/src/client/client.js +0 -233
  98. package/dist/src/client/database.js +0 -36
  99. package/dist/src/client/http.js +0 -37
  100. package/dist/src/client/job_database.js +0 -36
  101. package/dist/src/client/job_execute.js +0 -171
  102. package/dist/src/client/job_parameter.js +0 -36
  103. package/dist/src/client/os.js +0 -202
  104. package/dist/src/client/parameter.js +0 -36
  105. package/dist/src/client/resource.js +0 -118
  106. package/dist/src/client/shell.js +0 -118
  107. package/dist/src/script/console_manager.js +0 -125
  108. package/dist/src/script/console_server_manager.js +0 -37
  109. package/dist/src/script/execute/base.js +0 -197
  110. package/dist/src/script/execute/feedback.js +0 -188
  111. package/dist/src/script/execute/runner.js +0 -274
  112. package/dist/src/script/execute/util_parser.js +0 -137
  113. package/dist/src/script/execute_manager.js +0 -309
  114. package/dist/src/script/socket_manager.js +0 -260
  115. package/dist/src/script/webhook_server_manager.js +0 -140
  116. package/dist/src/server/detail.js +0 -428
  117. package/dist/src/server/server.js +0 -51
  118. package/dist/src/util/console_handle.js +0 -248
  119. package/dist/src/util/log_handle.js +0 -230
  120. package/dist/src/util/server/console_handle.js +0 -248
  121. package/dist/src/util/server/log_handle.js +0 -230
  122. package/dist/test/TEST.js +0 -105
  123. /package/dist/{src/computed.js → computed.js} +0 -0
  124. /package/dist/{src/interface → interface}/base.js +0 -0
  125. /package/dist/{src/interface → interface}/bus.js +0 -0
  126. /package/dist/{src/interface → interface}/enum.js +0 -0
  127. /package/dist/{src/interface → interface}/execute.js +0 -0
  128. /package/dist/{src/interface → interface}/record.js +0 -0
  129. /package/dist/{src/interface → interface}/server.js +0 -0
  130. /package/dist/{src/interface → interface}/struct.js +0 -0
  131. /package/dist/{src/interface → interface}/table.js +0 -0
  132. /package/dist/{src/interface → interface}/ui.js +0 -0
  133. /package/dist/{src/interface.js → interface.js} +0 -0
  134. /package/dist/{src/lan → lan}/en.json +0 -0
  135. /package/dist/{src/lan → lan}/zh_TW.json +0 -0
  136. /package/dist/{src/plugins → plugins}/i18n.js +0 -0
  137. /package/dist/{src/script → script}/execute/interface.js +0 -0
  138. /package/dist/{src/script → script}/webhook_manager.js +0 -0
  139. /package/dist/{src/server.js → server.js} +0 -0
  140. /package/{dist/test → test}/client/server.test.js +0 -0
  141. /package/{dist/test → test}/script/parser.test.js +0 -0
  142. /package/{dist/test → test}/script/socket.test.js +0 -0
@@ -1,428 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServerDetail = void 0;
4
- const uuid_1 = require("uuid");
5
- const interface_1 = require("../interface");
6
- const console_handle_1 = require("../util/console_handle");
7
- const log_handle_1 = require("../util/log_handle");
8
- class ServerDetail {
9
- constructor(loader, backend, feedback, message, messager_log, t) {
10
- this.execute_manager = [];
11
- this.shellBind = new Map();
12
- this.re = [];
13
- this.NewConnection = (x) => {
14
- const p = {
15
- title: this.t('toast.connection-create-title'),
16
- type: 'success',
17
- message: `${this.t('toast.connection-create-des')}: ${x.websocket.url} \n${x.uuid}`
18
- };
19
- if (this.feedback.electron) {
20
- this.feedback.electron('makeToast', p);
21
- }
22
- if (this.feedback.socket && this.backend.Boradcasting) {
23
- this.backend.Boradcasting('makeToast', p);
24
- }
25
- this.execute_manager.forEach(y => {
26
- y.manager.NewConnection(x);
27
- });
28
- };
29
- this.DisConnection = (x) => {
30
- const p = {
31
- title: this.t('toast.connection-remove-title'),
32
- type: 'error',
33
- message: `${this.t('toast.connection-remove-des')}: ${x.websocket.url} \n${x.uuid}`
34
- };
35
- if (this.feedback.electron) {
36
- this.feedback.electron('makeToast', p);
37
- }
38
- if (this.feedback.socket && this.backend.Boradcasting) {
39
- this.backend.Boradcasting('makeToast', p);
40
- }
41
- this.execute_manager.forEach(y => {
42
- y.manager.Disconnect(x);
43
- });
44
- };
45
- this.Analysis = (d) => {
46
- this.execute_manager.forEach(x => x.manager.Analysis(JSON.parse(JSON.stringify(d))));
47
- };
48
- this.shellReply = (data, p) => {
49
- if (this.feedback.electron) {
50
- this.feedback.electron("shellReply", data);
51
- }
52
- if (this.feedback.socket) {
53
- if (p == undefined)
54
- return;
55
- if (this.shellBind.has(p.uuid)) {
56
- const k = this.shellBind.get(p.uuid);
57
- k.forEach(x => {
58
- const h = { name: "shellReply", data: data };
59
- x.send(JSON.stringify(h));
60
- });
61
- }
62
- }
63
- };
64
- this.folderReply = (data, p) => {
65
- if (this.feedback.electron) {
66
- this.feedback.electron("folderReply", data);
67
- }
68
- if (this.feedback.socket) {
69
- if (p == undefined)
70
- return;
71
- if (this.shellBind.has(p.uuid)) {
72
- const k = this.shellBind.get(p.uuid);
73
- k.forEach(x => {
74
- const h = {
75
- name: "folderReply", data: data
76
- };
77
- x.send(JSON.stringify(h));
78
- });
79
- }
80
- }
81
- };
82
- this.console_update = () => {
83
- const re = [];
84
- this.execute_manager.forEach(x => {
85
- if (x.record.running && !x.record.stop) {
86
- try {
87
- x.manager.Update();
88
- }
89
- catch (err) {
90
- x.record.stop = true;
91
- console.log(err);
92
- re.push({
93
- code: 400,
94
- name: err.name,
95
- message: err.message,
96
- stack: err.stack
97
- });
98
- }
99
- }
100
- if (x.record.stop) {
101
- if (x.manager.jobstack == 0) {
102
- x.record.running = false;
103
- }
104
- }
105
- if (x.record.command.length > 0) {
106
- const p = x.record.command.shift();
107
- if (p[0] == 'clean')
108
- this.console_clean(undefined, x.record.uuid);
109
- else if (p[0] == 'stop')
110
- this.console_stop(undefined, x.record.uuid);
111
- else if (p[0] == 'skip')
112
- this.console_skip(undefined, x.record.uuid, p[1], p[2]);
113
- else if (p[0] == 'execute')
114
- this.console_execute(undefined, x.record.uuid, p[1]);
115
- }
116
- });
117
- if (this.loader != undefined) {
118
- const logss = this.backend.memory.logs.filter(x => x.dirty && x.output);
119
- for (var x of logss) {
120
- x.dirty = false;
121
- const filename = this.loader.join(this.loader.root, "log", `${x.uuid}.json`);
122
- this.loader.write_string(filename, JSON.stringify(x, null, 4));
123
- }
124
- }
125
- return re;
126
- };
127
- this.resource_start = (socket, uuid) => {
128
- const p = this.websocket_manager.targets.find(x => x.uuid == uuid);
129
- const d = { name: 'resource_start', data: 0 };
130
- p === null || p === void 0 ? void 0 : p.websocket.send(JSON.stringify(d));
131
- };
132
- this.resource_end = (socket, uuid) => {
133
- const p = this.websocket_manager.targets.find(x => x.uuid == uuid);
134
- const d = { name: 'resource_end', data: 0 };
135
- p === null || p === void 0 ? void 0 : p.websocket.send(JSON.stringify(d));
136
- };
137
- this.shell_enter = (socket, uuid, value) => {
138
- this.websocket_manager.shell_enter(uuid, value);
139
- };
140
- this.shell_open = (socket, uuid) => {
141
- this.websocket_manager.shell_open(uuid);
142
- if (this.shellBind.has(uuid)) {
143
- this.shellBind.get(uuid).push(this.feedback.socket);
144
- }
145
- else {
146
- this.shellBind.set(uuid, [this.feedback.socket]);
147
- }
148
- };
149
- this.shell_close = (socket, uuid) => {
150
- this.websocket_manager.shell_close(uuid);
151
- if (this.shellBind.has(uuid)) {
152
- const p = this.shellBind.get(uuid);
153
- const index = p.findIndex(x => x == this.feedback.socket);
154
- if (index != -1)
155
- p.splice(index, 1);
156
- this.shellBind.set(uuid, p);
157
- }
158
- };
159
- this.shell_folder = (socket, uuid, path) => {
160
- this.websocket_manager.shell_folder(uuid, path);
161
- };
162
- this.node_list = (socket) => {
163
- var _a, _b;
164
- const p = (_a = this.websocket_manager) === null || _a === void 0 ? void 0 : _a.targets;
165
- if (socket != undefined) {
166
- const h = {
167
- name: "node_list-feedback",
168
- data: (_b = this.websocket_manager) === null || _b === void 0 ? void 0 : _b.targets
169
- };
170
- socket.send(JSON.stringify(h));
171
- }
172
- return p;
173
- };
174
- this.node_add = (socket, url, id) => {
175
- const p = this.websocket_manager.server_start(url, id);
176
- if (socket != undefined) {
177
- const h = {
178
- name: "node_add-feedback",
179
- data: p
180
- };
181
- socket.send(JSON.stringify(h));
182
- }
183
- };
184
- this.node_update = (socket) => {
185
- var _a;
186
- const p = (_a = this.websocket_manager) === null || _a === void 0 ? void 0 : _a.server_update();
187
- if (socket != undefined) {
188
- const h = {
189
- name: "node_update-feedback",
190
- data: [p]
191
- };
192
- socket.send(JSON.stringify(h));
193
- }
194
- return p;
195
- };
196
- this.node_delete = (socket, uuid, reason) => {
197
- this.websocket_manager.server_stop(uuid, reason);
198
- };
199
- this.console_list = (socket) => {
200
- if (this.feedback.electron) {
201
- return this.execute_manager.map(x => x.record).filter(x => x != undefined);
202
- }
203
- if (this.feedback.socket) {
204
- const h = {
205
- name: "console_list-feedback",
206
- data: this.execute_manager.map(x => x.record)
207
- };
208
- this.feedback.socket(JSON.stringify(h));
209
- }
210
- };
211
- this.console_record = (socket, uuid) => {
212
- var _a;
213
- const r = (_a = this.execute_manager.find(x => { var _a; return ((_a = x.record) === null || _a === void 0 ? void 0 : _a.uuid) == uuid; })) === null || _a === void 0 ? void 0 : _a.record;
214
- if (socket != undefined) {
215
- const h = {
216
- name: "console_record-feedback",
217
- data: JSON.stringify(r)
218
- };
219
- socket.send(JSON.stringify(h));
220
- }
221
- return JSON.stringify(r);
222
- };
223
- this.console_execute = (socket, uuid, type) => {
224
- const target = this.execute_manager.find(x => x.record.uuid == uuid);
225
- if (target == undefined)
226
- return;
227
- target.record.process_type = type;
228
- target.record.running = true;
229
- target.record.stop = false;
230
- target.manager.first = true;
231
- };
232
- this.console_stop = (socket, uuid) => {
233
- const target = this.execute_manager.find(x => x.record.uuid == uuid);
234
- if (target == undefined)
235
- return;
236
- target.record.stop = true;
237
- target.manager.Stop();
238
- };
239
- this.console_add = (socket, name, record, preference) => {
240
- record.projects.forEach(x => x.uuid = (0, uuid_1.v6)());
241
- const em = new interface_1.Execute_ExecuteManager.ExecuteManager(name, this.websocket_manager, this.message, JSON.parse(JSON.stringify(record)));
242
- const er = Object.assign(Object.assign({}, record), { uuid: em.uuid, name: name, running: false, stop: true, process_type: -1, useCron: false, para: undefined, command: [], project: '', task: '', project_index: -1, task_index: -1, project_state: [], task_state: [], task_detail: [] });
243
- em.libs = { libs: this.backend.memory.libs };
244
- const p = { manager: em, record: er };
245
- const uscp = new console_handle_1.Util_Server_Console_Proxy(p);
246
- const uslp = new log_handle_1.Util_Server_Log_Proxy(p, { logs: this.backend.memory.logs }, preference);
247
- em.proxy = this.CombineProxy([uscp.execute_proxy, uslp.execute_proxy]);
248
- const r = this.console.receivedPack(p, record);
249
- if (r)
250
- this.execute_manager.push(p);
251
- if (socket != undefined) {
252
- const h = {
253
- name: "console_add-feedback",
254
- data: r ? er : undefined
255
- };
256
- socket.send(JSON.stringify(h));
257
- }
258
- if (this.feedback.electron)
259
- return r ? er : undefined;
260
- };
261
- this.console_update_call = () => {
262
- const p = this.re;
263
- this.re = [];
264
- if (this.feedback.socket) {
265
- const h = {
266
- name: "console_update-feedback",
267
- data: JSON.stringify(p)
268
- };
269
- this.feedback.socket(JSON.stringify(h));
270
- }
271
- };
272
- this.console_clean = (socket, uuid) => {
273
- const target = this.execute_manager.find(x => x.record.uuid == uuid);
274
- if (target == undefined)
275
- return;
276
- target.manager.Clean();
277
- target.record.projects = [];
278
- target.record.project = "";
279
- target.record.task = "";
280
- target.record.project_index = -1;
281
- target.record.task_index = -1;
282
- target.record.project_state = [];
283
- target.record.task_state = [];
284
- target.record.task_detail = [];
285
- target.manager.Release();
286
- const index = this.execute_manager.findIndex(x => x.record.uuid == uuid);
287
- this.execute_manager.splice(index, 1);
288
- };
289
- this.console_skip = (socket, uuid, forward, type, state = interface_1.ExecuteState.FINISH) => {
290
- const target = this.execute_manager.find(x => x.record.uuid == uuid);
291
- if (target == undefined)
292
- return;
293
- if (type == 0) {
294
- target.record.project_state[target.record.project_index].state = forward ? (state != undefined ? state : interface_1.ExecuteState.FINISH) : interface_1.ExecuteState.NONE;
295
- target.record.project_index += forward ? 1 : -1;
296
- if (target.record.project_index == target.record.projects.length) {
297
- target.record.project_index = -1;
298
- this.console_clean(socket, uuid);
299
- }
300
- else {
301
- if (target.record.project_index < 0) {
302
- target.record.project_index = 0;
303
- }
304
- target.record.task_state = target.record.projects[target.record.project_index].task.map(x => {
305
- return {
306
- uuid: x.uuid,
307
- state: interface_1.ExecuteState.NONE
308
- };
309
- });
310
- target.record.task_detail = [];
311
- const p = target.record.projects[target.record.project_index];
312
- const t = p.task[target.record.task_index];
313
- const count = target.manager.get_task_state_count(t);
314
- for (let i = 0; i < count; i++) {
315
- target.record.task_detail.push({
316
- index: i,
317
- node: "",
318
- message: [],
319
- state: interface_1.ExecuteState.NONE
320
- });
321
- }
322
- const index = forward ? target.manager.SkipProject() : target.manager.PreviousProject();
323
- console.log("%s project, index: %d, next count: %d", forward ? "Skip" : "Previous", index, count);
324
- }
325
- }
326
- else if (type == 1) {
327
- const begining = target.record.task_state[0].state == interface_1.ExecuteState.NONE;
328
- if (!begining && forward)
329
- target.record.task_state[target.record.task_index].state = state != undefined ? state : interface_1.ExecuteState.FINISH;
330
- if (!forward)
331
- target.record.task_state[target.record.task_index].state = interface_1.ExecuteState.NONE;
332
- target.record.task_index += forward ? 1 : -1;
333
- if (target.record.task_index == target.record.task_state.length) {
334
- this.console_skip(socket, uuid, true, 0);
335
- }
336
- else {
337
- if (!begining && forward)
338
- target.record.task_state[target.record.task_index].state = state != undefined ? state : interface_1.ExecuteState.FINISH;
339
- else if (!forward)
340
- target.record.task_state[target.record.task_index].state = interface_1.ExecuteState.RUNNING;
341
- target.record.task_detail = [];
342
- const p = target.record.projects[target.record.project_index];
343
- const t = p.task[target.record.task_index];
344
- const count = target.manager.get_task_state_count(t);
345
- for (let i = 0; i < count; i++) {
346
- target.record.task_detail.push({
347
- index: i,
348
- node: "",
349
- message: [],
350
- state: interface_1.ExecuteState.NONE
351
- });
352
- }
353
- const index = forward ? target.manager.SkipTask() : target.manager.PreviousTask();
354
- console.log("Skip task, index: %d, next count: %d", index, count);
355
- }
356
- }
357
- };
358
- this.console_skip2 = (socket, uuid, v) => {
359
- const target = this.execute_manager.find(x => x.record.uuid == uuid);
360
- if (target == undefined)
361
- return;
362
- const index = target.manager.SkipSubTask(v);
363
- if (index < 0) {
364
- console.error("Skip step failed: ", index);
365
- return;
366
- }
367
- for (let i = 0; i < index; i++) {
368
- target.record.task_detail[i].state = interface_1.ExecuteState.FINISH;
369
- }
370
- console.log("Skip task", index);
371
- };
372
- this.CombineProxy = (eps) => {
373
- const p = {
374
- executeProjectStart: (data) => { eps.forEach(x => x.executeProjectStart(JSON.parse(JSON.stringify(data)))); },
375
- executeProjectFinish: (data) => { eps.forEach(x => x.executeProjectFinish(JSON.parse(JSON.stringify(data)))); },
376
- executeTaskStart: (data) => { eps.forEach(x => x.executeTaskStart(JSON.parse(JSON.stringify(data)))); },
377
- executeTaskFinish: (data) => { eps.forEach(x => x.executeTaskFinish(JSON.parse(JSON.stringify(data)))); },
378
- executeSubtaskStart: (data) => { eps.forEach(x => x.executeSubtaskStart(JSON.parse(JSON.stringify(data)))); },
379
- executeSubtaskUpdate: (data) => { eps.forEach(x => x.executeSubtaskUpdate(JSON.parse(JSON.stringify(data)))); },
380
- executeSubtaskFinish: (data) => { eps.forEach(x => x.executeSubtaskFinish(JSON.parse(JSON.stringify(data)))); },
381
- executeJobStart: (data) => { eps.forEach(x => x.executeJobStart(JSON.parse(JSON.stringify(data)))); },
382
- executeJobFinish: (data) => { eps.forEach(x => x.executeJobFinish(JSON.parse(JSON.stringify(data)))); },
383
- feedbackMessage: (data) => { eps.forEach(x => x.feedbackMessage(JSON.parse(JSON.stringify(data)))); },
384
- updateDatabase: (data) => { eps.forEach(x => x.updateDatabase(JSON.parse(JSON.stringify(data)))); },
385
- };
386
- return p;
387
- };
388
- this.loader = loader;
389
- this.backend = backend;
390
- this.feedback = feedback;
391
- this.message = message;
392
- this.messager_log = messager_log;
393
- this.t = t;
394
- const n = {
395
- shellReply: this.shellReply,
396
- folderReply: this.folderReply
397
- };
398
- this.websocket_manager = new interface_1.Execute_SocketManager.WebsocketManager(this.NewConnection, this.DisConnection, this.Analysis, messager_log, n);
399
- this.console = new interface_1.UtilServer_Console.Util_Server_Console();
400
- this.updatehandle = setInterval(() => {
401
- this.re.push(...this.console_update());
402
- }, interface_1.RENDER_UPDATETICK);
403
- }
404
- get events() {
405
- return {
406
- resource_start: this.resource_start,
407
- resource_end: this.resource_end,
408
- shell_enter: this.shell_enter,
409
- shell_open: this.shell_open,
410
- shell_close: this.shell_close,
411
- shell_folder: this.shell_folder,
412
- node_list: this.node_list,
413
- node_add: this.node_add,
414
- node_update: this.node_update,
415
- node_delete: this.node_delete,
416
- console_list: this.console_list,
417
- console_record: this.console_record,
418
- console_execute: this.console_execute,
419
- console_stop: this.console_stop,
420
- console_clean: this.console_clean,
421
- console_skip: this.console_skip,
422
- console_skip2: this.console_skip2,
423
- console_add: this.console_add,
424
- console_update: this.console_update,
425
- };
426
- }
427
- }
428
- exports.ServerDetail = ServerDetail;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Server = void 0;
4
- const io_1 = require("./io");
5
- class Server {
6
- constructor() {
7
- this.manager = [];
8
- this.memory = {
9
- projects: [],
10
- database: [],
11
- nodes: [],
12
- logs: [],
13
- libs: [],
14
- user: [],
15
- };
16
- this.plugin = {
17
- templates: [],
18
- plugins: [],
19
- };
20
- this.io = undefined;
21
- this.loader = undefined;
22
- this.plugin_loader = undefined;
23
- this.LoadFromDisk = () => {
24
- const ts = [
25
- this.current_loader.project.load_all(),
26
- this.current_loader.database.load_all(),
27
- this.current_loader.node.load_all(),
28
- this.current_loader.log.load_all(),
29
- this.current_loader.lib.load_all(),
30
- this.current_loader.user.load_all(),
31
- ];
32
- return Promise.all(ts);
33
- };
34
- this.Boradcasting = (name, data) => {
35
- const d = {
36
- name: name,
37
- data: data
38
- };
39
- this.manager.forEach(x => {
40
- x.ws.send(JSON.stringify(d));
41
- });
42
- };
43
- this.memory_loader = (0, io_1.CreateRecordMemoryLoader)(this.memory);
44
- }
45
- get current_loader() {
46
- if (this.loader)
47
- return this.loader;
48
- return this.memory_loader;
49
- }
50
- }
51
- exports.Server = Server;