verteilen-core 1.2.9 → 1.2.11
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/dist/server/detail.d.ts +4 -2
- package/dist/server/detail.js +8 -2
- package/dist/server/io.js +1 -1
- package/package.json +1 -1
- package/src/server/detail.ts +12 -3
- package/src/server/io.ts +1 -1
package/dist/server/detail.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface BackendAction {
|
|
|
10
10
|
export interface ServerDetailEvent {
|
|
11
11
|
resource_start: (socket: any, uuid: string) => void;
|
|
12
12
|
resource_end: (socket: any, uuid: string) => void;
|
|
13
|
+
plugin_info: (socket: any, uuid: string) => void;
|
|
13
14
|
shell_enter: (socket: any, uuid: string, value: string) => void;
|
|
14
15
|
shell_open: (socket: any, uuid: string) => void;
|
|
15
16
|
shell_close: (socket: any, uuid: string) => void;
|
|
@@ -25,7 +26,7 @@ export interface ServerDetailEvent {
|
|
|
25
26
|
console_clean: (socket: any, uuid: string) => void;
|
|
26
27
|
console_skip: (socket: any, uuid: string, forward: boolean, type: number, state: ExecuteState) => void;
|
|
27
28
|
console_skip2: (socket: any, uuid: string, v: number) => void;
|
|
28
|
-
console_add: (socket: any, name: string, record: Record,
|
|
29
|
+
console_add: (socket: any, name: string, record: Record, uuid: string | undefined) => void;
|
|
29
30
|
console_update: (socket: any) => void;
|
|
30
31
|
}
|
|
31
32
|
export declare class ServerDetail {
|
|
@@ -51,6 +52,7 @@ export declare class ServerDetail {
|
|
|
51
52
|
console_update: () => any[];
|
|
52
53
|
resource_start: (socket: any, uuid: string) => void;
|
|
53
54
|
resource_end: (socket: any, uuid: string) => void;
|
|
55
|
+
plugin_info: (socket: any, uuid: string) => void;
|
|
54
56
|
shell_enter: (socket: any, uuid: string, value: string) => void;
|
|
55
57
|
shell_open: (socket: any, uuid: string) => void;
|
|
56
58
|
shell_close: (socket: any, uuid: string) => void;
|
|
@@ -63,7 +65,7 @@ export declare class ServerDetail {
|
|
|
63
65
|
console_record: (socket: any, uuid: string) => string;
|
|
64
66
|
console_execute: (socket: any, uuid: string, type: number) => void;
|
|
65
67
|
console_stop: (socket: any, uuid: string) => void;
|
|
66
|
-
console_add: (socket: any, name: string, record: Record,
|
|
68
|
+
console_add: (socket: any, name: string, record: Record, uuid: string | undefined) => ExecuteRecord | undefined;
|
|
67
69
|
console_update_call: () => void;
|
|
68
70
|
console_clean: (socket: any, uuid: string) => void;
|
|
69
71
|
console_skip: (socket: any, uuid: string, forward: boolean, type: number, state?: ExecuteState) => void;
|
package/dist/server/detail.js
CHANGED
|
@@ -39,6 +39,7 @@ class ServerDetail {
|
|
|
39
39
|
return {
|
|
40
40
|
resource_start: this.resource_start,
|
|
41
41
|
resource_end: this.resource_end,
|
|
42
|
+
plugin_info: this.plugin_info,
|
|
42
43
|
shell_enter: this.shell_enter,
|
|
43
44
|
shell_open: this.shell_open,
|
|
44
45
|
shell_close: this.shell_close,
|
|
@@ -182,6 +183,11 @@ class ServerDetail {
|
|
|
182
183
|
const d = { name: 'resource_end', data: 0 };
|
|
183
184
|
p?.websocket.send(JSON.stringify(d));
|
|
184
185
|
};
|
|
186
|
+
plugin_info = (socket, uuid) => {
|
|
187
|
+
const p = this.websocket_manager.targets.find(x => x.uuid == uuid);
|
|
188
|
+
const d = { name: 'plugin_info', data: 0 };
|
|
189
|
+
p?.websocket.send(JSON.stringify(d));
|
|
190
|
+
};
|
|
185
191
|
shell_enter = (socket, uuid, value) => {
|
|
186
192
|
this.websocket_manager.shell_enter(uuid, value);
|
|
187
193
|
};
|
|
@@ -281,7 +287,7 @@ class ServerDetail {
|
|
|
281
287
|
target.record.stop = true;
|
|
282
288
|
target.manager.Stop();
|
|
283
289
|
};
|
|
284
|
-
console_add = (socket, name, record,
|
|
290
|
+
console_add = (socket, name, record, uuid) => {
|
|
285
291
|
record.projects.forEach(x => x.uuid = (0, uuid_1.v6)());
|
|
286
292
|
const em = new interface_1.Execute_ExecuteManager.ExecuteManager(name, this.websocket_manager, this.message, JSON.parse(JSON.stringify(record)));
|
|
287
293
|
const er = {
|
|
@@ -305,7 +311,7 @@ class ServerDetail {
|
|
|
305
311
|
em.libs = { libs: this.backend.memory.libs };
|
|
306
312
|
const p = { manager: em, record: er };
|
|
307
313
|
const uscp = new console_handle_1.Util_Server_Console_Proxy(p);
|
|
308
|
-
const uslp = new log_handle_1.Util_Server_Log_Proxy(p, { logs: this.backend.memory.logs },
|
|
314
|
+
const uslp = new log_handle_1.Util_Server_Log_Proxy(p, { logs: this.backend.memory.logs }, this.backend.GetPreference(uuid));
|
|
309
315
|
em.proxy = this.CombineProxy([uscp.execute_proxy, uslp.execute_proxy]);
|
|
310
316
|
const r = this.console.receivedPack(p, record);
|
|
311
317
|
if (r)
|
package/dist/server/io.js
CHANGED
|
@@ -71,7 +71,7 @@ const _CreateRecordIOLoader = (loader, memory, type, folder, ext = ".json") => {
|
|
|
71
71
|
if (!loader.exists(root))
|
|
72
72
|
await loader.mkdir(root);
|
|
73
73
|
const files = await loader.read_dir_file(root);
|
|
74
|
-
const r = files.map(x => loader.read_string(x, { encoding: 'utf8', flag: 'r' }));
|
|
74
|
+
const r = files.map(x => loader.read_string(loader.join(root, x), { encoding: 'utf8', flag: 'r' }));
|
|
75
75
|
const p = await Promise.all(r);
|
|
76
76
|
const arr = get_array(type);
|
|
77
77
|
arr.splice(0, arr.length);
|
package/package.json
CHANGED
package/src/server/detail.ts
CHANGED
|
@@ -40,6 +40,7 @@ export interface BackendAction {
|
|
|
40
40
|
export interface ServerDetailEvent {
|
|
41
41
|
resource_start: (socket:any, uuid:string) => void
|
|
42
42
|
resource_end: (socket:any, uuid:string) => void
|
|
43
|
+
plugin_info: (socket:any, uuid:string) => void
|
|
43
44
|
shell_enter: (socket:any, uuid:string, value:string) => void
|
|
44
45
|
shell_open: (socket:any, uuid:string) => void
|
|
45
46
|
shell_close: (socket:any, uuid:string) => void
|
|
@@ -55,7 +56,7 @@ export interface ServerDetailEvent {
|
|
|
55
56
|
console_clean: (socket:any, uuid:string) => void
|
|
56
57
|
console_skip: (socket:any, uuid:string, forward:boolean, type:number, state:ExecuteState) => void
|
|
57
58
|
console_skip2: (socket:any, uuid:string, v:number) => void
|
|
58
|
-
console_add: (socket:any, name:string, record:Record,
|
|
59
|
+
console_add: (socket:any, name:string, record:Record, uuid:string | undefined) => void
|
|
59
60
|
console_update: (socket:any, ) => void
|
|
60
61
|
}
|
|
61
62
|
|
|
@@ -115,6 +116,7 @@ export class ServerDetail {
|
|
|
115
116
|
return {
|
|
116
117
|
resource_start: this.resource_start,
|
|
117
118
|
resource_end: this.resource_end,
|
|
119
|
+
plugin_info: this.plugin_info,
|
|
118
120
|
shell_enter: this.shell_enter,
|
|
119
121
|
shell_open: this.shell_open,
|
|
120
122
|
shell_close: this.shell_close,
|
|
@@ -273,6 +275,13 @@ export class ServerDetail {
|
|
|
273
275
|
const d:Header = { name: 'resource_end', data: 0 }
|
|
274
276
|
p?.websocket.send(JSON.stringify(d))
|
|
275
277
|
}
|
|
278
|
+
|
|
279
|
+
plugin_info = (socket:any, uuid:string) => {
|
|
280
|
+
const p = this.websocket_manager!.targets.find(x => x.uuid == uuid)
|
|
281
|
+
const d:Header = { name: 'plugin_info', data: 0 }
|
|
282
|
+
p?.websocket.send(JSON.stringify(d))
|
|
283
|
+
}
|
|
284
|
+
|
|
276
285
|
shell_enter = (socket:any, uuid: string, value:string) => {
|
|
277
286
|
this.websocket_manager!.shell_enter(uuid, value)
|
|
278
287
|
}
|
|
@@ -369,7 +378,7 @@ export class ServerDetail {
|
|
|
369
378
|
target.record!.stop = true
|
|
370
379
|
target.manager!.Stop()
|
|
371
380
|
}
|
|
372
|
-
console_add = (socket:any, name:string, record:Record,
|
|
381
|
+
console_add = (socket:any, name:string, record:Record, uuid:string | undefined) => {
|
|
373
382
|
record.projects.forEach(x => x.uuid = uuidv6())
|
|
374
383
|
const em:Execute_ExecuteManager.ExecuteManager = new Execute_ExecuteManager.ExecuteManager(
|
|
375
384
|
name,
|
|
@@ -399,7 +408,7 @@ export class ServerDetail {
|
|
|
399
408
|
|
|
400
409
|
const p:ExecutePair = { manager: em, record: er }
|
|
401
410
|
const uscp:Util_Server_Console_Proxy = new Util_Server_Console_Proxy(p)
|
|
402
|
-
const uslp:Util_Server_Log_Proxy = new Util_Server_Log_Proxy(p, { logs: this.backend.memory.logs },
|
|
411
|
+
const uslp:Util_Server_Log_Proxy = new Util_Server_Log_Proxy(p, { logs: this.backend.memory.logs }, this.backend.GetPreference(uuid)!)
|
|
403
412
|
em.proxy = this.CombineProxy([uscp.execute_proxy, uslp.execute_proxy])
|
|
404
413
|
const r = this.console.receivedPack(p, record)
|
|
405
414
|
if(r) this.execute_manager.push(p)
|
package/src/server/io.ts
CHANGED
|
@@ -140,7 +140,7 @@ export const _CreateRecordIOLoader = (loader:RecordIOBase, memory:MemoryData, ty
|
|
|
140
140
|
if(!loader.exists(root)) await loader.mkdir(root)
|
|
141
141
|
const files = await loader.read_dir_file(root)
|
|
142
142
|
const r:Array<Promise<string>> = files.map(x =>
|
|
143
|
-
loader.read_string(x, { encoding: 'utf8', flag: 'r' })
|
|
143
|
+
loader.read_string(loader.join(root, x), { encoding: 'utf8', flag: 'r' })
|
|
144
144
|
)
|
|
145
145
|
const p = await Promise.all(r)
|
|
146
146
|
const arr = get_array(type)
|