@whyour/qinglong 0.10.1 → 0.11.0
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/README-en.md +10 -0
- package/README.md +6 -0
- package/docker/front.conf +1 -1
- package/package.json +6 -6
- package/sample/notify.js +11 -1
- package/sample/notify.py +4 -0
- package/shell/otask.sh +1 -1
- package/shell/share.sh +19 -3
- package/shell/update.sh +7 -6
- package/static/build/api/cron.js +6 -0
- package/static/build/api/script.js +1 -1
- package/static/build/config/serverEnv.js +5 -2
- package/static/build/data/auth.js +2 -2
- package/static/build/data/cron.js +7 -1
- package/static/build/data/cronView.js +1 -1
- package/static/build/data/dependence.js +6 -6
- package/static/build/data/env.js +1 -1
- package/static/build/data/notify.js +3 -1
- package/static/build/data/subscription.js +1 -1
- package/static/build/loaders/db.js +12 -0
- package/static/build/protos/cron.js +97 -37
- package/static/build/protos/health.js +25 -30
- package/static/build/schedule/addCron.js +19 -11
- package/static/build/schedule/delCron.js +1 -1
- package/static/build/services/cron.js +23 -21
- package/static/build/services/notify.js +2 -2
- package/static/build/services/system.js +3 -3
- package/static/build/shared/pLimit.js +6 -6
- package/static/dist/1124.0d983222.async.js +1 -0
- package/static/dist/{4906.493cf3fd.async.js → 2393.4404a4fc.async.js} +1 -1
- package/static/dist/{8969.26b0efff.async.js → 3435.4a54080b.async.js} +1 -1
- package/static/dist/419.5de2a140.async.js +1 -0
- package/static/dist/7362.9fde9d80.async.js +1 -0
- package/static/dist/{8130.10d10b7d.async.js → 745.3be9ce9f.async.js} +1 -1
- package/static/dist/7987.5bace809.async.js +1 -0
- package/static/dist/8008.882bf214.async.js +1 -0
- package/static/dist/8078.4add9375.async.js +1 -0
- package/static/dist/833.ca85f497.async.js +1 -0
- package/static/dist/9120.ef78d517.async.js +1 -0
- package/static/dist/index.html +1 -1
- package/static/dist/layouts__index.0909c66d.chunk.css +1 -0
- package/static/dist/layouts__index.ed595716.async.js +1 -0
- package/static/dist/{src__pages__404.f77cf9a2.async.js → src__pages__404.e6b13931.async.js} +1 -1
- package/static/dist/src__pages__config__index.f41a22d4.async.js +1 -0
- package/static/dist/src__pages__crontab__detail.b4fc2995.async.js +1 -0
- package/static/dist/src__pages__crontab__index.a561edd9.async.js +1 -0
- package/static/dist/src__pages__crontab__logModal.0fb6d62d.async.js +1 -0
- package/static/dist/src__pages__crontab__modal.0b01490c.async.js +1 -0
- package/static/dist/{src__pages__crontab__type.bd5374bd.async.js → src__pages__crontab__type.a798cac7.async.js} +1 -1
- package/static/dist/src__pages__crontab__viewManageModal.67aa809d.async.js +1 -0
- package/static/dist/src__pages__dependence__index.1908bb39.async.js +1 -0
- package/static/dist/src__pages__dependence__logModal.8ecc9316.async.js +1 -0
- package/static/dist/src__pages__dependence__modal.9c12e6bb.async.js +1 -0
- package/static/dist/src__pages__diff__index.e23d088b.async.js +1 -0
- package/static/dist/src__pages__env__editNameModal.6f1edde6.async.js +1 -0
- package/static/dist/src__pages__env__index.3b08292e.async.js +1 -0
- package/static/dist/src__pages__env__modal.ca6133e6.async.js +1 -0
- package/static/dist/src__pages__error__index.0b4f4a22.async.js +1 -0
- package/static/dist/src__pages__initialization__index.51ebefcb.async.js +1 -0
- package/static/dist/src__pages__log__index.4010410c.async.js +1 -0
- package/static/dist/{src__pages__login__index.ce467c16.async.js → src__pages__login__index.8667d8d2.async.js} +1 -1
- package/static/dist/src__pages__script__editModal.b020a209.async.js +1 -0
- package/static/dist/src__pages__script__editNameModal.9220eb1a.async.js +1 -0
- package/static/dist/src__pages__script__index.6184a17e.async.js +1 -0
- package/static/dist/src__pages__script__renameModal.d6192fed.async.js +1 -0
- package/static/dist/src__pages__script__saveModal.eac5e9e7.async.js +1 -0
- package/static/dist/src__pages__script__setting.b958297b.async.js +1 -0
- package/static/dist/src__pages__setting__about.992010a5.async.js +1 -0
- package/static/dist/src__pages__setting__appModal.7563e7b0.async.js +1 -0
- package/static/dist/src__pages__setting__index.2aa66013.async.js +1 -0
- package/static/dist/{src__pages__setting__loginLog.4f883eb7.async.js → src__pages__setting__loginLog.2f2b0a78.async.js} +1 -1
- package/static/dist/src__pages__setting__notification.e8ce9bdc.async.js +1 -0
- package/static/dist/src__pages__setting__other.c6067975.async.js +1 -0
- package/static/dist/{src__pages__setting__progress.ab51bf0a.async.js → src__pages__setting__progress.f58bffae.async.js} +1 -1
- package/static/dist/src__pages__setting__security.cae5c68d.async.js +1 -0
- package/static/dist/src__pages__subscription__index.3266194c.async.js +1 -0
- package/static/dist/{src__pages__subscription__logModal.3037cb57.async.js → src__pages__subscription__logModal.a023b07e.async.js} +1 -1
- package/static/dist/src__pages__subscription__modal.49a1a657.async.js +1 -0
- package/static/dist/umi.dda034c1.js +1 -0
- package/version.yaml +10 -12
- package/static/dist/1925.b3032a5e.async.js +0 -1
- package/static/dist/3330.485d94a3.async.js +0 -1
- package/static/dist/3639.62f45f5e.async.js +0 -1
- package/static/dist/4618.cc1776f5.async.js +0 -1
- package/static/dist/4714.bbe9fae0.async.js +0 -1
- package/static/dist/8044.129359a6.async.js +0 -1
- package/static/dist/819.525cbfda.async.js +0 -1
- package/static/dist/layouts__index.20e4a8b2.async.js +0 -1
- package/static/dist/layouts__index.ddfcd364.chunk.css +0 -1
- package/static/dist/src__pages__config__index.fedea3f9.async.js +0 -1
- package/static/dist/src__pages__crontab__detail.ad4729f7.async.js +0 -1
- package/static/dist/src__pages__crontab__index.a82cfa81.async.js +0 -1
- package/static/dist/src__pages__crontab__logModal.ad170a0f.async.js +0 -1
- package/static/dist/src__pages__crontab__modal.696faf3d.async.js +0 -1
- package/static/dist/src__pages__crontab__viewManageModal.1bb04623.async.js +0 -1
- package/static/dist/src__pages__dependence__index.9f871d7e.async.js +0 -1
- package/static/dist/src__pages__dependence__logModal.b8dfb9bf.async.js +0 -1
- package/static/dist/src__pages__dependence__modal.77688c64.async.js +0 -1
- package/static/dist/src__pages__diff__index.73c27cfb.async.js +0 -1
- package/static/dist/src__pages__env__editNameModal.0b8b8511.async.js +0 -1
- package/static/dist/src__pages__env__index.c2e7f61a.async.js +0 -1
- package/static/dist/src__pages__env__modal.d4bcf3f1.async.js +0 -1
- package/static/dist/src__pages__error__index.9d76a461.async.js +0 -1
- package/static/dist/src__pages__initialization__index.7cb87ba4.async.js +0 -1
- package/static/dist/src__pages__log__index.8da82aea.async.js +0 -1
- package/static/dist/src__pages__script__editModal.dddd633e.async.js +0 -1
- package/static/dist/src__pages__script__editNameModal.159d0a29.async.js +0 -1
- package/static/dist/src__pages__script__index.123b12c6.async.js +0 -1
- package/static/dist/src__pages__script__renameModal.d4788f88.async.js +0 -1
- package/static/dist/src__pages__script__saveModal.f5fc2c94.async.js +0 -1
- package/static/dist/src__pages__script__setting.5004f9a6.async.js +0 -1
- package/static/dist/src__pages__setting__about.ef6f0636.async.js +0 -1
- package/static/dist/src__pages__setting__appModal.52ba0fb4.async.js +0 -1
- package/static/dist/src__pages__setting__index.ccb20d34.async.js +0 -1
- package/static/dist/src__pages__setting__notification.4f6be181.async.js +0 -1
- package/static/dist/src__pages__setting__other.ef42b461.async.js +0 -1
- package/static/dist/src__pages__setting__security.fed987f7.async.js +0 -1
- package/static/dist/src__pages__subscription__index.a434b6c5.async.js +0 -1
- package/static/dist/src__pages__subscription__modal.91d85c79.async.js +0 -1
- package/static/dist/umi.740bd8f7.js +0 -1
- /package/static/dist/{1095.59dcf306.chunk.css → 2182.59dcf306.chunk.css} +0 -0
- /package/static/dist/{8969.d2d0a2c7.chunk.css → 3435.d2d0a2c7.chunk.css} +0 -0
package/README-en.md
CHANGED
|
@@ -61,7 +61,12 @@ npm i @whyour/qinglong
|
|
|
61
61
|
# curl -sSL get.docker.com | sh
|
|
62
62
|
docker run -dit \
|
|
63
63
|
-v $PWD/ql/data:/ql/data \
|
|
64
|
+
# The 5700 after the colon is the default port, if QlPort is set, it needs to be the same as QlPort.
|
|
64
65
|
-p 5700:5700 \
|
|
66
|
+
# Deployment paths are not required and begin and end with a slash, e.g. /test/.
|
|
67
|
+
-e QlBaseUrl="/" \
|
|
68
|
+
# Deployment port is not required, when using host mode, you can set the port after service startup, default 5700
|
|
69
|
+
-e QlPort="5700" \
|
|
65
70
|
--name qinglong \
|
|
66
71
|
--hostname qinglong \
|
|
67
72
|
--restart unless-stopped \
|
|
@@ -88,7 +93,12 @@ docker-compose down
|
|
|
88
93
|
podman run -dit \
|
|
89
94
|
--network bridge \
|
|
90
95
|
-v $PWD/ql/data:/ql/data \
|
|
96
|
+
# The 5700 after the colon is the default port, if QlPort is set, it needs to be the same as QlPort.
|
|
91
97
|
-p 5700:5700 \
|
|
98
|
+
# Deployment paths are not required and begin and end with a slash, e.g. /test/.
|
|
99
|
+
-e QlBaseUrl="/" \
|
|
100
|
+
# Deployment port is not required, when using host mode, you can set the port after service startup, default 5700
|
|
101
|
+
-e QlPort="5700" \
|
|
92
102
|
--name qinglong \
|
|
93
103
|
--hostname qinglong \
|
|
94
104
|
docker.io/whyour/qinglong:latest
|
package/README.md
CHANGED
|
@@ -63,9 +63,12 @@ npm i @whyour/qinglong
|
|
|
63
63
|
# curl -sSL get.docker.com | sh
|
|
64
64
|
docker run -dit \
|
|
65
65
|
-v $PWD/ql/data:/ql/data \
|
|
66
|
+
# 冒号后面的 5700 为默认端口,如果设置了 QlPort, 需要跟 QlPort 保持一致
|
|
66
67
|
-p 5700:5700 \
|
|
67
68
|
# 部署路径非必须,以斜杠开头和结尾,比如 /test/
|
|
68
69
|
-e QlBaseUrl="/" \
|
|
70
|
+
# 部署端口非必须,当使用 host 模式时,可以设置服务启动后的端口,默认 5700
|
|
71
|
+
-e QlPort="5700" \
|
|
69
72
|
--name qinglong \
|
|
70
73
|
--hostname qinglong \
|
|
71
74
|
--restart unless-stopped \
|
|
@@ -92,9 +95,12 @@ docker-compose down
|
|
|
92
95
|
podman run -dit \
|
|
93
96
|
--network bridge \
|
|
94
97
|
-v $PWD/ql/data:/ql/data \
|
|
98
|
+
# 冒号后面的 5700 为默认端口,如果设置了 QlPort, 需要跟 QlPort 保持一致
|
|
95
99
|
-p 5700:5700 \
|
|
96
100
|
# 部署路径非必须,以斜杠开头和结尾,比如 /test/
|
|
97
101
|
-e QlBaseUrl="/" \
|
|
102
|
+
# 部署端口非必须,当使用 host 模式时,可以设置服务启动后的端口,默认 5700
|
|
103
|
+
-e QlPort="5700" \
|
|
98
104
|
--name qinglong \
|
|
99
105
|
--hostname qinglong \
|
|
100
106
|
docker.io/whyour/qinglong:latest
|
package/docker/front.conf
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whyour/qinglong",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"start": "concurrently -n w: npm:start:*",
|
|
16
16
|
"start:front": "max dev",
|
|
17
17
|
"start:back": "nodemon",
|
|
18
|
-
"start:public": "ts-node
|
|
19
|
-
"start:rpc": "ts-node
|
|
18
|
+
"start:public": "ts-node -P tsconfig.back.json ./back/public.ts",
|
|
19
|
+
"start:rpc": "ts-node -P tsconfig.back.json ./back/schedule/index.ts",
|
|
20
20
|
"build:front": "max build",
|
|
21
21
|
"build:back": "tsc -p tsconfig.back.json",
|
|
22
22
|
"panel": "npm run build:back && node static/build/app.js",
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
"dotenv": "^16.0.0",
|
|
86
86
|
"express": "^4.17.3",
|
|
87
87
|
"express-jwt": "^6.1.1",
|
|
88
|
-
"express-rate-limit": "^
|
|
88
|
+
"express-rate-limit": "^7.0.0",
|
|
89
89
|
"express-urlrewrite": "^1.4.0",
|
|
90
90
|
"form-data": "^4.0.0",
|
|
91
91
|
"got": "^11.8.2",
|
|
92
|
-
"hpagent": "^
|
|
92
|
+
"hpagent": "^1.2.0",
|
|
93
93
|
"http-proxy-middleware": "^2.0.6",
|
|
94
94
|
"iconv-lite": "^0.6.3",
|
|
95
95
|
"js-yaml": "^4.1.0",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"ts-proto": "^1.146.0",
|
|
179
179
|
"tslib": "^2.4.0",
|
|
180
180
|
"tsx": "^3.12.3",
|
|
181
|
-
"typescript": "
|
|
181
|
+
"typescript": "5.2.2",
|
|
182
182
|
"vh-check": "^2.0.5",
|
|
183
183
|
"virtualizedtableforantd4": "1.3.0",
|
|
184
184
|
"webpack": "^5.70.0",
|
package/sample/notify.js
CHANGED
|
@@ -55,6 +55,10 @@ let BARK_ICON = 'https://qn.whyour.cn/logo.png';
|
|
|
55
55
|
let BARK_SOUND = '';
|
|
56
56
|
//BARK app推送消息的分组, 默认为"QingLong"
|
|
57
57
|
let BARK_GROUP = 'QingLong';
|
|
58
|
+
//BARK app推送消息的时效性, 默认为"active"
|
|
59
|
+
let BARK_LEVEL = 'active';
|
|
60
|
+
//BARK app推送消息的跳转URL
|
|
61
|
+
let BARK_URL = '';
|
|
58
62
|
|
|
59
63
|
// =======================================telegram机器人通知设置区域===========================================
|
|
60
64
|
//此处填你telegram bot 的Token,telegram机器人通知推送必填项.例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw
|
|
@@ -211,6 +215,12 @@ if (process.env.BARK_PUSH) {
|
|
|
211
215
|
if (process.env.BARK_GROUP) {
|
|
212
216
|
BARK_GROUP = process.env.BARK_GROUP;
|
|
213
217
|
}
|
|
218
|
+
if (process.env.BARK_LEVEL) {
|
|
219
|
+
BARK_LEVEL = process.env.BARK_LEVEL;
|
|
220
|
+
}
|
|
221
|
+
if (process.env.BARK_URL) {
|
|
222
|
+
BARK_URL = process.env.BARK_URL;
|
|
223
|
+
}
|
|
214
224
|
} else {
|
|
215
225
|
if (
|
|
216
226
|
BARK_PUSH &&
|
|
@@ -552,7 +562,7 @@ function BarkNotify(text, desp, params = {}) {
|
|
|
552
562
|
const options = {
|
|
553
563
|
url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(
|
|
554
564
|
desp,
|
|
555
|
-
)}?icon=${BARK_ICON}&sound=${BARK_SOUND}&group=${BARK_GROUP}&${querystring.stringify(
|
|
565
|
+
)}?icon=${BARK_ICON}&sound=${BARK_SOUND}&group=${BARK_GROUP}&level=${BARK_LEVEL}&url=${BARK_URL}&${querystring.stringify(
|
|
556
566
|
params,
|
|
557
567
|
)}`,
|
|
558
568
|
headers: {
|
package/sample/notify.py
CHANGED
|
@@ -40,6 +40,8 @@ push_config = {
|
|
|
40
40
|
'BARK_GROUP': '', # bark 推送分组
|
|
41
41
|
'BARK_SOUND': '', # bark 推送声音
|
|
42
42
|
'BARK_ICON': '', # bark 推送图标
|
|
43
|
+
'BARK_LEVEL': '', # bark 推送时效性
|
|
44
|
+
'BARK_URL': '', # bark 推送跳转URL
|
|
43
45
|
|
|
44
46
|
'CONSOLE': True, # 控制台输出
|
|
45
47
|
|
|
@@ -130,6 +132,8 @@ def bark(title: str, content: str) -> None:
|
|
|
130
132
|
"BARK_GROUP": "group",
|
|
131
133
|
"BARK_SOUND": "sound",
|
|
132
134
|
"BARK_ICON": "icon",
|
|
135
|
+
"BARK_LEVEL": "level",
|
|
136
|
+
"BARK_URL": "url",
|
|
133
137
|
}
|
|
134
138
|
params = ""
|
|
135
139
|
for pair in filter(
|
package/shell/otask.sh
CHANGED
|
@@ -78,7 +78,7 @@ env_str_to_array() {
|
|
|
78
78
|
## 正常运行单个脚本,$1:传入参数
|
|
79
79
|
run_normal() {
|
|
80
80
|
local file_param=$1
|
|
81
|
-
if [[ $# -eq 1 ]] && [[ "$real_time" != "true" ]]; then
|
|
81
|
+
if [[ $# -eq 1 ]] && [[ "$real_time" != "true" ]] && [[ "$no_delay" != "true" ]]; then
|
|
82
82
|
random_delay "$file_param"
|
|
83
83
|
fi
|
|
84
84
|
|
package/shell/share.sh
CHANGED
|
@@ -74,6 +74,7 @@ import_config() {
|
|
|
74
74
|
[[ -f $file_env ]] && . $file_env
|
|
75
75
|
|
|
76
76
|
ql_base_url=${QlBaseUrl:-"/"}
|
|
77
|
+
ql_port=${QlPort:-"5700"}
|
|
77
78
|
command_timeout_time=${CommandTimeoutTime:-""}
|
|
78
79
|
proxy_url=${ProxyUrl:-""}
|
|
79
80
|
file_extensions=${RepoFileExtensions:-"js py"}
|
|
@@ -421,12 +422,15 @@ init_nginx() {
|
|
|
421
422
|
sed -i "s,QL_BASE_URL_LOCATION,${location_url},g" /etc/nginx/conf.d/front.conf
|
|
422
423
|
sed -i "s,QL_BASE_URL,${ql_base_url},g" /etc/nginx/conf.d/front.conf
|
|
423
424
|
|
|
424
|
-
ipv6=$(ip a | grep inet6)
|
|
425
|
-
ipv6Str=""
|
|
425
|
+
local ipv6=$(ip a | grep inet6)
|
|
426
|
+
local ipv6Str=""
|
|
426
427
|
if [[ $ipv6 ]]; then
|
|
427
|
-
ipv6Str="listen [::]
|
|
428
|
+
ipv6Str="listen [::]:${ql_port} ipv6only=on;"
|
|
428
429
|
fi
|
|
430
|
+
|
|
431
|
+
local ipv4Str="listen ${ql_port};"
|
|
429
432
|
sed -i "s,IPV6_CONFIG,${ipv6Str},g" /etc/nginx/conf.d/front.conf
|
|
433
|
+
sed -i "s,IPV4_CONFIG,${ipv4Str},g" /etc/nginx/conf.d/front.conf
|
|
430
434
|
}
|
|
431
435
|
|
|
432
436
|
handle_task_before() {
|
|
@@ -435,11 +439,23 @@ handle_task_before() {
|
|
|
435
439
|
echo -e "## 开始执行... $begin_time\n"
|
|
436
440
|
|
|
437
441
|
. $file_task_before "$@"
|
|
442
|
+
|
|
443
|
+
if [[ $task_before ]]; then
|
|
444
|
+
echo -e "执行前置命令\n"
|
|
445
|
+
eval "$task_before"
|
|
446
|
+
echo -e "\n执行前置命令结束\n"
|
|
447
|
+
fi
|
|
438
448
|
}
|
|
439
449
|
|
|
440
450
|
handle_task_after() {
|
|
441
451
|
. $file_task_after "$@"
|
|
442
452
|
|
|
453
|
+
if [[ $task_after ]]; then
|
|
454
|
+
echo -e "\n执行后置命令\n"
|
|
455
|
+
eval "$task_after"
|
|
456
|
+
echo -e "\n执行后置命令结束"
|
|
457
|
+
fi
|
|
458
|
+
|
|
443
459
|
local etime=$(date "+$time_format")
|
|
444
460
|
local end_time=$(format_time "$time_format" "$etime")
|
|
445
461
|
local end_timestamp=$(format_timestamp "$time_format" "$etime")
|
package/shell/update.sh
CHANGED
|
@@ -273,13 +273,13 @@ update_qinglong() {
|
|
|
273
273
|
exit_status=$?
|
|
274
274
|
|
|
275
275
|
if [[ $exit_status -eq 0 ]]; then
|
|
276
|
-
echo -e "
|
|
276
|
+
echo -e "更新青龙源文件成功...\n"
|
|
277
277
|
|
|
278
278
|
unzip -oq ${dir_tmp}/ql.zip -d ${dir_tmp}
|
|
279
279
|
|
|
280
280
|
update_qinglong_static
|
|
281
281
|
else
|
|
282
|
-
echo -e "
|
|
282
|
+
echo -e "更新青龙源文件失败,请检查网络...\n"
|
|
283
283
|
fi
|
|
284
284
|
}
|
|
285
285
|
|
|
@@ -288,28 +288,29 @@ update_qinglong_static() {
|
|
|
288
288
|
exit_status=$?
|
|
289
289
|
|
|
290
290
|
if [[ $exit_status -eq 0 ]]; then
|
|
291
|
-
echo -e "
|
|
291
|
+
echo -e "更新青龙静态资源成功...\n"
|
|
292
292
|
unzip -oq ${dir_tmp}/static.zip -d ${dir_tmp}
|
|
293
293
|
|
|
294
294
|
check_update_dep
|
|
295
295
|
else
|
|
296
|
-
echo -e "
|
|
296
|
+
echo -e "更新青龙静态资源失败,请检查网络...\n"
|
|
297
297
|
fi
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
check_update_dep() {
|
|
301
301
|
echo -e "\n开始检测依赖...\n"
|
|
302
|
-
if [[ $(diff $dir_sample/package.json $dir_scripts/package.json) ]]; then
|
|
302
|
+
if [[ ! -s $dir_scripts/package.json ]] || [[ $(diff $dir_sample/package.json $dir_scripts/package.json) ]]; then
|
|
303
303
|
cp -f $dir_sample/package.json $dir_scripts/package.json
|
|
304
304
|
npm_install_2 $dir_scripts
|
|
305
305
|
fi
|
|
306
|
+
|
|
306
307
|
if [[ $(diff $dir_root/package.json ${dir_tmp}/qinglong-${primary_branch}/package.json) ]]; then
|
|
307
308
|
npm_install_2 "${dir_tmp}/qinglong-${primary_branch}"
|
|
308
309
|
fi
|
|
309
310
|
|
|
310
311
|
if [[ $exit_status -eq 0 ]]; then
|
|
311
312
|
echo -e "\n依赖检测安装成功...\n"
|
|
312
|
-
echo -e "
|
|
313
|
+
echo -e "更新包下载成功..."
|
|
313
314
|
|
|
314
315
|
if [[ "$needRestart" == 'true' ]]; then
|
|
315
316
|
cp -rf ${dir_tmp}/qinglong-${primary_branch}/* ${dir_root}/
|
package/static/build/api/cron.js
CHANGED
|
@@ -147,6 +147,9 @@ exports.default = (app) => {
|
|
|
147
147
|
name: celebrate_1.Joi.string().optional(),
|
|
148
148
|
labels: celebrate_1.Joi.array().optional(),
|
|
149
149
|
sub_id: celebrate_1.Joi.number().optional().allow(null),
|
|
150
|
+
extra_schedules: celebrate_1.Joi.array().optional().allow(null),
|
|
151
|
+
task_before: celebrate_1.Joi.string().optional().allow('').allow(null),
|
|
152
|
+
task_after: celebrate_1.Joi.string().optional().allow('').allow(null),
|
|
150
153
|
}),
|
|
151
154
|
}), async (req, res, next) => {
|
|
152
155
|
const logger = typedi_1.Container.get('logger');
|
|
@@ -270,6 +273,9 @@ exports.default = (app) => {
|
|
|
270
273
|
schedule: celebrate_1.Joi.string().required(),
|
|
271
274
|
name: celebrate_1.Joi.string().optional().allow(null),
|
|
272
275
|
sub_id: celebrate_1.Joi.number().optional().allow(null),
|
|
276
|
+
extra_schedules: celebrate_1.Joi.array().optional().allow(null),
|
|
277
|
+
task_before: celebrate_1.Joi.string().optional().allow('').allow(null),
|
|
278
|
+
task_after: celebrate_1.Joi.string().optional().allow('').allow(null),
|
|
273
279
|
id: celebrate_1.Joi.number().required(),
|
|
274
280
|
}),
|
|
275
281
|
}), async (req, res, next) => {
|
|
@@ -51,7 +51,7 @@ exports.default = (app) => {
|
|
|
51
51
|
const logger = typedi_1.Container.get('logger');
|
|
52
52
|
try {
|
|
53
53
|
let result = [];
|
|
54
|
-
const blacklist = ['node_modules', '.git'];
|
|
54
|
+
const blacklist = ['node_modules', '.git', '.pnpm'];
|
|
55
55
|
if (req.query.path) {
|
|
56
56
|
const targetPath = path_1.default.join(config_1.default.scriptPath, req.query.path);
|
|
57
57
|
result = (0, util_1.readDir)(targetPath, config_1.default.scriptPath, blacklist);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.serveEnv = void 0;
|
|
4
|
-
const
|
|
7
|
+
const pick_1 = __importDefault(require("lodash/pick"));
|
|
5
8
|
let pickedEnv;
|
|
6
9
|
function getPickedEnv() {
|
|
7
10
|
if (pickedEnv)
|
|
8
11
|
return pickedEnv;
|
|
9
|
-
const picked = (0,
|
|
12
|
+
const picked = (0, pick_1.default)(process.env, ['QlBaseUrl', 'DeployEnv']);
|
|
10
13
|
pickedEnv = picked;
|
|
11
14
|
return picked;
|
|
12
15
|
}
|
|
@@ -16,7 +16,7 @@ var LoginStatus;
|
|
|
16
16
|
(function (LoginStatus) {
|
|
17
17
|
LoginStatus[LoginStatus["success"] = 0] = "success";
|
|
18
18
|
LoginStatus[LoginStatus["fail"] = 1] = "fail";
|
|
19
|
-
})(LoginStatus
|
|
19
|
+
})(LoginStatus || (exports.LoginStatus = LoginStatus = {}));
|
|
20
20
|
var AuthDataType;
|
|
21
21
|
(function (AuthDataType) {
|
|
22
22
|
AuthDataType["loginLog"] = "loginLog";
|
|
@@ -24,7 +24,7 @@ var AuthDataType;
|
|
|
24
24
|
AuthDataType["notification"] = "notification";
|
|
25
25
|
AuthDataType["removeLogFrequency"] = "removeLogFrequency";
|
|
26
26
|
AuthDataType["systemConfig"] = "systemConfig";
|
|
27
|
-
})(AuthDataType
|
|
27
|
+
})(AuthDataType || (exports.AuthDataType = AuthDataType = {}));
|
|
28
28
|
exports.AuthModel = _1.sequelize.define('Auth', {
|
|
29
29
|
ip: sequelize_1.DataTypes.STRING,
|
|
30
30
|
type: sequelize_1.DataTypes.STRING,
|
|
@@ -24,6 +24,9 @@ class Crontab {
|
|
|
24
24
|
this.last_running_time = options.last_running_time || 0;
|
|
25
25
|
this.last_execution_time = options.last_execution_time || 0;
|
|
26
26
|
this.sub_id = options.sub_id;
|
|
27
|
+
this.extra_schedules = options.extra_schedules;
|
|
28
|
+
this.task_before = options.task_before;
|
|
29
|
+
this.task_after = options.task_after;
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
exports.Crontab = Crontab;
|
|
@@ -33,7 +36,7 @@ var CrontabStatus;
|
|
|
33
36
|
CrontabStatus[CrontabStatus["queued"] = 0.5] = "queued";
|
|
34
37
|
CrontabStatus[CrontabStatus["idle"] = 1] = "idle";
|
|
35
38
|
CrontabStatus[CrontabStatus["disabled"] = 2] = "disabled";
|
|
36
|
-
})(CrontabStatus
|
|
39
|
+
})(CrontabStatus || (exports.CrontabStatus = CrontabStatus = {}));
|
|
37
40
|
exports.CrontabModel = _1.sequelize.define('Crontab', {
|
|
38
41
|
name: {
|
|
39
42
|
unique: 'compositeIndex',
|
|
@@ -59,5 +62,8 @@ exports.CrontabModel = _1.sequelize.define('Crontab', {
|
|
|
59
62
|
last_running_time: sequelize_1.DataTypes.NUMBER,
|
|
60
63
|
last_execution_time: sequelize_1.DataTypes.NUMBER,
|
|
61
64
|
sub_id: { type: sequelize_1.DataTypes.NUMBER, allowNull: true },
|
|
65
|
+
extra_schedules: sequelize_1.DataTypes.JSON,
|
|
66
|
+
task_before: sequelize_1.DataTypes.STRING,
|
|
67
|
+
task_after: sequelize_1.DataTypes.STRING,
|
|
62
68
|
});
|
|
63
69
|
//# sourceMappingURL=cron.js.map
|
|
@@ -7,7 +7,7 @@ var CronViewType;
|
|
|
7
7
|
(function (CronViewType) {
|
|
8
8
|
CronViewType[CronViewType["\u7CFB\u7EDF"] = 1] = "\u7CFB\u7EDF";
|
|
9
9
|
CronViewType[CronViewType["\u4E2A\u4EBA"] = 2] = "\u4E2A\u4EBA";
|
|
10
|
-
})(CronViewType
|
|
10
|
+
})(CronViewType || (exports.CronViewType = CronViewType = {}));
|
|
11
11
|
class CrontabView {
|
|
12
12
|
constructor(options) {
|
|
13
13
|
this.name = options.name;
|
|
@@ -27,37 +27,37 @@ var DependenceStatus;
|
|
|
27
27
|
DependenceStatus[DependenceStatus["removed"] = 4] = "removed";
|
|
28
28
|
DependenceStatus[DependenceStatus["removeFailed"] = 5] = "removeFailed";
|
|
29
29
|
DependenceStatus[DependenceStatus["queued"] = 6] = "queued";
|
|
30
|
-
})(DependenceStatus
|
|
30
|
+
})(DependenceStatus || (exports.DependenceStatus = DependenceStatus = {}));
|
|
31
31
|
var DependenceTypes;
|
|
32
32
|
(function (DependenceTypes) {
|
|
33
33
|
DependenceTypes[DependenceTypes["nodejs"] = 0] = "nodejs";
|
|
34
34
|
DependenceTypes[DependenceTypes["python3"] = 1] = "python3";
|
|
35
35
|
DependenceTypes[DependenceTypes["linux"] = 2] = "linux";
|
|
36
|
-
})(DependenceTypes
|
|
36
|
+
})(DependenceTypes || (exports.DependenceTypes = DependenceTypes = {}));
|
|
37
37
|
var InstallDependenceCommandTypes;
|
|
38
38
|
(function (InstallDependenceCommandTypes) {
|
|
39
39
|
InstallDependenceCommandTypes[InstallDependenceCommandTypes["pnpm add -g"] = 0] = "pnpm add -g";
|
|
40
40
|
InstallDependenceCommandTypes[InstallDependenceCommandTypes["pip3 install --disable-pip-version-check --root-user-action=ignore"] = 1] = "pip3 install --disable-pip-version-check --root-user-action=ignore";
|
|
41
41
|
InstallDependenceCommandTypes[InstallDependenceCommandTypes["apt install -y"] = 2] = "apt install -y";
|
|
42
|
-
})(InstallDependenceCommandTypes
|
|
42
|
+
})(InstallDependenceCommandTypes || (exports.InstallDependenceCommandTypes = InstallDependenceCommandTypes = {}));
|
|
43
43
|
var GetDependenceCommandTypes;
|
|
44
44
|
(function (GetDependenceCommandTypes) {
|
|
45
45
|
GetDependenceCommandTypes[GetDependenceCommandTypes["pnpm ls -g "] = 0] = "pnpm ls -g ";
|
|
46
46
|
GetDependenceCommandTypes[GetDependenceCommandTypes["pip3 show --disable-pip-version-check"] = 1] = "pip3 show --disable-pip-version-check";
|
|
47
47
|
GetDependenceCommandTypes[GetDependenceCommandTypes["apt info"] = 2] = "apt info";
|
|
48
|
-
})(GetDependenceCommandTypes
|
|
48
|
+
})(GetDependenceCommandTypes || (exports.GetDependenceCommandTypes = GetDependenceCommandTypes = {}));
|
|
49
49
|
var versionDependenceCommandTypes;
|
|
50
50
|
(function (versionDependenceCommandTypes) {
|
|
51
51
|
versionDependenceCommandTypes[versionDependenceCommandTypes["@"] = 0] = "@";
|
|
52
52
|
versionDependenceCommandTypes[versionDependenceCommandTypes["=="] = 1] = "==";
|
|
53
53
|
versionDependenceCommandTypes[versionDependenceCommandTypes["="] = 2] = "=";
|
|
54
|
-
})(versionDependenceCommandTypes
|
|
54
|
+
})(versionDependenceCommandTypes || (exports.versionDependenceCommandTypes = versionDependenceCommandTypes = {}));
|
|
55
55
|
var unInstallDependenceCommandTypes;
|
|
56
56
|
(function (unInstallDependenceCommandTypes) {
|
|
57
57
|
unInstallDependenceCommandTypes[unInstallDependenceCommandTypes["pnpm remove -g"] = 0] = "pnpm remove -g";
|
|
58
58
|
unInstallDependenceCommandTypes[unInstallDependenceCommandTypes["pip3 uninstall --disable-pip-version-check --root-user-action=ignore -y"] = 1] = "pip3 uninstall --disable-pip-version-check --root-user-action=ignore -y";
|
|
59
59
|
unInstallDependenceCommandTypes[unInstallDependenceCommandTypes["apt remove -y"] = 2] = "apt remove -y";
|
|
60
|
-
})(unInstallDependenceCommandTypes
|
|
60
|
+
})(unInstallDependenceCommandTypes || (exports.unInstallDependenceCommandTypes = unInstallDependenceCommandTypes = {}));
|
|
61
61
|
exports.DependenceModel = _1.sequelize.define('Dependence', {
|
|
62
62
|
name: sequelize_1.DataTypes.STRING,
|
|
63
63
|
type: sequelize_1.DataTypes.NUMBER,
|
package/static/build/data/env.js
CHANGED
|
@@ -22,7 +22,7 @@ var EnvStatus;
|
|
|
22
22
|
(function (EnvStatus) {
|
|
23
23
|
EnvStatus[EnvStatus["normal"] = 0] = "normal";
|
|
24
24
|
EnvStatus[EnvStatus["disabled"] = 1] = "disabled";
|
|
25
|
-
})(EnvStatus
|
|
25
|
+
})(EnvStatus || (exports.EnvStatus = EnvStatus = {}));
|
|
26
26
|
exports.maxPosition = 9000000000000000;
|
|
27
27
|
exports.initPosition = 4500000000000000;
|
|
28
28
|
exports.stepPosition = 10000000000;
|
|
@@ -20,7 +20,7 @@ var NotificationMode;
|
|
|
20
20
|
NotificationMode["pushMe"] = "pushMe";
|
|
21
21
|
NotificationMode["feishu"] = "feishu";
|
|
22
22
|
NotificationMode["webhook"] = "webhook";
|
|
23
|
-
})(NotificationMode
|
|
23
|
+
})(NotificationMode || (exports.NotificationMode = NotificationMode = {}));
|
|
24
24
|
class NotificationBaseInfo {
|
|
25
25
|
}
|
|
26
26
|
class GotifyNotification extends NotificationBaseInfo {
|
|
@@ -71,6 +71,8 @@ class BarkNotification extends NotificationBaseInfo {
|
|
|
71
71
|
this.barkIcon = 'https://qn.whyour.cn/logo.png';
|
|
72
72
|
this.barkSound = '';
|
|
73
73
|
this.barkGroup = 'qinglong';
|
|
74
|
+
this.barkLevel = 'active';
|
|
75
|
+
this.barkUrl = '';
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
exports.BarkNotification = BarkNotification;
|
|
@@ -41,7 +41,7 @@ var SubscriptionStatus;
|
|
|
41
41
|
SubscriptionStatus[SubscriptionStatus["idle"] = 1] = "idle";
|
|
42
42
|
SubscriptionStatus[SubscriptionStatus["disabled"] = 2] = "disabled";
|
|
43
43
|
SubscriptionStatus[SubscriptionStatus["queued"] = 3] = "queued";
|
|
44
|
-
})(SubscriptionStatus
|
|
44
|
+
})(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
|
|
45
45
|
exports.SubscriptionModel = _1.sequelize.define('Subscription', {
|
|
46
46
|
name: {
|
|
47
47
|
unique: 'compositeIndex',
|
|
@@ -50,6 +50,18 @@ exports.default = async () => {
|
|
|
50
50
|
await data_1.sequelize.query('alter table Crontabs add column sub_id NUMBER');
|
|
51
51
|
}
|
|
52
52
|
catch (error) { }
|
|
53
|
+
try {
|
|
54
|
+
await data_1.sequelize.query('alter table Crontabs add column extra_schedules JSON');
|
|
55
|
+
}
|
|
56
|
+
catch (error) { }
|
|
57
|
+
try {
|
|
58
|
+
await data_1.sequelize.query('alter table Crontabs add column task_before TEXT');
|
|
59
|
+
}
|
|
60
|
+
catch (error) { }
|
|
61
|
+
try {
|
|
62
|
+
await data_1.sequelize.query('alter table Crontabs add column task_after TEXT');
|
|
63
|
+
}
|
|
64
|
+
catch (error) { }
|
|
53
65
|
// 2.10-2.11 升级
|
|
54
66
|
const cronDbFile = path_1.default.join(config_1.default.rootPath, 'db/crontab.db');
|
|
55
67
|
const envDbFile = path_1.default.join(config_1.default.rootPath, 'db/env.db');
|