@nger/fk-upload 1.0.190 → 1.0.193
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/entities/fk-download-task.entity.js +18 -0
- package/dist/templates/task-manage.js +17 -2
- package/dist/templates/tasks/actions.d.ts +1 -0
- package/dist/templates/tasks/actions.js +2 -1
- package/dist/templates/tasks/yasuo-task.d.ts +0 -0
- package/dist/templates/tasks/yasuo-task.js +0 -0
- package/package.json +2 -1
- package/pnpm-lock.yaml +2 -0
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FkDownloadTaskEntity = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const typeorm_1 = require("typeorm");
|
6
|
+
const rest_1 = require("@nger/rest");
|
6
7
|
let FkDownloadTaskEntity = class FkDownloadTaskEntity {
|
7
8
|
filename;
|
8
9
|
status;
|
@@ -22,16 +23,30 @@ let FkDownloadTaskEntity = class FkDownloadTaskEntity {
|
|
22
23
|
isBigFile;
|
23
24
|
};
|
24
25
|
tslib_1.__decorate([
|
26
|
+
(0, rest_1.Widget)({
|
27
|
+
title: '文件名'
|
28
|
+
}),
|
25
29
|
(0, typeorm_1.PrimaryColumn)(),
|
26
30
|
tslib_1.__metadata("design:type", String)
|
27
31
|
], FkDownloadTaskEntity.prototype, "filename", void 0);
|
28
32
|
tslib_1.__decorate([
|
33
|
+
(0, rest_1.Widget)({
|
34
|
+
title: '状态',
|
35
|
+
widget: {
|
36
|
+
type: 'status',
|
37
|
+
color: {},
|
38
|
+
label: {}
|
39
|
+
}
|
40
|
+
}),
|
29
41
|
(0, typeorm_1.Column)({
|
30
42
|
default: 0
|
31
43
|
}),
|
32
44
|
tslib_1.__metadata("design:type", Number)
|
33
45
|
], FkDownloadTaskEntity.prototype, "status", void 0);
|
34
46
|
tslib_1.__decorate([
|
47
|
+
(0, rest_1.Widget)({
|
48
|
+
title: '大小'
|
49
|
+
}),
|
35
50
|
(0, typeorm_1.Column)({
|
36
51
|
default: 0
|
37
52
|
}),
|
@@ -112,6 +127,9 @@ tslib_1.__decorate([
|
|
112
127
|
tslib_1.__metadata("design:type", Date)
|
113
128
|
], FkDownloadTaskEntity.prototype, "updateDate", void 0);
|
114
129
|
tslib_1.__decorate([
|
130
|
+
(0, rest_1.Widget)({
|
131
|
+
title: '大文件'
|
132
|
+
}),
|
115
133
|
(0, typeorm_1.Column)({
|
116
134
|
default: false
|
117
135
|
}),
|
@@ -81,6 +81,8 @@ let TaskManageController = class TaskManageController {
|
|
81
81
|
let psize = 10;
|
82
82
|
let status = -1;
|
83
83
|
let big = -1;
|
84
|
+
where.status = 0;
|
85
|
+
where.isBigFile = true;
|
84
86
|
if (query && typeof query.status !== 'undefined') {
|
85
87
|
status = Number(query.status);
|
86
88
|
if (status !== -1) {
|
@@ -158,9 +160,14 @@ let TaskManageController = class TaskManageController {
|
|
158
160
|
link: `/@nger/fk-upload/task-manage?${this.toUrl({ ...query, status: 3, page: 1 })}`,
|
159
161
|
key: 3
|
160
162
|
}];
|
161
|
-
const
|
163
|
+
const finishCallback = `/@nger/fk-upload/task-manage?${this.toUrl({
|
164
|
+
page: page,
|
165
|
+
psize: psize,
|
166
|
+
isBigFile: where.isBigFile ? 1 : 0,
|
167
|
+
status: where.status,
|
162
168
|
...query
|
163
169
|
})}`;
|
170
|
+
const finishUrl = (filename) => `/@nger/fk-upload/finish-task?filename=${filename}&callback=${encodeURIComponent(finishCallback)}`;
|
164
171
|
const logins = await this.db.manager.find(entities_1.FkLoginEntity, { where: {} });
|
165
172
|
const getLogin = (id) => {
|
166
173
|
return logins.find(it => it.fkLoginId = id);
|
@@ -261,7 +268,15 @@ let TaskManageController = class TaskManageController {
|
|
261
268
|
}
|
262
269
|
}
|
263
270
|
async finishTask(filename, callback, ctx) {
|
264
|
-
|
271
|
+
if (filename) {
|
272
|
+
const item = this.db.manager.findOne(entities_1.FkDownloadTaskEntity, { where: { filename } });
|
273
|
+
if (item) {
|
274
|
+
await this.db.manager.update(entities_1.FkDownloadTaskEntity, filename, { status: 3 });
|
275
|
+
}
|
276
|
+
else {
|
277
|
+
console.log({ filename, callback });
|
278
|
+
}
|
279
|
+
}
|
265
280
|
ctx.redirect(callback);
|
266
281
|
}
|
267
282
|
};
|
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.CHECK_ACTION = exports.EFFECT_ACTION = exports.UPLOAD_ACTION = exports.SCHEDULE_ACTION = exports.DOWNLOAD_ACTION = void 0;
|
3
|
+
exports.CHECK_ACTION = exports.EFFECT_ACTION = exports.YASUO_ACTION = exports.UPLOAD_ACTION = exports.SCHEDULE_ACTION = exports.DOWNLOAD_ACTION = void 0;
|
4
4
|
exports.DOWNLOAD_ACTION = `@nger/fk-upload/download-task`;
|
5
5
|
exports.SCHEDULE_ACTION = `@nger/fk-upload/schedule-task`;
|
6
6
|
exports.UPLOAD_ACTION = `@nger/fk-upload/upload-task`;
|
7
|
+
exports.YASUO_ACTION = `@nger/fk-upload/yasuo-task`;
|
7
8
|
exports.EFFECT_ACTION = `@nger/fk-upload/effect-task`;
|
8
9
|
exports.CHECK_ACTION = `@nger/fk-upload/check-task`;
|
File without changes
|
File without changes
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nger/fk-upload",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.193",
|
4
4
|
"description": "nger fk upload",
|
5
5
|
"main": "dist/electon.js",
|
6
6
|
"types": "dist/core.d.ts",
|
@@ -16,6 +16,7 @@
|
|
16
16
|
"dependencies": {
|
17
17
|
"@nger/api": "^1.0.0",
|
18
18
|
"@nger/core": "^1.0.0",
|
19
|
+
"@nger/rest": "^1.0.0",
|
19
20
|
"@nger/http": "^4.0.0",
|
20
21
|
"@nger/rabbitmq": "^1.0.0",
|
21
22
|
"@nger/redis": "^1.0.0",
|
package/pnpm-lock.yaml
CHANGED
@@ -6,6 +6,7 @@ specifiers:
|
|
6
6
|
'@nger/http': workspace:^4.0.0
|
7
7
|
'@nger/rabbitmq': workspace:^1.0.0
|
8
8
|
'@nger/redis': workspace:^1.0.0
|
9
|
+
'@nger/rest': workspace:^1.0.0
|
9
10
|
'@nger/schedule': workspace:^1.0.0
|
10
11
|
'@nger/typeorm': workspace:^1.0.0
|
11
12
|
'@nger/w7': workspace:^1.0.0
|
@@ -32,6 +33,7 @@ dependencies:
|
|
32
33
|
'@nger/http': link:../http
|
33
34
|
'@nger/rabbitmq': link:../rabbitmq
|
34
35
|
'@nger/redis': link:../redis
|
36
|
+
'@nger/rest': link:../rest
|
35
37
|
'@nger/schedule': link:../schedule
|
36
38
|
'@nger/typeorm': link:../typeorm
|
37
39
|
'@nger/w7': link:../w7
|