verteilen-core 1.3.36 → 1.3.39
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/client/javascript.js +1 -0
- package/dist/interface/enum.d.ts +5 -3
- package/dist/interface/enum.js +5 -3
- package/dist/interface/struct.d.ts +1 -1
- package/dist/lan/en.json +22 -9
- package/dist/lan/zh_TW.json +22 -9
- package/dist/plugins/i18n.d.ts +64 -12
- package/dist/server/detail/console_handle.d.ts +1 -3
- package/dist/server/detail/console_handle.js +40 -42
- package/dist/server/detail.d.ts +0 -2
- package/dist/server/detail.js +1 -3
- package/dist/server/io.d.ts +1 -0
- package/dist/server/io.js +55 -1
- package/package.json +1 -1
- package/src/client/javascript.ts +1 -0
- package/src/interface/enum.ts +1 -1
- package/src/interface/execute.ts +1 -1
- package/src/interface/log.ts +48 -0
- package/src/interface/struct.ts +39 -13
- package/src/lan/en.json +22 -9
- package/src/lan/zh_TW.json +22 -9
- package/src/server/detail/console_handle.ts +43 -38
- package/src/server/detail/log_handle.ts +5 -0
- package/src/server/detail.ts +2 -4
- package/src/server/io.ts +53 -0
package/dist/interface/enum.d.ts
CHANGED
package/dist/interface/enum.js
CHANGED
|
@@ -6,9 +6,11 @@ var TaskLogicType;
|
|
|
6
6
|
TaskLogicType[TaskLogicType["GROUP"] = 0] = "GROUP";
|
|
7
7
|
TaskLogicType[TaskLogicType["CONDITION"] = 1] = "CONDITION";
|
|
8
8
|
TaskLogicType[TaskLogicType["EXECUTION"] = 2] = "EXECUTION";
|
|
9
|
-
TaskLogicType[TaskLogicType["
|
|
10
|
-
TaskLogicType[TaskLogicType["
|
|
11
|
-
TaskLogicType[TaskLogicType["
|
|
9
|
+
TaskLogicType[TaskLogicType["FAILED"] = 3] = "FAILED";
|
|
10
|
+
TaskLogicType[TaskLogicType["SINGLE"] = 4] = "SINGLE";
|
|
11
|
+
TaskLogicType[TaskLogicType["ADD"] = 5] = "ADD";
|
|
12
|
+
TaskLogicType[TaskLogicType["OR"] = 6] = "OR";
|
|
13
|
+
TaskLogicType[TaskLogicType["NOT"] = 7] = "NOT";
|
|
12
14
|
})(TaskLogicType || (exports.TaskLogicType = TaskLogicType = {}));
|
|
13
15
|
var SocketState;
|
|
14
16
|
(function (SocketState) {
|
|
@@ -17,6 +17,7 @@ export interface WebsocketPack {
|
|
|
17
17
|
}
|
|
18
18
|
export interface Header {
|
|
19
19
|
name: string;
|
|
20
|
+
destinations?: string;
|
|
20
21
|
token?: string;
|
|
21
22
|
meta?: string;
|
|
22
23
|
message?: string;
|
|
@@ -114,7 +115,6 @@ export interface TaskLogicUnit {
|
|
|
114
115
|
job_uuid?: string;
|
|
115
116
|
job?: Job;
|
|
116
117
|
children: Array<TaskLogicUnit>;
|
|
117
|
-
children2?: Array<TaskLogicUnit>;
|
|
118
118
|
}
|
|
119
119
|
export interface TaskLogic {
|
|
120
120
|
group: Array<TaskLogicUnit>;
|
package/dist/lan/en.json
CHANGED
|
@@ -103,14 +103,14 @@
|
|
|
103
103
|
"enter-task-name": "Enter Task Name",
|
|
104
104
|
"enter-task-description": "Enter Task Description",
|
|
105
105
|
"new-job": "New Job",
|
|
106
|
-
"new-
|
|
107
|
-
"edit-
|
|
106
|
+
"new-Variable": "New Variable",
|
|
107
|
+
"edit-Variable": "Modify Variable",
|
|
108
108
|
"delete-database": "Delete Database",
|
|
109
|
-
"enter-
|
|
110
|
-
"new-database-set": "New Database
|
|
111
|
-
"clone-database-set": "Clone Database
|
|
112
|
-
"edit-database-set": "Modify Database
|
|
113
|
-
"enter-database-set-name": "Enter Database
|
|
109
|
+
"enter-Variable-name": "Enter Variable Name",
|
|
110
|
+
"new-database-set": "New Database",
|
|
111
|
+
"clone-database-set": "Clone Database",
|
|
112
|
+
"edit-database-set": "Modify Database",
|
|
113
|
+
"enter-database-set-name": "Enter Database Name",
|
|
114
114
|
"import-database": "Delete Database",
|
|
115
115
|
"delete-database-confirm": "Are you sure delete database you selected",
|
|
116
116
|
"database-datatype": "Datatype",
|
|
@@ -141,7 +141,8 @@
|
|
|
141
141
|
"delete-task-confirm": "Are you sure you want to delete these tasks?",
|
|
142
142
|
"create-service": "Create Service",
|
|
143
143
|
"delete-service": "Delete Service",
|
|
144
|
-
"delete-service-confirm": "Are you sure you want to delete these services?"
|
|
144
|
+
"delete-service-confirm": "Are you sure you want to delete these services?",
|
|
145
|
+
"new-condition": "Create Condition"
|
|
145
146
|
},
|
|
146
147
|
"toolbar": {
|
|
147
148
|
"server": "Server",
|
|
@@ -349,6 +350,16 @@
|
|
|
349
350
|
"messager_log": "messager_log(message:string)"
|
|
350
351
|
}
|
|
351
352
|
},
|
|
353
|
+
"condition": {
|
|
354
|
+
"group": "Group",
|
|
355
|
+
"condition": "Condition",
|
|
356
|
+
"execution": "Execution (Success)",
|
|
357
|
+
"failed": "Execution (Failed)",
|
|
358
|
+
"single": "Job Content",
|
|
359
|
+
"or": "Or",
|
|
360
|
+
"and": "And",
|
|
361
|
+
"not": "Not"
|
|
362
|
+
},
|
|
352
363
|
"token": "Token",
|
|
353
364
|
"info": "Information",
|
|
354
365
|
"search": "Search",
|
|
@@ -425,5 +436,7 @@
|
|
|
425
436
|
"goback": "Go Back",
|
|
426
437
|
"logic": "Logic",
|
|
427
438
|
"use_logic": "Use Logic",
|
|
428
|
-
"remove_logic": "Remove Logic"
|
|
439
|
+
"remove_logic": "Remove Logic",
|
|
440
|
+
"state": "State",
|
|
441
|
+
"delay": "Delay"
|
|
429
442
|
}
|
package/dist/lan/zh_TW.json
CHANGED
|
@@ -103,14 +103,14 @@
|
|
|
103
103
|
"enter-task-name": "輸入流程名稱",
|
|
104
104
|
"enter-task-description": "輸入流程敘述",
|
|
105
105
|
"new-job": "新增工作",
|
|
106
|
-
"new-
|
|
107
|
-
"edit-
|
|
106
|
+
"new-Variable": "新增數據",
|
|
107
|
+
"edit-Variable": "編輯數據",
|
|
108
108
|
"delete-database": "刪除資料庫",
|
|
109
|
-
"enter-
|
|
110
|
-
"new-database-set": "
|
|
111
|
-
"clone-database-set": "
|
|
112
|
-
"edit-database-set": "
|
|
113
|
-
"enter-database-set-name": "
|
|
109
|
+
"enter-Variable-name": "輸入數據名稱",
|
|
110
|
+
"new-database-set": "新增資料庫",
|
|
111
|
+
"clone-database-set": "複製資料庫",
|
|
112
|
+
"edit-database-set": "編輯資料庫",
|
|
113
|
+
"enter-database-set-name": "輸入資料庫名稱",
|
|
114
114
|
"import-database": "刪除資料庫",
|
|
115
115
|
"delete-database-confirm": "確認刪除選擇資料庫嗎?",
|
|
116
116
|
"database-datatype": "資料型態",
|
|
@@ -141,7 +141,8 @@
|
|
|
141
141
|
"delete-task-confirm": "確定刪除選取的工作嗎?",
|
|
142
142
|
"create-service": "建立服務",
|
|
143
143
|
"delete-service": "刪除服務",
|
|
144
|
-
"delete-service-confirm": "確定刪除選取的服務嗎?"
|
|
144
|
+
"delete-service-confirm": "確定刪除選取的服務嗎?",
|
|
145
|
+
"new-condition": "建立條件"
|
|
145
146
|
},
|
|
146
147
|
"toolbar": {
|
|
147
148
|
"server": "伺服器",
|
|
@@ -349,6 +350,16 @@
|
|
|
349
350
|
"messager_log": "messager_log(message:string)"
|
|
350
351
|
}
|
|
351
352
|
},
|
|
353
|
+
"condition": {
|
|
354
|
+
"group": "群組",
|
|
355
|
+
"condition": "條件",
|
|
356
|
+
"execution": "執行 (成功)",
|
|
357
|
+
"failed": "執行 (失敗)",
|
|
358
|
+
"single": "工作內容",
|
|
359
|
+
"or": "Or",
|
|
360
|
+
"and": "And",
|
|
361
|
+
"not": "Not"
|
|
362
|
+
},
|
|
352
363
|
"token": "密鑰",
|
|
353
364
|
"info": "資訊",
|
|
354
365
|
"search": "搜尋",
|
|
@@ -425,5 +436,7 @@
|
|
|
425
436
|
"goback": "返回",
|
|
426
437
|
"logic": "邏輯",
|
|
427
438
|
"use_logic": "套用邏輯",
|
|
428
|
-
"remove_logic": "刪除邏輯"
|
|
439
|
+
"remove_logic": "刪除邏輯",
|
|
440
|
+
"state": "狀態",
|
|
441
|
+
"delay": "延遲"
|
|
429
442
|
}
|
package/dist/plugins/i18n.d.ts
CHANGED
|
@@ -111,10 +111,10 @@ export declare const i18nDefaultData: {
|
|
|
111
111
|
"enter-task-name": string;
|
|
112
112
|
"enter-task-description": string;
|
|
113
113
|
"new-job": string;
|
|
114
|
-
"new-
|
|
115
|
-
"edit-
|
|
114
|
+
"new-Variable": string;
|
|
115
|
+
"edit-Variable": string;
|
|
116
116
|
"delete-database": string;
|
|
117
|
-
"enter-
|
|
117
|
+
"enter-Variable-name": string;
|
|
118
118
|
"new-database-set": string;
|
|
119
119
|
"clone-database-set": string;
|
|
120
120
|
"edit-database-set": string;
|
|
@@ -150,6 +150,7 @@ export declare const i18nDefaultData: {
|
|
|
150
150
|
"create-service": string;
|
|
151
151
|
"delete-service": string;
|
|
152
152
|
"delete-service-confirm": string;
|
|
153
|
+
"new-condition": string;
|
|
153
154
|
};
|
|
154
155
|
toolbar: {
|
|
155
156
|
server: string;
|
|
@@ -357,6 +358,16 @@ export declare const i18nDefaultData: {
|
|
|
357
358
|
messager_log: string;
|
|
358
359
|
};
|
|
359
360
|
};
|
|
361
|
+
condition: {
|
|
362
|
+
group: string;
|
|
363
|
+
condition: string;
|
|
364
|
+
execution: string;
|
|
365
|
+
failed: string;
|
|
366
|
+
single: string;
|
|
367
|
+
or: string;
|
|
368
|
+
and: string;
|
|
369
|
+
not: string;
|
|
370
|
+
};
|
|
360
371
|
token: string;
|
|
361
372
|
info: string;
|
|
362
373
|
search: string;
|
|
@@ -434,6 +445,8 @@ export declare const i18nDefaultData: {
|
|
|
434
445
|
logic: string;
|
|
435
446
|
use_logic: string;
|
|
436
447
|
remove_logic: string;
|
|
448
|
+
state: string;
|
|
449
|
+
delay: string;
|
|
437
450
|
};
|
|
438
451
|
zh_TW: {
|
|
439
452
|
login: {
|
|
@@ -540,10 +553,10 @@ export declare const i18nDefaultData: {
|
|
|
540
553
|
"enter-task-name": string;
|
|
541
554
|
"enter-task-description": string;
|
|
542
555
|
"new-job": string;
|
|
543
|
-
"new-
|
|
544
|
-
"edit-
|
|
556
|
+
"new-Variable": string;
|
|
557
|
+
"edit-Variable": string;
|
|
545
558
|
"delete-database": string;
|
|
546
|
-
"enter-
|
|
559
|
+
"enter-Variable-name": string;
|
|
547
560
|
"new-database-set": string;
|
|
548
561
|
"clone-database-set": string;
|
|
549
562
|
"edit-database-set": string;
|
|
@@ -579,6 +592,7 @@ export declare const i18nDefaultData: {
|
|
|
579
592
|
"create-service": string;
|
|
580
593
|
"delete-service": string;
|
|
581
594
|
"delete-service-confirm": string;
|
|
595
|
+
"new-condition": string;
|
|
582
596
|
};
|
|
583
597
|
toolbar: {
|
|
584
598
|
server: string;
|
|
@@ -786,6 +800,16 @@ export declare const i18nDefaultData: {
|
|
|
786
800
|
messager_log: string;
|
|
787
801
|
};
|
|
788
802
|
};
|
|
803
|
+
condition: {
|
|
804
|
+
group: string;
|
|
805
|
+
condition: string;
|
|
806
|
+
execution: string;
|
|
807
|
+
failed: string;
|
|
808
|
+
single: string;
|
|
809
|
+
or: string;
|
|
810
|
+
and: string;
|
|
811
|
+
not: string;
|
|
812
|
+
};
|
|
789
813
|
token: string;
|
|
790
814
|
info: string;
|
|
791
815
|
search: string;
|
|
@@ -863,6 +887,8 @@ export declare const i18nDefaultData: {
|
|
|
863
887
|
logic: string;
|
|
864
888
|
use_logic: string;
|
|
865
889
|
remove_logic: string;
|
|
890
|
+
state: string;
|
|
891
|
+
delay: string;
|
|
866
892
|
};
|
|
867
893
|
};
|
|
868
894
|
};
|
|
@@ -972,10 +998,10 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
972
998
|
"enter-task-name": string;
|
|
973
999
|
"enter-task-description": string;
|
|
974
1000
|
"new-job": string;
|
|
975
|
-
"new-
|
|
976
|
-
"edit-
|
|
1001
|
+
"new-Variable": string;
|
|
1002
|
+
"edit-Variable": string;
|
|
977
1003
|
"delete-database": string;
|
|
978
|
-
"enter-
|
|
1004
|
+
"enter-Variable-name": string;
|
|
979
1005
|
"new-database-set": string;
|
|
980
1006
|
"clone-database-set": string;
|
|
981
1007
|
"edit-database-set": string;
|
|
@@ -1011,6 +1037,7 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
1011
1037
|
"create-service": string;
|
|
1012
1038
|
"delete-service": string;
|
|
1013
1039
|
"delete-service-confirm": string;
|
|
1040
|
+
"new-condition": string;
|
|
1014
1041
|
};
|
|
1015
1042
|
toolbar: {
|
|
1016
1043
|
server: string;
|
|
@@ -1218,6 +1245,16 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
1218
1245
|
messager_log: string;
|
|
1219
1246
|
};
|
|
1220
1247
|
};
|
|
1248
|
+
condition: {
|
|
1249
|
+
group: string;
|
|
1250
|
+
condition: string;
|
|
1251
|
+
execution: string;
|
|
1252
|
+
failed: string;
|
|
1253
|
+
single: string;
|
|
1254
|
+
or: string;
|
|
1255
|
+
and: string;
|
|
1256
|
+
not: string;
|
|
1257
|
+
};
|
|
1221
1258
|
token: string;
|
|
1222
1259
|
info: string;
|
|
1223
1260
|
search: string;
|
|
@@ -1295,6 +1332,8 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
1295
1332
|
logic: string;
|
|
1296
1333
|
use_logic: string;
|
|
1297
1334
|
remove_logic: string;
|
|
1335
|
+
state: string;
|
|
1336
|
+
delay: string;
|
|
1298
1337
|
};
|
|
1299
1338
|
zh_TW: {
|
|
1300
1339
|
login: {
|
|
@@ -1401,10 +1440,10 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
1401
1440
|
"enter-task-name": string;
|
|
1402
1441
|
"enter-task-description": string;
|
|
1403
1442
|
"new-job": string;
|
|
1404
|
-
"new-
|
|
1405
|
-
"edit-
|
|
1443
|
+
"new-Variable": string;
|
|
1444
|
+
"edit-Variable": string;
|
|
1406
1445
|
"delete-database": string;
|
|
1407
|
-
"enter-
|
|
1446
|
+
"enter-Variable-name": string;
|
|
1408
1447
|
"new-database-set": string;
|
|
1409
1448
|
"clone-database-set": string;
|
|
1410
1449
|
"edit-database-set": string;
|
|
@@ -1440,6 +1479,7 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
1440
1479
|
"create-service": string;
|
|
1441
1480
|
"delete-service": string;
|
|
1442
1481
|
"delete-service-confirm": string;
|
|
1482
|
+
"new-condition": string;
|
|
1443
1483
|
};
|
|
1444
1484
|
toolbar: {
|
|
1445
1485
|
server: string;
|
|
@@ -1647,6 +1687,16 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
1647
1687
|
messager_log: string;
|
|
1648
1688
|
};
|
|
1649
1689
|
};
|
|
1690
|
+
condition: {
|
|
1691
|
+
group: string;
|
|
1692
|
+
condition: string;
|
|
1693
|
+
execution: string;
|
|
1694
|
+
failed: string;
|
|
1695
|
+
single: string;
|
|
1696
|
+
or: string;
|
|
1697
|
+
and: string;
|
|
1698
|
+
not: string;
|
|
1699
|
+
};
|
|
1650
1700
|
token: string;
|
|
1651
1701
|
info: string;
|
|
1652
1702
|
search: string;
|
|
@@ -1724,6 +1774,8 @@ export declare const i18n: import("vue-i18n").I18n<{
|
|
|
1724
1774
|
logic: string;
|
|
1725
1775
|
use_logic: string;
|
|
1726
1776
|
remove_logic: string;
|
|
1777
|
+
state: string;
|
|
1778
|
+
delay: string;
|
|
1727
1779
|
};
|
|
1728
1780
|
}, {}, {}, string, true>;
|
|
1729
1781
|
export declare const raw_i18n: I18n;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ExecutePair, ExecuteProxy, ExecuteState, FeedBack, Job, Database, Project, Record, Task } from "../../interface";
|
|
2
|
-
export declare
|
|
3
|
-
receivedPack: (model: ExecutePair, record: Record) => boolean;
|
|
4
|
-
}
|
|
2
|
+
export declare const receivedPack: (model: ExecutePair, record: Record) => boolean;
|
|
5
3
|
export declare class Console_Proxy {
|
|
6
4
|
model: ExecutePair;
|
|
7
5
|
constructor(_model: ExecutePair);
|
|
@@ -1,49 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Console_Proxy = exports.
|
|
3
|
+
exports.Console_Proxy = exports.receivedPack = void 0;
|
|
4
4
|
const interface_1 = require("../../interface");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
const receivedPack = (model, record) => {
|
|
6
|
+
const pass = model.manager.Register();
|
|
7
|
+
if (pass == -1) {
|
|
8
|
+
model.record.running = false;
|
|
9
|
+
model.record.stop = true;
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
model.record.projects = record.projects;
|
|
13
|
+
model.record.nodes = record.nodes;
|
|
14
|
+
model.record.project_state = model.record.projects.map(x => {
|
|
15
|
+
return {
|
|
16
|
+
uuid: x.uuid,
|
|
17
|
+
state: interface_1.ExecuteState.NONE
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
model.record.project_index = pass;
|
|
21
|
+
model.record.project = record.projects[pass].uuid;
|
|
22
|
+
model.record.task_index = 0;
|
|
23
|
+
model.record.task_state = model.record.projects[0].tasks.map(x => {
|
|
24
|
+
return {
|
|
25
|
+
uuid: x.uuid,
|
|
26
|
+
state: interface_1.ExecuteState.NONE
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
model.record.task_state[0].state = interface_1.ExecuteState.RUNNING;
|
|
30
|
+
model.record.task_detail = [];
|
|
31
|
+
const task = model.record.projects[model.record.project_index]?.tasks[model.record.task_index];
|
|
32
|
+
const count = task.cronjob ? (task?.jobs.length ?? 0) : 1;
|
|
33
|
+
for (let i = 0; i < count; i++) {
|
|
34
|
+
model.record.task_detail.push({
|
|
35
|
+
index: i,
|
|
36
|
+
node: "",
|
|
37
|
+
message: [],
|
|
38
|
+
state: interface_1.ExecuteState.NONE
|
|
29
39
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
model.record.task_detail.push({
|
|
36
|
-
index: i,
|
|
37
|
-
node: "",
|
|
38
|
-
message: [],
|
|
39
|
-
state: interface_1.ExecuteState.NONE
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
model.manager.Update();
|
|
43
|
-
return true;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
exports.Console_Handler = Console_Handler;
|
|
40
|
+
}
|
|
41
|
+
model.manager.Update();
|
|
42
|
+
return true;
|
|
43
|
+
};
|
|
44
|
+
exports.receivedPack = receivedPack;
|
|
47
45
|
class Console_Proxy {
|
|
48
46
|
model;
|
|
49
47
|
constructor(_model) {
|
package/dist/server/detail.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BusAnalysis, ExecutePair, ExecuteProxy, ExecuteRecord, ExecuteState, Messager, Preference, Record, ShellFolder, Single, WebsocketPack } from "../interface";
|
|
2
2
|
import { PluginFeedback } from "./server";
|
|
3
3
|
import { MemoryData, RecordIOBase } from './io';
|
|
4
|
-
import { Console_Handler } from './detail/console_handle';
|
|
5
4
|
import { WebsocketManager } from '../script/socket_manager';
|
|
6
5
|
export interface BackendAction {
|
|
7
6
|
memory: MemoryData;
|
|
@@ -32,7 +31,6 @@ export interface ServerDetailEvent {
|
|
|
32
31
|
}
|
|
33
32
|
export declare class ServerDetail {
|
|
34
33
|
execute_manager: Array<ExecutePair>;
|
|
35
|
-
console: Console_Handler;
|
|
36
34
|
websocket_manager: WebsocketManager | undefined;
|
|
37
35
|
shellBind: Map<any, any>;
|
|
38
36
|
loader: RecordIOBase | undefined;
|
package/dist/server/detail.js
CHANGED
|
@@ -9,7 +9,6 @@ const execute_manager_1 = require("../script/execute_manager");
|
|
|
9
9
|
const socket_manager_1 = require("../script/socket_manager");
|
|
10
10
|
class ServerDetail {
|
|
11
11
|
execute_manager = [];
|
|
12
|
-
console;
|
|
13
12
|
websocket_manager;
|
|
14
13
|
shellBind = new Map();
|
|
15
14
|
loader;
|
|
@@ -30,7 +29,6 @@ class ServerDetail {
|
|
|
30
29
|
folderReply: this.folderReply
|
|
31
30
|
};
|
|
32
31
|
this.websocket_manager = new socket_manager_1.WebsocketManager(this.NewConnection, this.DisConnection, this.Analysis, messager_log, n);
|
|
33
|
-
this.console = new console_handle_1.Console_Handler();
|
|
34
32
|
this.updatehandle = setInterval(() => {
|
|
35
33
|
this.re.push(...this.console_update());
|
|
36
34
|
}, interface_1.RENDER_UPDATETICK);
|
|
@@ -272,7 +270,7 @@ class ServerDetail {
|
|
|
272
270
|
const uscp = new console_handle_1.Console_Proxy(p);
|
|
273
271
|
const uslp = new log_handle_1.Log_Proxy(p, { logs: this.backend.memory.logs }, this.backend.GetPreference(uuid));
|
|
274
272
|
em.proxy = this.CombineProxy([uscp.execute_proxy, uslp.execute_proxy]);
|
|
275
|
-
const r =
|
|
273
|
+
const r = (0, console_handle_1.receivedPack)(p, record);
|
|
276
274
|
if (r)
|
|
277
275
|
this.execute_manager.push(p);
|
|
278
276
|
if (socket != undefined) {
|
package/dist/server/io.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export interface RecordIOBase {
|
|
|
44
44
|
export interface RecordMongoBase {
|
|
45
45
|
}
|
|
46
46
|
export declare const _CreateRecordMemoryLoader: (loader: MemoryData, type: RecordType) => RecordIOLoader;
|
|
47
|
+
export declare const ObsoleteSupport: (loader: RecordIOBase, type: RecordType, folder: string) => Promise<void>;
|
|
47
48
|
export declare const _CreateRecordIOLoader: (loader: RecordIOBase, memory: MemoryData, type: RecordType, folder: string, ext?: string) => RecordIOLoader;
|
|
48
49
|
export declare const CreateRecordMemoryLoader: (loader: MemoryData) => RecordLoader;
|
|
49
50
|
export declare const CreateRecordIOLoader: (loader: RecordIOBase, memory: MemoryData) => RecordLoader;
|
package/dist/server/io.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateRecordMongoLoader = exports.CreateRecordIOLoader = exports.CreateRecordMemoryLoader = exports._CreateRecordIOLoader = exports._CreateRecordMemoryLoader = void 0;
|
|
3
|
+
exports.CreateRecordMongoLoader = exports.CreateRecordIOLoader = exports.CreateRecordMemoryLoader = exports._CreateRecordIOLoader = exports.ObsoleteSupport = exports._CreateRecordMemoryLoader = void 0;
|
|
4
4
|
const interface_1 = require("../interface");
|
|
5
5
|
const _CreateRecordMemoryLoader = (loader, type) => {
|
|
6
6
|
const get_array = (type) => {
|
|
@@ -55,6 +55,59 @@ const _CreateRecordMemoryLoader = (loader, type) => {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
exports._CreateRecordMemoryLoader = _CreateRecordMemoryLoader;
|
|
58
|
+
const ObsoleteSupport = async (loader, type, folder) => {
|
|
59
|
+
if (type == interface_1.RecordType.PROJECT) {
|
|
60
|
+
const path = loader.join(loader.root, "record");
|
|
61
|
+
if (!loader.exists(path))
|
|
62
|
+
return;
|
|
63
|
+
const p = await loader.read_dir_file(path);
|
|
64
|
+
const ps = p.filter(x => x.endsWith(".json")).map(x => {
|
|
65
|
+
const path_r = loader.join(path, x);
|
|
66
|
+
return loader.read_string(path_r);
|
|
67
|
+
});
|
|
68
|
+
const allRecordText = await Promise.all(ps);
|
|
69
|
+
const allRecord = allRecordText.map(x => JSON.parse(x));
|
|
70
|
+
const execute = allRecord.map(async (x) => {
|
|
71
|
+
x.tasks = [];
|
|
72
|
+
x.databaser_uuid = x.parameter_uuid;
|
|
73
|
+
x.tasks_uuid = x.task.map(y => y.uuid);
|
|
74
|
+
const tasks = x.task;
|
|
75
|
+
delete x.parameter_uuid;
|
|
76
|
+
delete x.task;
|
|
77
|
+
const execute_task = tasks.map(async (y) => {
|
|
78
|
+
const jobs = y.jobs;
|
|
79
|
+
y.jobs = [];
|
|
80
|
+
y.jobs_uuid = y.jobs.map(z => z.uuid);
|
|
81
|
+
const execute_jobs = jobs.map(async (z) => {
|
|
82
|
+
z.id_args = [];
|
|
83
|
+
const d3 = loader.join(loader.root, "job", `${z.uuid}.json`);
|
|
84
|
+
return loader.write_string(d3, z);
|
|
85
|
+
});
|
|
86
|
+
await Promise.all(execute_jobs);
|
|
87
|
+
const d2 = loader.join(loader.root, "task", `${y.uuid}.json`);
|
|
88
|
+
return loader.write_string(d2, y);
|
|
89
|
+
});
|
|
90
|
+
await Promise.all(execute_task);
|
|
91
|
+
const d1 = loader.join(loader.root, "project", `${x.uuid}.json`);
|
|
92
|
+
return loader.write_string(d1, x);
|
|
93
|
+
});
|
|
94
|
+
await Promise.all(execute);
|
|
95
|
+
}
|
|
96
|
+
else if (type == interface_1.RecordType.DATABASE) {
|
|
97
|
+
const path = loader.join(loader.root, "parameter");
|
|
98
|
+
if (!loader.exists(path))
|
|
99
|
+
return;
|
|
100
|
+
const p = await loader.read_dir_file(path);
|
|
101
|
+
const ps = p.filter(x => x.endsWith(".json")).map(x => {
|
|
102
|
+
const path2 = loader.join(path, x);
|
|
103
|
+
const path3 = loader.join(loader.root, folder, x);
|
|
104
|
+
return loader.cp(path2, path3);
|
|
105
|
+
});
|
|
106
|
+
await Promise.all(ps);
|
|
107
|
+
loader.mkdir(path);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
exports.ObsoleteSupport = ObsoleteSupport;
|
|
58
111
|
const _CreateRecordIOLoader = (loader, memory, type, folder, ext = ".json") => {
|
|
59
112
|
const get_array = (type) => {
|
|
60
113
|
switch (type) {
|
|
@@ -74,6 +127,7 @@ const _CreateRecordIOLoader = (loader, memory, type, folder, ext = ".json") => {
|
|
|
74
127
|
const root = loader.join(loader.root, folder);
|
|
75
128
|
if (!loader.exists(root))
|
|
76
129
|
await loader.mkdir(root);
|
|
130
|
+
await (0, exports.ObsoleteSupport)(loader, type, folder);
|
|
77
131
|
const files = await loader.read_dir_file(root);
|
|
78
132
|
const r = files.map(x => loader.read_string(loader.join(root, x), { encoding: 'utf8', flag: 'r' }));
|
|
79
133
|
const p = await Promise.all(r);
|
package/package.json
CHANGED
package/src/client/javascript.ts
CHANGED
package/src/interface/enum.ts
CHANGED
package/src/interface/execute.ts
CHANGED
package/src/interface/log.ts
CHANGED
|
@@ -33,15 +33,38 @@ export interface Log {
|
|
|
33
33
|
logs: Array<ExecutionLog>
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* **Execute Record**
|
|
38
|
+
*/
|
|
36
39
|
export interface Record {
|
|
40
|
+
/**
|
|
41
|
+
* **Project List**\
|
|
42
|
+
* Specified the project list for execution
|
|
43
|
+
*/
|
|
37
44
|
projects: Array<Project>
|
|
45
|
+
/**
|
|
46
|
+
* **Node List**\
|
|
47
|
+
* Specified the node list for execution
|
|
48
|
+
*/
|
|
38
49
|
nodes: Array<Node>
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
export interface ExecuteRecord extends Record {
|
|
53
|
+
/**
|
|
54
|
+
* **Thread ID**
|
|
55
|
+
*/
|
|
42
56
|
uuid: string
|
|
57
|
+
/**
|
|
58
|
+
* **Thread Name**
|
|
59
|
+
*/
|
|
43
60
|
name: string
|
|
61
|
+
/**
|
|
62
|
+
* Is it running right now
|
|
63
|
+
*/
|
|
44
64
|
running: boolean
|
|
65
|
+
/**
|
|
66
|
+
* Is it stop right now
|
|
67
|
+
*/
|
|
45
68
|
stop: boolean
|
|
46
69
|
/**
|
|
47
70
|
* The speicifed the process step type
|
|
@@ -50,12 +73,37 @@ export interface ExecuteRecord extends Record {
|
|
|
50
73
|
* * 2: SIngle task through
|
|
51
74
|
*/
|
|
52
75
|
process_type: number
|
|
76
|
+
/**
|
|
77
|
+
* Database data instance right now
|
|
78
|
+
*/
|
|
53
79
|
para: Database | undefined
|
|
80
|
+
/**
|
|
81
|
+
* **Command buffer**\
|
|
82
|
+
* The internal command which execute at next tick\
|
|
83
|
+
* Such as skip and stop command for execute thread
|
|
84
|
+
*/
|
|
54
85
|
command: Array<Array<any>>
|
|
86
|
+
/**
|
|
87
|
+
* **Project ID**
|
|
88
|
+
*/
|
|
55
89
|
project: string
|
|
90
|
+
/**
|
|
91
|
+
* **Cronjob Mod**\
|
|
92
|
+
* Effect display
|
|
93
|
+
*/
|
|
56
94
|
useCron: boolean
|
|
95
|
+
/**
|
|
96
|
+
* **Task ID**
|
|
97
|
+
*/
|
|
57
98
|
task: string
|
|
99
|
+
/**
|
|
100
|
+
* **Current Project Index**\
|
|
101
|
+
* You can have multiple project
|
|
102
|
+
*/
|
|
58
103
|
project_index: number
|
|
104
|
+
/**
|
|
105
|
+
* **Current Task Index**
|
|
106
|
+
*/
|
|
59
107
|
task_index: number
|
|
60
108
|
project_state: Array<ExecuteData>
|
|
61
109
|
task_state: Array<ExecuteData>
|
package/src/interface/struct.ts
CHANGED
|
@@ -63,45 +63,73 @@ export interface Header {
|
|
|
63
63
|
*/
|
|
64
64
|
name: string
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* **Where Data Go**\
|
|
67
|
+
* The path to go\
|
|
68
|
+
* You might go to cluster and send to node children\
|
|
69
|
+
* This data specified the IP path\
|
|
70
|
+
* If undefined, it means it's destinations
|
|
71
|
+
* @example Use Space to seperate
|
|
72
|
+
* "192.168.10.1:50 192.168.10.7:8052"
|
|
73
|
+
*/
|
|
74
|
+
destinations?: string
|
|
75
|
+
/**
|
|
76
|
+
* **Token Session**\
|
|
77
|
+
* Some request require token to access
|
|
67
78
|
*/
|
|
68
79
|
token?: string
|
|
69
80
|
/**
|
|
70
|
-
* Extra
|
|
81
|
+
* **Extra Metadata**
|
|
71
82
|
*/
|
|
72
83
|
meta?: string
|
|
73
84
|
/**
|
|
74
|
-
* Print
|
|
85
|
+
* **Print Message**
|
|
75
86
|
*/
|
|
76
87
|
message?: string
|
|
77
88
|
/**
|
|
78
|
-
* Resource channel
|
|
89
|
+
* **Resource channel**
|
|
79
90
|
*/
|
|
80
91
|
channel?:string
|
|
81
92
|
/**
|
|
82
|
-
*
|
|
93
|
+
* **TData Content**\
|
|
94
|
+
* The content of the websocket package\
|
|
95
|
+
* Put everything you want to send in here
|
|
83
96
|
*/
|
|
84
97
|
data?: any
|
|
85
98
|
}
|
|
86
99
|
|
|
100
|
+
/**
|
|
101
|
+
* **Data Format: Single Data**
|
|
102
|
+
*/
|
|
87
103
|
export interface Single {
|
|
88
104
|
data: any
|
|
89
105
|
}
|
|
90
106
|
|
|
107
|
+
/**
|
|
108
|
+
* **Data Format: Path Data**
|
|
109
|
+
*/
|
|
91
110
|
export interface OnePath {
|
|
92
111
|
path: string
|
|
93
112
|
}
|
|
94
113
|
|
|
114
|
+
/**
|
|
115
|
+
* **Data Format: Arrow Path**
|
|
116
|
+
*/
|
|
95
117
|
export interface TwoPath {
|
|
96
118
|
from: string
|
|
97
119
|
to: string
|
|
98
120
|
}
|
|
99
121
|
|
|
122
|
+
/**
|
|
123
|
+
* **Data Format: Map Setter**
|
|
124
|
+
*/
|
|
100
125
|
export interface Setter {
|
|
101
126
|
key: string
|
|
102
127
|
value: any
|
|
103
128
|
}
|
|
104
129
|
|
|
130
|
+
/**
|
|
131
|
+
* **Data Format: Feedback**
|
|
132
|
+
*/
|
|
105
133
|
export interface FeedBack {
|
|
106
134
|
node_uuid?: string
|
|
107
135
|
index?: number
|
|
@@ -111,11 +139,17 @@ export interface FeedBack {
|
|
|
111
139
|
message: string
|
|
112
140
|
}
|
|
113
141
|
|
|
142
|
+
/**
|
|
143
|
+
* **Data Format: KeyValue**
|
|
144
|
+
*/
|
|
114
145
|
export interface KeyValue {
|
|
115
146
|
key: any
|
|
116
147
|
value: any
|
|
117
148
|
}
|
|
118
149
|
|
|
150
|
+
/**
|
|
151
|
+
* **Data Format: JWT Info**
|
|
152
|
+
*/
|
|
119
153
|
export interface JWT {
|
|
120
154
|
user: string
|
|
121
155
|
create: number
|
|
@@ -230,14 +264,6 @@ export interface TaskLogicUnit {
|
|
|
230
264
|
* **Common Logic Group**
|
|
231
265
|
*/
|
|
232
266
|
children: Array<TaskLogicUnit>
|
|
233
|
-
/**
|
|
234
|
-
* **False Logic Group**
|
|
235
|
-
* - Group
|
|
236
|
-
* - Condition
|
|
237
|
-
* - Execution (True)
|
|
238
|
-
* - Execution (False) <- This part
|
|
239
|
-
*/
|
|
240
|
-
children2?: Array<TaskLogicUnit>
|
|
241
267
|
}
|
|
242
268
|
|
|
243
269
|
/**
|
package/src/lan/en.json
CHANGED
|
@@ -103,14 +103,14 @@
|
|
|
103
103
|
"enter-task-name": "Enter Task Name",
|
|
104
104
|
"enter-task-description": "Enter Task Description",
|
|
105
105
|
"new-job": "New Job",
|
|
106
|
-
"new-
|
|
107
|
-
"edit-
|
|
106
|
+
"new-Variable": "New Variable",
|
|
107
|
+
"edit-Variable": "Modify Variable",
|
|
108
108
|
"delete-database": "Delete Database",
|
|
109
|
-
"enter-
|
|
110
|
-
"new-database-set": "New Database
|
|
111
|
-
"clone-database-set": "Clone Database
|
|
112
|
-
"edit-database-set": "Modify Database
|
|
113
|
-
"enter-database-set-name": "Enter Database
|
|
109
|
+
"enter-Variable-name": "Enter Variable Name",
|
|
110
|
+
"new-database-set": "New Database",
|
|
111
|
+
"clone-database-set": "Clone Database",
|
|
112
|
+
"edit-database-set": "Modify Database",
|
|
113
|
+
"enter-database-set-name": "Enter Database Name",
|
|
114
114
|
"import-database": "Delete Database",
|
|
115
115
|
"delete-database-confirm": "Are you sure delete database you selected",
|
|
116
116
|
"database-datatype": "Datatype",
|
|
@@ -141,7 +141,8 @@
|
|
|
141
141
|
"delete-task-confirm": "Are you sure you want to delete these tasks?",
|
|
142
142
|
"create-service": "Create Service",
|
|
143
143
|
"delete-service": "Delete Service",
|
|
144
|
-
"delete-service-confirm": "Are you sure you want to delete these services?"
|
|
144
|
+
"delete-service-confirm": "Are you sure you want to delete these services?",
|
|
145
|
+
"new-condition": "Create Condition"
|
|
145
146
|
},
|
|
146
147
|
"toolbar": {
|
|
147
148
|
"server": "Server",
|
|
@@ -349,6 +350,16 @@
|
|
|
349
350
|
"messager_log": "messager_log(message:string)"
|
|
350
351
|
}
|
|
351
352
|
},
|
|
353
|
+
"condition": {
|
|
354
|
+
"group": "Group",
|
|
355
|
+
"condition": "Condition",
|
|
356
|
+
"execution": "Execution (Success)",
|
|
357
|
+
"failed": "Execution (Failed)",
|
|
358
|
+
"single": "Job Content",
|
|
359
|
+
"or": "Or",
|
|
360
|
+
"and": "And",
|
|
361
|
+
"not": "Not"
|
|
362
|
+
},
|
|
352
363
|
"token": "Token",
|
|
353
364
|
"info": "Information",
|
|
354
365
|
"search": "Search",
|
|
@@ -425,5 +436,7 @@
|
|
|
425
436
|
"goback": "Go Back",
|
|
426
437
|
"logic": "Logic",
|
|
427
438
|
"use_logic": "Use Logic",
|
|
428
|
-
"remove_logic": "Remove Logic"
|
|
439
|
+
"remove_logic": "Remove Logic",
|
|
440
|
+
"state": "State",
|
|
441
|
+
"delay": "Delay"
|
|
429
442
|
}
|
package/src/lan/zh_TW.json
CHANGED
|
@@ -103,14 +103,14 @@
|
|
|
103
103
|
"enter-task-name": "輸入流程名稱",
|
|
104
104
|
"enter-task-description": "輸入流程敘述",
|
|
105
105
|
"new-job": "新增工作",
|
|
106
|
-
"new-
|
|
107
|
-
"edit-
|
|
106
|
+
"new-Variable": "新增數據",
|
|
107
|
+
"edit-Variable": "編輯數據",
|
|
108
108
|
"delete-database": "刪除資料庫",
|
|
109
|
-
"enter-
|
|
110
|
-
"new-database-set": "
|
|
111
|
-
"clone-database-set": "
|
|
112
|
-
"edit-database-set": "
|
|
113
|
-
"enter-database-set-name": "
|
|
109
|
+
"enter-Variable-name": "輸入數據名稱",
|
|
110
|
+
"new-database-set": "新增資料庫",
|
|
111
|
+
"clone-database-set": "複製資料庫",
|
|
112
|
+
"edit-database-set": "編輯資料庫",
|
|
113
|
+
"enter-database-set-name": "輸入資料庫名稱",
|
|
114
114
|
"import-database": "刪除資料庫",
|
|
115
115
|
"delete-database-confirm": "確認刪除選擇資料庫嗎?",
|
|
116
116
|
"database-datatype": "資料型態",
|
|
@@ -141,7 +141,8 @@
|
|
|
141
141
|
"delete-task-confirm": "確定刪除選取的工作嗎?",
|
|
142
142
|
"create-service": "建立服務",
|
|
143
143
|
"delete-service": "刪除服務",
|
|
144
|
-
"delete-service-confirm": "確定刪除選取的服務嗎?"
|
|
144
|
+
"delete-service-confirm": "確定刪除選取的服務嗎?",
|
|
145
|
+
"new-condition": "建立條件"
|
|
145
146
|
},
|
|
146
147
|
"toolbar": {
|
|
147
148
|
"server": "伺服器",
|
|
@@ -349,6 +350,16 @@
|
|
|
349
350
|
"messager_log": "messager_log(message:string)"
|
|
350
351
|
}
|
|
351
352
|
},
|
|
353
|
+
"condition": {
|
|
354
|
+
"group": "群組",
|
|
355
|
+
"condition": "條件",
|
|
356
|
+
"execution": "執行 (成功)",
|
|
357
|
+
"failed": "執行 (失敗)",
|
|
358
|
+
"single": "工作內容",
|
|
359
|
+
"or": "Or",
|
|
360
|
+
"and": "And",
|
|
361
|
+
"not": "Not"
|
|
362
|
+
},
|
|
352
363
|
"token": "密鑰",
|
|
353
364
|
"info": "資訊",
|
|
354
365
|
"search": "搜尋",
|
|
@@ -425,5 +436,7 @@
|
|
|
425
436
|
"goback": "返回",
|
|
426
437
|
"logic": "邏輯",
|
|
427
438
|
"use_logic": "套用邏輯",
|
|
428
|
-
"remove_logic": "刪除邏輯"
|
|
439
|
+
"remove_logic": "刪除邏輯",
|
|
440
|
+
"state": "狀態",
|
|
441
|
+
"delay": "延遲"
|
|
429
442
|
}
|
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
import { ConditionResult, ExecutePair, ExecuteProxy, ExecuteRecordTask, ExecuteState, FeedBack, Job, JobCategory, MESSAGE_LIMIT, Database, Project, Record, Task } from "../../interface"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The method to handle the init package {@link ExecutePair} process
|
|
5
|
+
*/
|
|
6
|
+
export const receivedPack = (model:ExecutePair, record:Record):boolean => {
|
|
7
|
+
const pass = model.manager!.Register()
|
|
8
|
+
if(pass == -1){
|
|
9
|
+
model.record!.running = false
|
|
10
|
+
model.record!.stop = true
|
|
11
|
+
return false
|
|
12
|
+
}
|
|
13
|
+
model.record!.projects = record.projects
|
|
14
|
+
model.record!.nodes = record.nodes
|
|
15
|
+
model.record!.project_state = model.record!.projects.map(x => {
|
|
16
|
+
return {
|
|
17
|
+
uuid: x.uuid,
|
|
18
|
+
state: ExecuteState.NONE
|
|
11
19
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
model.record!.project_index = pass
|
|
21
|
-
model.record!.project = record.projects[pass].uuid
|
|
22
|
-
model.record!.task_index = 0
|
|
23
|
-
model.record!.task_state = model.record!.projects[0].tasks.map(x => {
|
|
24
|
-
return {
|
|
25
|
-
uuid: x.uuid,
|
|
26
|
-
state: ExecuteState.NONE
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
model.record!.task_state[0].state = ExecuteState.RUNNING
|
|
30
|
-
model.record!.task_detail = []
|
|
31
|
-
const task = model.record!.projects[model.record!.project_index]?.tasks[model.record!.task_index]
|
|
32
|
-
const count = task.cronjob ? (task?.jobs.length ?? 0) : 1
|
|
33
|
-
for(let i = 0; i < count; i++){
|
|
34
|
-
model.record!.task_detail.push({
|
|
35
|
-
index: i,
|
|
36
|
-
node: "",
|
|
37
|
-
message: [],
|
|
38
|
-
state: ExecuteState.NONE
|
|
39
|
-
})
|
|
20
|
+
})
|
|
21
|
+
model.record!.project_index = pass
|
|
22
|
+
model.record!.project = record.projects[pass].uuid
|
|
23
|
+
model.record!.task_index = 0
|
|
24
|
+
model.record!.task_state = model.record!.projects[0].tasks.map(x => {
|
|
25
|
+
return {
|
|
26
|
+
uuid: x.uuid,
|
|
27
|
+
state: ExecuteState.NONE
|
|
40
28
|
}
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
})
|
|
30
|
+
model.record!.task_state[0].state = ExecuteState.RUNNING
|
|
31
|
+
model.record!.task_detail = []
|
|
32
|
+
const task = model.record!.projects[model.record!.project_index]?.tasks[model.record!.task_index]
|
|
33
|
+
const count = task.cronjob ? (task?.jobs.length ?? 0) : 1
|
|
34
|
+
for(let i = 0; i < count; i++){
|
|
35
|
+
model.record!.task_detail.push({
|
|
36
|
+
index: i,
|
|
37
|
+
node: "",
|
|
38
|
+
message: [],
|
|
39
|
+
state: ExecuteState.NONE
|
|
40
|
+
})
|
|
43
41
|
}
|
|
42
|
+
model.manager!.Update()
|
|
43
|
+
return true
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* **Console Proxy Worker**\
|
|
48
|
+
* Process thread call proxy and throght {@link Console_Proxy.execute_proxy}\
|
|
49
|
+
* To communicate with outside record data
|
|
50
|
+
*/
|
|
46
51
|
export class Console_Proxy {
|
|
47
52
|
model:ExecutePair
|
|
48
53
|
|
|
@@ -2,6 +2,11 @@ import { v6 as uuid6 } from 'uuid'
|
|
|
2
2
|
import { ConditionResult, ExecutePair, ExecuteProxy, ExecuteRecordTask, ExecuteState, ExecutionLog, FeedBack, Job, JobCategory, Log, Database, Preference, Project, Task } from "../../interface"
|
|
3
3
|
import * as fs from 'fs'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* **Log Proxy Worker**\
|
|
7
|
+
* Process thread call proxy and throght {@link Log_Proxy.execute_proxy}\
|
|
8
|
+
* To communicate with outside record data
|
|
9
|
+
*/
|
|
5
10
|
export class Log_Proxy {
|
|
6
11
|
model:ExecutePair
|
|
7
12
|
logs:Log
|
package/src/server/detail.ts
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "../interface"
|
|
28
28
|
import { PluginFeedback } from "./server"
|
|
29
29
|
import { MemoryData, RecordIOBase } from './io'
|
|
30
|
-
import {
|
|
30
|
+
import { receivedPack, Console_Proxy } from './detail/console_handle'
|
|
31
31
|
import { Log_Proxy } from './detail/log_handle'
|
|
32
32
|
import { ExecuteManager } from '../script/execute_manager'
|
|
33
33
|
import { WebsocketManager } from '../script/socket_manager'
|
|
@@ -72,7 +72,6 @@ export interface ServerDetailEvent {
|
|
|
72
72
|
*/
|
|
73
73
|
export class ServerDetail {
|
|
74
74
|
execute_manager: Array<ExecutePair> = []
|
|
75
|
-
console:Console_Handler
|
|
76
75
|
websocket_manager: WebsocketManager | undefined
|
|
77
76
|
|
|
78
77
|
shellBind = new Map()
|
|
@@ -105,7 +104,6 @@ export class ServerDetail {
|
|
|
105
104
|
folderReply: this.folderReply
|
|
106
105
|
}
|
|
107
106
|
this.websocket_manager = new WebsocketManager(this.NewConnection, this.DisConnection, this.Analysis, messager_log, n)
|
|
108
|
-
this.console = new Console_Handler()
|
|
109
107
|
// Internal update clock
|
|
110
108
|
this.updatehandle = setInterval(() => {
|
|
111
109
|
this.re.push(...this.console_update())
|
|
@@ -382,7 +380,7 @@ export class ServerDetail {
|
|
|
382
380
|
const uscp:Console_Proxy = new Console_Proxy(p)
|
|
383
381
|
const uslp:Log_Proxy = new Log_Proxy(p, { logs: this.backend.memory.logs }, this.backend.GetPreference(uuid)!)
|
|
384
382
|
em.proxy = this.CombineProxy([uscp.execute_proxy, uslp.execute_proxy])
|
|
385
|
-
const r =
|
|
383
|
+
const r = receivedPack(p, record)
|
|
386
384
|
if(r) this.execute_manager.push(p)
|
|
387
385
|
|
|
388
386
|
if(socket != undefined){
|
package/src/server/io.ts
CHANGED
|
@@ -136,6 +136,58 @@ export const _CreateRecordMemoryLoader = (loader:MemoryData, type:RecordType):Re
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
+
export const ObsoleteSupport = async (loader:RecordIOBase, type:RecordType, folder:string) => {
|
|
140
|
+
if(type == RecordType.PROJECT){
|
|
141
|
+
const path = loader.join(loader.root, "record")
|
|
142
|
+
if(!loader.exists(path)) return
|
|
143
|
+
const p = await loader.read_dir_file(path)
|
|
144
|
+
const ps = p.filter(x => x.endsWith(".json")).map(x => {
|
|
145
|
+
const path_r = loader.join(path, x)
|
|
146
|
+
return loader.read_string(path_r)
|
|
147
|
+
})
|
|
148
|
+
const allRecordText:Array<string> = await Promise.all(ps)
|
|
149
|
+
const allRecord:Array<any> = allRecordText.map(x => JSON.parse(x))
|
|
150
|
+
const execute = allRecord.map(async x => {
|
|
151
|
+
x.tasks = []
|
|
152
|
+
x.databaser_uuid = x.parameter_uuid
|
|
153
|
+
x.tasks_uuid = x.task.map(y => y.uuid)
|
|
154
|
+
const tasks:Array<any> = x.task
|
|
155
|
+
delete x.parameter_uuid
|
|
156
|
+
delete x.task
|
|
157
|
+
|
|
158
|
+
const execute_task = tasks.map(async y => {
|
|
159
|
+
const jobs = y.jobs
|
|
160
|
+
y.jobs = []
|
|
161
|
+
y.jobs_uuid = y.jobs.map(z => z.uuid)
|
|
162
|
+
|
|
163
|
+
const execute_jobs = jobs.map(async z => {
|
|
164
|
+
z.id_args = []
|
|
165
|
+
const d3 = loader.join(loader.root, "job", `${z.uuid}.json`)
|
|
166
|
+
return loader.write_string(d3, z)
|
|
167
|
+
})
|
|
168
|
+
await Promise.all(execute_jobs)
|
|
169
|
+
const d2 = loader.join(loader.root, "task", `${y.uuid}.json`)
|
|
170
|
+
return loader.write_string(d2, y)
|
|
171
|
+
})
|
|
172
|
+
await Promise.all(execute_task)
|
|
173
|
+
const d1 = loader.join(loader.root, "project", `${x.uuid}.json`)
|
|
174
|
+
return loader.write_string(d1, x)
|
|
175
|
+
})
|
|
176
|
+
await Promise.all(execute)
|
|
177
|
+
}
|
|
178
|
+
else if(type == RecordType.DATABASE){
|
|
179
|
+
const path = loader.join(loader.root, "parameter")
|
|
180
|
+
if(!loader.exists(path)) return
|
|
181
|
+
const p = await loader.read_dir_file(path)
|
|
182
|
+
const ps = p.filter(x => x.endsWith(".json")).map(x => {
|
|
183
|
+
const path2 = loader.join(path, x)
|
|
184
|
+
const path3 = loader.join(loader.root, folder, x)
|
|
185
|
+
return loader.cp(path2, path3)
|
|
186
|
+
})
|
|
187
|
+
await Promise.all(ps)
|
|
188
|
+
loader.mkdir(path)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
139
191
|
/**
|
|
140
192
|
* **Create the interface for record files storage**\
|
|
141
193
|
* Generate a loader interface for register to server event
|
|
@@ -162,6 +214,7 @@ export const _CreateRecordIOLoader = (loader:RecordIOBase, memory:MemoryData, ty
|
|
|
162
214
|
load_all: async ():Promise<Array<string>> => {
|
|
163
215
|
const root = loader.join(loader.root, folder)
|
|
164
216
|
if(!loader.exists(root)) await loader.mkdir(root)
|
|
217
|
+
await ObsoleteSupport(loader, type, folder)
|
|
165
218
|
const files = await loader.read_dir_file(root)
|
|
166
219
|
const r:Array<Promise<string>> = files.map(x =>
|
|
167
220
|
loader.read_string(loader.join(root, x), { encoding: 'utf8', flag: 'r' })
|