@nocobase/plugin-async-task-manager 2.0.0-alpha.9 → 2.0.0-beta.2
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/index.d.ts +1 -0
- package/dist/client/index.js +1 -1
- package/dist/common/collections/asyncTasks.d.ts +2 -0
- package/dist/common/collections/asyncTasks.js +2 -0
- package/dist/externalVersion.js +7 -6
- package/dist/locale/de-DE.json +31 -31
- package/dist/locale/en-US.json +40 -1
- package/dist/locale/es-ES.json +45 -0
- package/dist/locale/fr-FR.json +45 -0
- package/dist/locale/hu-HU.json +45 -0
- package/dist/locale/id-ID.json +45 -0
- package/dist/locale/it-IT.json +31 -31
- package/dist/locale/ja-JP.json +45 -0
- package/dist/locale/ko-KR.json +45 -0
- package/dist/locale/nl-NL.json +44 -45
- package/dist/locale/pt-BR.json +45 -0
- package/dist/locale/ru-RU.json +45 -0
- package/dist/locale/tr-TR.json +45 -0
- package/dist/locale/uk-UA.json +45 -0
- package/dist/locale/vi-VN.json +45 -0
- package/dist/locale/zh-CN.json +31 -31
- package/dist/locale/zh-TW.json +45 -0
- package/dist/server/base-task-manager.js +34 -22
- package/dist/server/command-task-type.d.ts +1 -0
- package/dist/server/command-task-type.js +38 -3
- package/dist/server/task-type.js +3 -2
- package/package.json +4 -2
package/dist/locale/nl-NL.json
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
1
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
|
-
|
|
2
|
+
"Actions": "Acties",
|
|
3
|
+
"Cancel": "Annuleren",
|
|
4
|
+
"Cancelled": "Geannuleerd",
|
|
5
|
+
"Cancelling": "Annuleren",
|
|
6
|
+
"Close": "Sluiten",
|
|
7
|
+
"Completed": "Voltooid",
|
|
8
|
+
"Confirm": "Bevestigen",
|
|
9
|
+
"Confirm cancel": "Bevestig annuleren",
|
|
10
|
+
"Confirm to cancel this task?": "Weet je zeker dat je deze taak wilt annuleren?",
|
|
11
|
+
"Created at": "Aangemaakt op",
|
|
12
|
+
"Data": "Data",
|
|
13
|
+
"Download": "Downloaden",
|
|
14
|
+
"Error Details": "Foutdetails",
|
|
15
|
+
"Error code": "Foutcode",
|
|
16
|
+
"Error details": "Foutdetails",
|
|
17
|
+
"Export": "Exporteer",
|
|
18
|
+
"Export {collection} attachments": "Exporteer {collection} bijlagen",
|
|
19
|
+
"Export {collection} data": "Exporteer {collection} gegevens",
|
|
20
|
+
"Failed": "Mislukt",
|
|
21
|
+
"Import": "Importeer",
|
|
22
|
+
"Import completed": "Import voltooid: {{success}} records geïmporteerd, {{updated}} records bijgewerkt, {{skipped}} records overgeslagen, totaal {{total}} records",
|
|
23
|
+
"Import details": "{{success}} records zijn geïmporteerd, {{updated}} records zijn bijgewerkt, {{skipped}} records zijn overgeslagen, totaal {{total}} records",
|
|
24
|
+
"Import result": "Importresultaat",
|
|
25
|
+
"Import summary": "Importeer {{success}}/{{total}}",
|
|
26
|
+
"Import {collection} data": "Importeer {collection} gegevens",
|
|
27
|
+
"ImportResult": "{{success}} records zijn geïmporteerd, {{updated}} records zijn bijgewerkt, {{skipped}} records zijn overgeslagen, totaal {{total}} records",
|
|
28
|
+
"Imported": "{{count}}/{{total}}",
|
|
29
|
+
"OK": "OK",
|
|
30
|
+
"Processing": "Verwerken",
|
|
31
|
+
"Skipped records": "Overgeslagen records",
|
|
32
|
+
"Status": "Status",
|
|
33
|
+
"Successfully imported": "Succesvol geïmporteerd",
|
|
34
|
+
"Task": "Taak",
|
|
35
|
+
"Task cancelled": "Taak geannuleerd",
|
|
36
|
+
"Task completed": "Taak voltooid",
|
|
37
|
+
"Task failed": "Taak mislukt",
|
|
38
|
+
"Task result": "Taakresultaat",
|
|
39
|
+
"Total records": "Totaal aantal records",
|
|
40
|
+
"Type": "Type",
|
|
41
|
+
"Unknown error": "Onbekende fout",
|
|
42
|
+
"Updated records": "Bijgewerkte records",
|
|
43
|
+
"View result": "Toon",
|
|
44
|
+
"Waiting": "Wachten"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Actions",
|
|
3
|
+
"Cancel": "Cancel",
|
|
4
|
+
"Cancelled": "Cancelled",
|
|
5
|
+
"Cancelling": "Cancelling",
|
|
6
|
+
"Close": "Close",
|
|
7
|
+
"Completed": "Completed",
|
|
8
|
+
"Confirm": "Confirm",
|
|
9
|
+
"Confirm cancel": "Confirm cancel",
|
|
10
|
+
"Confirm to cancel this task?": "Confirm to cancel this task?",
|
|
11
|
+
"Created at": "Created at",
|
|
12
|
+
"Data": "Data",
|
|
13
|
+
"Download": "Download",
|
|
14
|
+
"Error Details": "Error Details",
|
|
15
|
+
"Error code": "Error code",
|
|
16
|
+
"Error details": "Error details",
|
|
17
|
+
"Export": "Export",
|
|
18
|
+
"Export {collection} attachments": "{collection} attachments export",
|
|
19
|
+
"Export {collection} data": "{collection} data export",
|
|
20
|
+
"Failed": "Failed",
|
|
21
|
+
"Import": "Import",
|
|
22
|
+
"Import completed": "Import completed",
|
|
23
|
+
"Import details": "Import details",
|
|
24
|
+
"Import result": "Import result",
|
|
25
|
+
"Import summary": "Import summary",
|
|
26
|
+
"Import {collection} data": "{collection} data import",
|
|
27
|
+
"ImportResult": "ImportResult",
|
|
28
|
+
"Imported": "Imported",
|
|
29
|
+
"OK": "OK",
|
|
30
|
+
"Processing": "Processing",
|
|
31
|
+
"Skipped records": "Skipped records",
|
|
32
|
+
"Status": "Status",
|
|
33
|
+
"Successfully imported": "Successfully imported",
|
|
34
|
+
"Task": "Task",
|
|
35
|
+
"Task cancelled": "Task cancelled",
|
|
36
|
+
"Task completed": "Task completed",
|
|
37
|
+
"Task failed": "Task failed",
|
|
38
|
+
"Task result": "Task result",
|
|
39
|
+
"Total records": "Total records",
|
|
40
|
+
"Type": "Type",
|
|
41
|
+
"Unknown error": "Unknown error",
|
|
42
|
+
"Updated records": "Updated records",
|
|
43
|
+
"View result": "View result",
|
|
44
|
+
"Waiting": "Waiting"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Действия",
|
|
3
|
+
"Cancel": "Отменить",
|
|
4
|
+
"Cancelled": "Отменено",
|
|
5
|
+
"Cancelling": "Отмена",
|
|
6
|
+
"Close": "Закрыть",
|
|
7
|
+
"Completed": "Завершено",
|
|
8
|
+
"Confirm": "Подтвердить",
|
|
9
|
+
"Confirm cancel": "Подтвердить отмену",
|
|
10
|
+
"Confirm to cancel this task?": "Описание подтверждения отмены",
|
|
11
|
+
"Created at": "Создано",
|
|
12
|
+
"Data": "Данные",
|
|
13
|
+
"Download": "Скачать",
|
|
14
|
+
"Error Details": "Детали ошибки",
|
|
15
|
+
"Error code": "Код ошибки",
|
|
16
|
+
"Error details": "Детали ошибки",
|
|
17
|
+
"Export": "Экспорт",
|
|
18
|
+
"Export {collection} attachments": "Экспорт вложений {collection}",
|
|
19
|
+
"Export {collection} data": "Экспорт данных {collection}",
|
|
20
|
+
"Failed": "Не удалось",
|
|
21
|
+
"Import": "Импорт",
|
|
22
|
+
"Import completed": "Импорт завершен",
|
|
23
|
+
"Import details": "Детали импорта",
|
|
24
|
+
"Import result": "Результат импорта",
|
|
25
|
+
"Import summary": "Сводка импорта",
|
|
26
|
+
"Import {collection} data": "Импорт данных {collection}",
|
|
27
|
+
"ImportResult": "Результат импорта",
|
|
28
|
+
"Imported": "Импортировано",
|
|
29
|
+
"OK": "ОК",
|
|
30
|
+
"Processing": "Обработка",
|
|
31
|
+
"Skipped records": "Пропущенные записи",
|
|
32
|
+
"Status": "Статус",
|
|
33
|
+
"Successfully imported": "Успешно импортировано",
|
|
34
|
+
"Task": "Задача",
|
|
35
|
+
"Task cancelled": "Задача отменена",
|
|
36
|
+
"Task completed": "Задача завершена",
|
|
37
|
+
"Task failed": "Задача не выполнена",
|
|
38
|
+
"Task result": "Результат задачи",
|
|
39
|
+
"Total records": "Всего записей",
|
|
40
|
+
"Type": "Тип",
|
|
41
|
+
"Unknown error": "Неизвестная ошибка",
|
|
42
|
+
"Updated records": "Обновленные записи",
|
|
43
|
+
"View result": "Просмотреть результат",
|
|
44
|
+
"Waiting": "Ожидание"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Actions",
|
|
3
|
+
"Cancel": "Cancel",
|
|
4
|
+
"Cancelled": "Cancelled",
|
|
5
|
+
"Cancelling": "Cancelling",
|
|
6
|
+
"Close": "Close",
|
|
7
|
+
"Completed": "Completed",
|
|
8
|
+
"Confirm": "Confirm",
|
|
9
|
+
"Confirm cancel": "Confirm cancel",
|
|
10
|
+
"Confirm to cancel this task?": "Confirm to cancel this task?",
|
|
11
|
+
"Created at": "Created at",
|
|
12
|
+
"Data": "Data",
|
|
13
|
+
"Download": "Download",
|
|
14
|
+
"Error Details": "Error Details",
|
|
15
|
+
"Error code": "Error code",
|
|
16
|
+
"Error details": "Error details",
|
|
17
|
+
"Export": "Export",
|
|
18
|
+
"Export {collection} attachments": "{collection} attachments export",
|
|
19
|
+
"Export {collection} data": "{collection} data export",
|
|
20
|
+
"Failed": "Failed",
|
|
21
|
+
"Import": "Import",
|
|
22
|
+
"Import completed": "Import completed",
|
|
23
|
+
"Import details": "Import details",
|
|
24
|
+
"Import result": "Import result",
|
|
25
|
+
"Import summary": "Import summary",
|
|
26
|
+
"Import {collection} data": "{collection} data import",
|
|
27
|
+
"ImportResult": "ImportResult",
|
|
28
|
+
"Imported": "Imported",
|
|
29
|
+
"OK": "OK",
|
|
30
|
+
"Processing": "Processing",
|
|
31
|
+
"Skipped records": "Skipped records",
|
|
32
|
+
"Status": "Status",
|
|
33
|
+
"Successfully imported": "Successfully imported",
|
|
34
|
+
"Task": "Task",
|
|
35
|
+
"Task cancelled": "Task cancelled",
|
|
36
|
+
"Task completed": "Task completed",
|
|
37
|
+
"Task failed": "Task failed",
|
|
38
|
+
"Task result": "Task result",
|
|
39
|
+
"Total records": "Total records",
|
|
40
|
+
"Type": "Type",
|
|
41
|
+
"Unknown error": "Unknown error",
|
|
42
|
+
"Updated records": "Updated records",
|
|
43
|
+
"View result": "View result",
|
|
44
|
+
"Waiting": "Waiting"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Actions",
|
|
3
|
+
"Cancel": "Cancel",
|
|
4
|
+
"Cancelled": "Cancelled",
|
|
5
|
+
"Cancelling": "Cancelling",
|
|
6
|
+
"Close": "Close",
|
|
7
|
+
"Completed": "Completed",
|
|
8
|
+
"Confirm": "Confirm",
|
|
9
|
+
"Confirm cancel": "Confirm cancel",
|
|
10
|
+
"Confirm to cancel this task?": "Confirm to cancel this task?",
|
|
11
|
+
"Created at": "Created at",
|
|
12
|
+
"Data": "Data",
|
|
13
|
+
"Download": "Download",
|
|
14
|
+
"Error Details": "Error Details",
|
|
15
|
+
"Error code": "Error code",
|
|
16
|
+
"Error details": "Error details",
|
|
17
|
+
"Export": "Export",
|
|
18
|
+
"Export {collection} attachments": "{collection} attachments export",
|
|
19
|
+
"Export {collection} data": "{collection} data export",
|
|
20
|
+
"Failed": "Failed",
|
|
21
|
+
"Import": "Import",
|
|
22
|
+
"Import completed": "Import completed",
|
|
23
|
+
"Import details": "Import details",
|
|
24
|
+
"Import result": "Import result",
|
|
25
|
+
"Import summary": "Import summary",
|
|
26
|
+
"Import {collection} data": "{collection} data import",
|
|
27
|
+
"ImportResult": "ImportResult",
|
|
28
|
+
"Imported": "Imported",
|
|
29
|
+
"OK": "OK",
|
|
30
|
+
"Processing": "Processing",
|
|
31
|
+
"Skipped records": "Skipped records",
|
|
32
|
+
"Status": "Status",
|
|
33
|
+
"Successfully imported": "Successfully imported",
|
|
34
|
+
"Task": "Task",
|
|
35
|
+
"Task cancelled": "Task cancelled",
|
|
36
|
+
"Task completed": "Task completed",
|
|
37
|
+
"Task failed": "Task failed",
|
|
38
|
+
"Task result": "Task result",
|
|
39
|
+
"Total records": "Total records",
|
|
40
|
+
"Type": "Type",
|
|
41
|
+
"Unknown error": "Unknown error",
|
|
42
|
+
"Updated records": "Updated records",
|
|
43
|
+
"View result": "View result",
|
|
44
|
+
"Waiting": "Waiting"
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Actions",
|
|
3
|
+
"Cancel": "Cancel",
|
|
4
|
+
"Cancelled": "Cancelled",
|
|
5
|
+
"Cancelling": "Cancelling",
|
|
6
|
+
"Close": "Close",
|
|
7
|
+
"Completed": "Completed",
|
|
8
|
+
"Confirm": "Confirm",
|
|
9
|
+
"Confirm cancel": "Confirm cancel",
|
|
10
|
+
"Confirm cancel description": "Confirm cancel description",
|
|
11
|
+
"Created at": "Created at",
|
|
12
|
+
"Data": "Data",
|
|
13
|
+
"Download": "Download",
|
|
14
|
+
"Error Details": "Error Details",
|
|
15
|
+
"Error code": "Error code",
|
|
16
|
+
"Error details": "Error details",
|
|
17
|
+
"Export": "Xuất",
|
|
18
|
+
"Export {collection} attachments": "{collection} attachments export",
|
|
19
|
+
"Export {collection} data": "{collection} data export",
|
|
20
|
+
"Failed": "Thất bại",
|
|
21
|
+
"Import": "Nhập",
|
|
22
|
+
"Import completed": "Import completed",
|
|
23
|
+
"Import details": "Import details",
|
|
24
|
+
"Import result": "Import result",
|
|
25
|
+
"Import summary": "Import summary",
|
|
26
|
+
"Import {collection} data": "{collection} data import",
|
|
27
|
+
"ImportResult": "ImportResult",
|
|
28
|
+
"Imported": "Imported",
|
|
29
|
+
"OK": "OK",
|
|
30
|
+
"Processing": "Processing",
|
|
31
|
+
"Skipped records": "Skipped records",
|
|
32
|
+
"Status": "Trạng thái",
|
|
33
|
+
"Successfully imported": "Successfully imported",
|
|
34
|
+
"Task": "Task",
|
|
35
|
+
"Task cancelled": "Task cancelled",
|
|
36
|
+
"Task completed": "Task completed",
|
|
37
|
+
"Task failed": "Task failed",
|
|
38
|
+
"Task result": "Task result",
|
|
39
|
+
"Total records": "Total records",
|
|
40
|
+
"Type": "Loại",
|
|
41
|
+
"Unknown error": "Unknown error",
|
|
42
|
+
"Updated records": "Updated records",
|
|
43
|
+
"View result": "View result",
|
|
44
|
+
"Waiting": "Waiting"
|
|
45
|
+
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
"Export": "导出",
|
|
3
|
-
"Import": "导入",
|
|
4
|
-
"Data": "数据",
|
|
5
|
-
"Task": "任务",
|
|
6
|
-
"Status": "状态",
|
|
7
2
|
"Actions": "操作",
|
|
8
|
-
"Created at": "创建时间",
|
|
9
|
-
"Type": "类型",
|
|
10
|
-
"Waiting": "正在排队等待...",
|
|
11
|
-
"Processing": "进行中",
|
|
12
|
-
"Completed": "已完成",
|
|
13
|
-
"Failed": "执行失败",
|
|
14
|
-
"Cancelled": "已取消",
|
|
15
3
|
"Cancel": "取消",
|
|
4
|
+
"Cancelled": "已取消",
|
|
16
5
|
"Cancelling": "取消中",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"Confirm cancel": "确认取消",
|
|
20
|
-
"Confirm cancel description": "确定要取消这个任务吗?",
|
|
6
|
+
"Close": "关闭",
|
|
7
|
+
"Completed": "已完成",
|
|
21
8
|
"Confirm": "确定",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
9
|
+
"Confirm cancel": "确认取消",
|
|
10
|
+
"Confirm to cancel this task?": "确定要取消这个任务吗?",
|
|
11
|
+
"Created at": "创建时间",
|
|
12
|
+
"Data": "数据",
|
|
13
|
+
"Download": "下载",
|
|
25
14
|
"Error Details": "错误详情",
|
|
26
|
-
"Close": "关闭",
|
|
27
15
|
"Error code": "错误代码",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
16
|
+
"Error details": "错误详情",
|
|
17
|
+
"Export": "导出",
|
|
18
|
+
"Export {collection} attachments": "导出{collection}附件",
|
|
19
|
+
"Export {collection} data": "导出{collection}记录",
|
|
20
|
+
"Failed": "执行失败",
|
|
21
|
+
"Import": "导入",
|
|
31
22
|
"Import completed": "导入完成:{{success}} 条记录已导入,{{updated}} 条记录已更新,{{skipped}} 条记录已跳过,共 {{total}} 条记录",
|
|
32
|
-
"Import summary": "已导入 {{success}}/{{total}} 条记录",
|
|
33
23
|
"Import details": "成功导入 {{success}} 条,更新 {{updated}} 条,跳过 {{skipped}} 条,共 {{total}} 条",
|
|
24
|
+
"Import result": "导入结果",
|
|
25
|
+
"Import summary": "已导入 {{success}}/{{total}} 条记录",
|
|
26
|
+
"Import {collection} data": "导入{collection}数据",
|
|
27
|
+
"ImportResult": "已导入 {{success}} 条,更新 {{updated}} 条,跳过 {{skipped}} 条,共 {{total}} 条",
|
|
34
28
|
"Imported": "已导入 {{count}}/{{total}}",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
29
|
+
"OK": "确定",
|
|
30
|
+
"Processing": "进行中",
|
|
37
31
|
"Skipped records": "已跳过记录",
|
|
32
|
+
"Status": "状态",
|
|
33
|
+
"Successfully imported": "成功导入",
|
|
34
|
+
"Task": "任务",
|
|
35
|
+
"Task cancelled": "任务已取消",
|
|
36
|
+
"Task completed": "任务已完成",
|
|
37
|
+
"Task failed": "任务执行失败",
|
|
38
|
+
"Task result": "任务结果",
|
|
38
39
|
"Total records": "总记录数",
|
|
40
|
+
"Type": "类型",
|
|
41
|
+
"Unknown error": "未知错误",
|
|
42
|
+
"Updated records": "已更新记录",
|
|
39
43
|
"View result": "查看结果",
|
|
40
|
-
"
|
|
41
|
-
"Task result": "任务结果",
|
|
42
|
-
"Export {collection} attachments": "导出{collection}附件",
|
|
43
|
-
"Export {collection} data": "导出{collection}记录",
|
|
44
|
-
"Import {collection} data": "导入{collection}数据"
|
|
44
|
+
"Waiting": "等待中"
|
|
45
45
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Actions",
|
|
3
|
+
"Cancel": "Cancel",
|
|
4
|
+
"Cancelled": "Cancelled",
|
|
5
|
+
"Cancelling": "Cancelling",
|
|
6
|
+
"Close": "Close",
|
|
7
|
+
"Completed": "Completed",
|
|
8
|
+
"Confirm": "Confirm",
|
|
9
|
+
"Confirm cancel": "Confirm cancel",
|
|
10
|
+
"Confirm to cancel this task?": "Confirm to cancel this task?",
|
|
11
|
+
"Created at": "Created at",
|
|
12
|
+
"Data": "Data",
|
|
13
|
+
"Download": "Download",
|
|
14
|
+
"Error Details": "Error Details",
|
|
15
|
+
"Error code": "Error code",
|
|
16
|
+
"Error details": "Error details",
|
|
17
|
+
"Export": "Export",
|
|
18
|
+
"Export {collection} attachments": "{collection} attachments export",
|
|
19
|
+
"Export {collection} data": "{collection} data export",
|
|
20
|
+
"Failed": "Failed",
|
|
21
|
+
"Import": "Import",
|
|
22
|
+
"Import completed": "Import completed",
|
|
23
|
+
"Import details": "Import details",
|
|
24
|
+
"Import result": "Import result",
|
|
25
|
+
"Import summary": "Import summary",
|
|
26
|
+
"Import {collection} data": "{collection} data import",
|
|
27
|
+
"ImportResult": "ImportResult",
|
|
28
|
+
"Imported": "Imported",
|
|
29
|
+
"OK": "OK",
|
|
30
|
+
"Processing": "Processing",
|
|
31
|
+
"Skipped records": "Skipped records",
|
|
32
|
+
"Status": "Status",
|
|
33
|
+
"Successfully imported": "Successfully imported",
|
|
34
|
+
"Task": "Task",
|
|
35
|
+
"Task cancelled": "Task cancelled",
|
|
36
|
+
"Task completed": "Task completed",
|
|
37
|
+
"Task failed": "Task failed",
|
|
38
|
+
"Task result": "Task result",
|
|
39
|
+
"Total records": "Total records",
|
|
40
|
+
"Type": "Type",
|
|
41
|
+
"Unknown error": "Unknown error",
|
|
42
|
+
"Updated records": "Updated records",
|
|
43
|
+
"View result": "View result",
|
|
44
|
+
"Waiting": "Waiting"
|
|
45
|
+
}
|
|
@@ -130,31 +130,43 @@ class BaseTaskManager {
|
|
|
130
130
|
cleanup = async () => {
|
|
131
131
|
this.logger.debug("Running cleanup for completed tasks...");
|
|
132
132
|
const TaskRepo = this.app.db.getRepository("asyncTasks");
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
try {
|
|
134
|
+
const tasksToCleanup = await TaskRepo.find({
|
|
135
|
+
fields: ["id"],
|
|
136
|
+
filter: {
|
|
137
|
+
$or: [
|
|
138
|
+
{
|
|
139
|
+
status: [import_constants.TASK_STATUS.SUCCEEDED, import_constants.TASK_STATUS.FAILED],
|
|
140
|
+
doneAt: {
|
|
141
|
+
$lt: new Date(Date.now() - this.cleanupDelay)
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
status: import_constants.TASK_STATUS.CANCELED
|
|
141
146
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
this.logger.debug(`Found ${tasksToCleanup.length} tasks to cleanup`);
|
|
151
|
+
if (tasksToCleanup.length) {
|
|
152
|
+
for (const task of tasksToCleanup) {
|
|
153
|
+
this.tasks.delete(task.id);
|
|
154
|
+
this.progressThrottles.delete(task.id);
|
|
155
|
+
}
|
|
156
|
+
await TaskRepo.destroy({
|
|
157
|
+
filterByTk: tasksToCleanup.map((task) => task.id),
|
|
158
|
+
individualHooks: true
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
} catch (error) {
|
|
162
|
+
this.logger.error(`DB error during cleanup: ${error.message}. Will stop cleanup timer.`, { error });
|
|
163
|
+
if (error.name === "SequelizeConnectionAcquireTimeoutError") {
|
|
164
|
+
if (this.cleanupTimer) {
|
|
165
|
+
clearInterval(this.cleanupTimer);
|
|
166
|
+
this.cleanupTimer = null;
|
|
167
|
+
}
|
|
147
168
|
}
|
|
148
|
-
});
|
|
149
|
-
this.logger.debug(`Found ${tasksToCleanup.length} tasks to cleanup`);
|
|
150
|
-
for (const task of tasksToCleanup) {
|
|
151
|
-
this.tasks.delete(task.id);
|
|
152
|
-
this.progressThrottles.delete(task.id);
|
|
153
169
|
}
|
|
154
|
-
await TaskRepo.destroy({
|
|
155
|
-
filterByTk: tasksToCleanup.map((task) => task.id),
|
|
156
|
-
individualHooks: true
|
|
157
|
-
});
|
|
158
170
|
};
|
|
159
171
|
getThrottledProgressEmitter(taskId, userId) {
|
|
160
172
|
if (!this.progressThrottles.has(taskId)) {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
/// <reference types="node" />
|
|
10
10
|
import { Worker } from 'worker_threads';
|
|
11
11
|
import { TaskType } from './task-type';
|
|
12
|
+
export declare function parseArgv(list: string[]): any;
|
|
12
13
|
export declare class CommandTaskType extends TaskType {
|
|
13
14
|
static type: string;
|
|
14
15
|
workerThread: Worker;
|
|
@@ -36,7 +36,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
var command_task_type_exports = {};
|
|
38
38
|
__export(command_task_type_exports, {
|
|
39
|
-
CommandTaskType: () => CommandTaskType
|
|
39
|
+
CommandTaskType: () => CommandTaskType,
|
|
40
|
+
parseArgv: () => parseArgv
|
|
40
41
|
});
|
|
41
42
|
module.exports = __toCommonJS(command_task_type_exports);
|
|
42
43
|
var import_async_task_manager = require("./interfaces/async-task-manager");
|
|
@@ -44,6 +45,37 @@ var import_node_process = __toESM(require("node:process"));
|
|
|
44
45
|
var import_worker_threads = require("worker_threads");
|
|
45
46
|
var import_path = __toESM(require("path"));
|
|
46
47
|
var import_task_type = require("./task-type");
|
|
48
|
+
function parseArgv(list) {
|
|
49
|
+
const argv = {};
|
|
50
|
+
for (const item of list) {
|
|
51
|
+
const match = item.match(/^--([^=]+)=(.*)$/);
|
|
52
|
+
if (match) {
|
|
53
|
+
const key = match[1];
|
|
54
|
+
let value = match[2];
|
|
55
|
+
if (value.startsWith("{") || value.startsWith("[")) {
|
|
56
|
+
try {
|
|
57
|
+
value = JSON.parse(value);
|
|
58
|
+
} catch (err) {
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
if (value === "true") {
|
|
62
|
+
value = true;
|
|
63
|
+
} else if (value === "false") {
|
|
64
|
+
value = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
argv[key] = value;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const parts = item.split(":");
|
|
71
|
+
if (parts.length === 2) {
|
|
72
|
+
const command = parts[0];
|
|
73
|
+
const commandValue = parts[1];
|
|
74
|
+
argv[command] = commandValue;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return argv;
|
|
78
|
+
}
|
|
47
79
|
class CommandTaskType extends import_task_type.TaskType {
|
|
48
80
|
static type = "command";
|
|
49
81
|
workerThread;
|
|
@@ -55,6 +87,7 @@ class CommandTaskType extends import_task_type.TaskType {
|
|
|
55
87
|
async execute() {
|
|
56
88
|
var _a;
|
|
57
89
|
const { argv } = this.record.params;
|
|
90
|
+
const parsedArgv = parseArgv(argv);
|
|
58
91
|
const isDev = (((_a = import_node_process.default.argv[1]) == null ? void 0 : _a.endsWith(".ts")) || import_node_process.default.argv[1].includes("tinypool")) ?? false;
|
|
59
92
|
const appRoot = import_node_process.default.env.APP_PACKAGE_ROOT || "packages/core/app";
|
|
60
93
|
const workerPath = import_path.default.resolve(import_node_process.default.cwd(), appRoot, isDev ? "src/index.ts" : "lib/index.js");
|
|
@@ -73,7 +106,8 @@ class CommandTaskType extends import_task_type.TaskType {
|
|
|
73
106
|
},
|
|
74
107
|
env: {
|
|
75
108
|
...import_node_process.default.env,
|
|
76
|
-
WORKER_MODE: "-"
|
|
109
|
+
WORKER_MODE: "-",
|
|
110
|
+
...parsedArgv.app && parsedArgv.app !== "main" ? { STARTUP_SUBAPP: parsedArgv.app } : {}
|
|
77
111
|
}
|
|
78
112
|
});
|
|
79
113
|
this.workerThread = worker;
|
|
@@ -128,5 +162,6 @@ class CommandTaskType extends import_task_type.TaskType {
|
|
|
128
162
|
}
|
|
129
163
|
// Annotate the CommonJS export names for ESM import in node:
|
|
130
164
|
0 && (module.exports = {
|
|
131
|
-
CommandTaskType
|
|
165
|
+
CommandTaskType,
|
|
166
|
+
parseArgv
|
|
132
167
|
});
|
package/dist/server/task-type.js
CHANGED
|
@@ -116,11 +116,12 @@ class TaskType {
|
|
|
116
116
|
try {
|
|
117
117
|
const result = await this.execute();
|
|
118
118
|
(_c = this.logger) == null ? void 0 : _c.info(`Task ${this.record.id} completed successfully with result: ${JSON.stringify(result)}`);
|
|
119
|
-
|
|
119
|
+
this.record.set({
|
|
120
120
|
status: import_constants.TASK_STATUS.SUCCEEDED,
|
|
121
121
|
doneAt: /* @__PURE__ */ new Date(),
|
|
122
122
|
result
|
|
123
123
|
});
|
|
124
|
+
await this.record.save();
|
|
124
125
|
} catch (error) {
|
|
125
126
|
if (error instanceof import_async_task_manager.CancelError) {
|
|
126
127
|
(_d = this.logger) == null ? void 0 : _d.info(`Task ${this.record.id} was cancelled during execution`);
|
|
@@ -129,7 +130,7 @@ class TaskType {
|
|
|
129
130
|
await this.record.update({
|
|
130
131
|
status: import_constants.TASK_STATUS.FAILED,
|
|
131
132
|
doneAt: /* @__PURE__ */ new Date(),
|
|
132
|
-
error: error.
|
|
133
|
+
result: { ...error, message: error.message }
|
|
133
134
|
});
|
|
134
135
|
(_e = this.logger) == null ? void 0 : _e.error(`Task ${this.record.id} failed with error: ${error.message}`);
|
|
135
136
|
throw error;
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-async-task-manager",
|
|
3
3
|
"displayName": "Async task manager",
|
|
4
|
+
"displayName.ru-RU": "Менеджер асинхронных задач",
|
|
4
5
|
"displayName.zh-CN": "异步任务管理器",
|
|
5
6
|
"description": "Manage and monitor asynchronous tasks such as data import/export. Support task progress tracking and notification.",
|
|
7
|
+
"description.ru-RU": "Управление асинхронными задачами и мониторинг (например, импорт/экспорт данных). Поддержка отслеживания прогресса и уведомлений о задачах.",
|
|
6
8
|
"description.zh-CN": "管理和监控数据导入导出等异步任务。支持任务进度跟踪和通知。",
|
|
7
|
-
"version": "2.0.0-
|
|
9
|
+
"version": "2.0.0-beta.2",
|
|
8
10
|
"main": "dist/server/index.js",
|
|
9
11
|
"peerDependencies": {
|
|
10
12
|
"@nocobase/client": "2.x",
|
|
@@ -15,5 +17,5 @@
|
|
|
15
17
|
"dependencies": {
|
|
16
18
|
"p-queue": "^6.6.2"
|
|
17
19
|
},
|
|
18
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "b77a33ee933ae6e09d2d5dce017ca15d8552d57b"
|
|
19
21
|
}
|