@whyour/qinglong 0.18.0 → 0.19.1
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/docker/docker-entrypoint.sh +0 -1
- package/package.json +1 -1
- package/sample/config.sample.sh +40 -9
- package/sample/notify.js +386 -507
- package/sample/notify.py +45 -4
- package/sample/ql_sample.js +11 -0
- package/sample/{test.py → ql_sample.py} +2 -0
- package/shell/share.sh +4 -29
- package/static/build/loaders/deps.js +5 -2
- package/static/build/services/cron.js +7 -4
- package/static/build/services/notify.js +37 -4
- package/static/build/services/script.js +5 -2
- package/static/build/services/system.js +2 -2
- package/static/build/shared/pLimit.js +8 -0
- package/static/dist/419.3db0078b.async.js +1 -0
- package/static/dist/833.2736fc54.async.js +1 -0
- package/static/dist/index.html +1 -1
- package/static/dist/src__pages__config__index.aac592a5.async.js +1 -0
- package/static/dist/src__pages__crontab__detail.f691fe2e.async.js +1 -0
- package/static/dist/src__pages__crontab__index.07741ece.async.js +1 -0
- package/static/dist/src__pages__crontab__index.5bbea517.chunk.css +1 -0
- package/static/dist/src__pages__crontab__modal.ad51946f.async.js +1 -0
- package/static/dist/src__pages__dependence__logModal.c5a14f52.async.js +1 -0
- package/static/dist/src__pages__dependence__modal.6c4464a7.async.js +1 -0
- package/static/dist/src__pages__env__editNameModal.95e1a409.async.js +1 -0
- package/static/dist/src__pages__env__modal.44744cbd.async.js +1 -0
- package/static/dist/src__pages__error__index.e57ca77b.async.js +1 -0
- package/static/dist/src__pages__initialization__index.77ae800f.async.js +1 -0
- package/static/dist/src__pages__script__editModal.3a322b87.async.js +1 -0
- package/static/dist/src__pages__script__editNameModal.47d0b164.async.js +1 -0
- package/static/dist/src__pages__script__index.64391ed8.async.js +1 -0
- package/static/dist/src__pages__script__renameModal.13cccb93.async.js +1 -0
- package/static/dist/src__pages__script__saveModal.11771975.async.js +1 -0
- package/static/dist/src__pages__script__setting.45f668a1.async.js +1 -0
- package/static/dist/src__pages__setting__appModal.b8c9bd3c.async.js +1 -0
- package/static/dist/src__pages__setting__dependence.a3fd86f3.async.js +1 -0
- package/static/dist/{src__pages__setting__index.7ab054fb.async.js → src__pages__setting__index.a98235ab.async.js} +1 -1
- package/static/dist/src__pages__setting__notification.38ed438e.async.js +1 -0
- package/static/dist/src__pages__setting__security.c11b8cbe.async.js +1 -0
- package/static/dist/src__pages__subscription__modal.55630242.async.js +1 -0
- package/static/dist/{umi.11c81ea6.js → umi.35a4566e.js} +1 -1
- package/version.yaml +8 -10
- package/sample/test.js +0 -8
- package/static/dist/419.71c3c9c2.async.js +0 -1
- package/static/dist/833.ea0fd669.async.js +0 -1
- package/static/dist/src__pages__config__index.634c902a.async.js +0 -1
- package/static/dist/src__pages__crontab__detail.a2bfd72a.async.js +0 -1
- package/static/dist/src__pages__crontab__index.73fc56e9.chunk.css +0 -1
- package/static/dist/src__pages__crontab__index.98d464c0.async.js +0 -1
- package/static/dist/src__pages__crontab__modal.5f353876.async.js +0 -1
- package/static/dist/src__pages__dependence__logModal.baba01d6.async.js +0 -1
- package/static/dist/src__pages__dependence__modal.663609bb.async.js +0 -1
- package/static/dist/src__pages__env__editNameModal.64e264d4.async.js +0 -1
- package/static/dist/src__pages__env__modal.ee1dbbc7.async.js +0 -1
- package/static/dist/src__pages__error__index.388743c5.async.js +0 -1
- package/static/dist/src__pages__initialization__index.b522cc95.async.js +0 -1
- package/static/dist/src__pages__script__editModal.1822dae7.async.js +0 -1
- package/static/dist/src__pages__script__editNameModal.3eabdcdb.async.js +0 -1
- package/static/dist/src__pages__script__index.8d14185b.async.js +0 -1
- package/static/dist/src__pages__script__renameModal.8bbbc126.async.js +0 -1
- package/static/dist/src__pages__script__saveModal.2012fa2c.async.js +0 -1
- package/static/dist/src__pages__script__setting.0daecd62.async.js +0 -1
- package/static/dist/src__pages__setting__appModal.476d1f54.async.js +0 -1
- package/static/dist/src__pages__setting__dependence.28193e94.async.js +0 -1
- package/static/dist/src__pages__setting__notification.dd201d2a.async.js +0 -1
- package/static/dist/src__pages__setting__security.dbfad79b.async.js +0 -1
- package/static/dist/src__pages__subscription__modal.69a7f91a.async.js +0 -1
package/sample/notify.py
CHANGED
|
@@ -33,7 +33,7 @@ def print(text, *args, **kw):
|
|
|
33
33
|
# 通知服务
|
|
34
34
|
# fmt: off
|
|
35
35
|
push_config = {
|
|
36
|
-
'HITOKOTO':
|
|
36
|
+
'HITOKOTO': True, # 启用一言(随机句子)
|
|
37
37
|
|
|
38
38
|
'BARK_PUSH': '', # bark IP 或设备码,例:https://api.day.app/DxHcxxxxxRxxxxxxcm/
|
|
39
39
|
'BARK_ARCHIVE': '', # bark 推送是否存档
|
|
@@ -43,7 +43,7 @@ push_config = {
|
|
|
43
43
|
'BARK_LEVEL': '', # bark 推送时效性
|
|
44
44
|
'BARK_URL': '', # bark 推送跳转URL
|
|
45
45
|
|
|
46
|
-
'CONSOLE':
|
|
46
|
+
'CONSOLE': False, # 控制台输出
|
|
47
47
|
|
|
48
48
|
'DD_BOT_SECRET': '', # 钉钉机器人的 DD_BOT_SECRET
|
|
49
49
|
'DD_BOT_TOKEN': '', # 钉钉机器人的 DD_BOT_TOKEN
|
|
@@ -75,6 +75,10 @@ push_config = {
|
|
|
75
75
|
'PUSH_PLUS_TOKEN': '', # push+ 微信推送的用户令牌
|
|
76
76
|
'PUSH_PLUS_USER': '', # push+ 微信推送的群组编码
|
|
77
77
|
|
|
78
|
+
'WE_PLUS_BOT_TOKEN': '', # 微加机器人的用户令牌
|
|
79
|
+
'WE_PLUS_BOT_RECEIVER': '', # 微加机器人的消息接收者
|
|
80
|
+
'WE_PLUS_BOT_VERSION': 'pro', # 微加机器人的调用版本
|
|
81
|
+
|
|
78
82
|
'QMSG_KEY': '', # qmsg 酱的 QMSG_KEY
|
|
79
83
|
'QMSG_TYPE': '', # qmsg 酱的 QMSG_TYPE
|
|
80
84
|
|
|
@@ -101,7 +105,8 @@ push_config = {
|
|
|
101
105
|
'SMTP_PASSWORD': '', # SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定
|
|
102
106
|
'SMTP_NAME': '', # SMTP 收发件人姓名,可随意填写
|
|
103
107
|
|
|
104
|
-
'PUSHME_KEY': '', # PushMe
|
|
108
|
+
'PUSHME_KEY': '', # PushMe 的 PUSHME_KEY
|
|
109
|
+
'PUSHME_URL': '', # PushMe 的 PUSHME_URL
|
|
105
110
|
|
|
106
111
|
'CHRONOCAT_QQ': '', # qq号
|
|
107
112
|
'CHRONOCAT_TOKEN': '', # CHRONOCAT 的token
|
|
@@ -380,6 +385,37 @@ def pushplus_bot(title: str, content: str) -> None:
|
|
|
380
385
|
else:
|
|
381
386
|
print("PUSHPLUS 推送失败!")
|
|
382
387
|
|
|
388
|
+
def weplus_bot(title: str, content: str) -> None:
|
|
389
|
+
"""
|
|
390
|
+
通过 微加机器人 推送消息。
|
|
391
|
+
"""
|
|
392
|
+
if not push_config.get("WE_PLUS_BOT_TOKEN"):
|
|
393
|
+
print("微加机器人 服务的 WE_PLUS_BOT_TOKEN 未设置!!\n取消推送")
|
|
394
|
+
return
|
|
395
|
+
print("微加机器人 服务启动")
|
|
396
|
+
|
|
397
|
+
template = "txt"
|
|
398
|
+
if len(content) > 800:
|
|
399
|
+
template = "html"
|
|
400
|
+
|
|
401
|
+
url = "https://www.weplusbot.com/send"
|
|
402
|
+
data = {
|
|
403
|
+
"token": push_config.get("WE_PLUS_BOT_TOKEN"),
|
|
404
|
+
"title": title,
|
|
405
|
+
"content": content,
|
|
406
|
+
"template": template,
|
|
407
|
+
"receiver": push_config.get("WE_PLUS_BOT_RECEIVER"),
|
|
408
|
+
"version": push_config.get("WE_PLUS_BOT_VERSION"),
|
|
409
|
+
}
|
|
410
|
+
body = json.dumps(data).encode(encoding="utf-8")
|
|
411
|
+
headers = {"Content-Type": "application/json"}
|
|
412
|
+
response = requests.post(url=url, data=body, headers=headers).json()
|
|
413
|
+
|
|
414
|
+
if response["code"] == 200:
|
|
415
|
+
print("微加机器人 推送成功!")
|
|
416
|
+
else:
|
|
417
|
+
print("微加机器人 推送失败!")
|
|
418
|
+
|
|
383
419
|
|
|
384
420
|
def qmsg_bot(title: str, content: str) -> None:
|
|
385
421
|
"""
|
|
@@ -668,10 +704,13 @@ def pushme(title: str, content: str) -> None:
|
|
|
668
704
|
return
|
|
669
705
|
print("PushMe 服务启动")
|
|
670
706
|
|
|
671
|
-
url =
|
|
707
|
+
url = push_config.get("PUSHME_URL") if push_config.get("PUSHME_URL") else "https://push.i-i.me/"
|
|
672
708
|
data = {
|
|
709
|
+
"push_key": push_config.get("PUSHME_KEY"),
|
|
673
710
|
"title": title,
|
|
674
711
|
"content": content,
|
|
712
|
+
"date": push_config.get("date") if push_config.get("date") else "",
|
|
713
|
+
"type": push_config.get("type") if push_config.get("type") else "",
|
|
675
714
|
}
|
|
676
715
|
response = requests.post(url, data=data)
|
|
677
716
|
|
|
@@ -854,6 +893,8 @@ def add_notify_function():
|
|
|
854
893
|
notify_function.append(chat)
|
|
855
894
|
if push_config.get("PUSH_PLUS_TOKEN"):
|
|
856
895
|
notify_function.append(pushplus_bot)
|
|
896
|
+
if push_config.get("WE_PLUS_BOT_TOKEN"):
|
|
897
|
+
notify_function.append(weplus_bot)
|
|
857
898
|
if push_config.get("QMSG_KEY") and push_config.get("QMSG_TYPE"):
|
|
858
899
|
notify_function.append(qmsg_bot)
|
|
859
900
|
if push_config.get("QYWX_AM"):
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 任务名称
|
|
3
|
+
* name: script name
|
|
4
|
+
* 定时规则
|
|
5
|
+
* cron: 1 9 * * *
|
|
6
|
+
*/
|
|
7
|
+
const { sendNotify } = require('./sendNotify.js'); // commonjs
|
|
8
|
+
// import { sendNotify } from './sendNotify'; // es6
|
|
9
|
+
|
|
10
|
+
console.log('test scripts');
|
|
11
|
+
sendNotify('test scripts', 'test desc');
|
package/shell/share.sh
CHANGED
|
@@ -38,12 +38,12 @@ file_task_sample=$dir_sample/task.sample.sh
|
|
|
38
38
|
file_extra_sample=$dir_sample/extra.sample.sh
|
|
39
39
|
file_notify_js_sample=$dir_sample/notify.js
|
|
40
40
|
file_notify_py_sample=$dir_sample/notify.py
|
|
41
|
-
file_test_js_sample=$dir_sample/
|
|
42
|
-
file_test_py_sample=$dir_sample/
|
|
41
|
+
file_test_js_sample=$dir_sample/ql_sample.js
|
|
42
|
+
file_test_py_sample=$dir_sample/ql_sample.py
|
|
43
43
|
file_notify_py=$dir_scripts/notify.py
|
|
44
44
|
file_notify_js=$dir_scripts/sendNotify.js
|
|
45
|
-
file_test_js=$dir_scripts/
|
|
46
|
-
file_test_py=$dir_scripts/
|
|
45
|
+
file_test_js=$dir_scripts/ql_sample.js
|
|
46
|
+
file_test_py=$dir_scripts/ql_sample.py
|
|
47
47
|
nginx_app_conf=$dir_root/docker/front.conf
|
|
48
48
|
nginx_conf=$dir_root/docker/nginx.conf
|
|
49
49
|
dep_notify_py=$dir_dep/notify.py
|
|
@@ -134,31 +134,6 @@ gen_random_num() {
|
|
|
134
134
|
echo $((${RANDOM} % $divi))
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
link_shell_sub() {
|
|
138
|
-
local link_path="$1"
|
|
139
|
-
local original_path="$2"
|
|
140
|
-
if [[ ! -L $link_path ]] || [[ $(readlink -f $link_path) != $original_path ]]; then
|
|
141
|
-
rm -f $link_path 2>/dev/null
|
|
142
|
-
ln -sf $original_path $link_path
|
|
143
|
-
fi
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
link_shell() {
|
|
147
|
-
if [[ $is_termux -eq 1 ]]; then
|
|
148
|
-
local path="/data/data/com.termux/files/usr/bin/"
|
|
149
|
-
elif [[ $PATH == */usr/local/bin* ]] && [[ -d /usr/local/bin ]]; then
|
|
150
|
-
local path="/usr/local/bin/"
|
|
151
|
-
else
|
|
152
|
-
local path=""
|
|
153
|
-
echo -e "脚本功能受限,请自行添加命令的软连接...\n"
|
|
154
|
-
fi
|
|
155
|
-
if [[ $path ]]; then
|
|
156
|
-
for ((i = 0; i < ${#link_name[*]}; i++)); do
|
|
157
|
-
link_shell_sub "$path${link_name[i]}" "$dir_shell/${original_name[i]}"
|
|
158
|
-
done
|
|
159
|
-
fi
|
|
160
|
-
}
|
|
161
|
-
|
|
162
137
|
define_cmd() {
|
|
163
138
|
local cmd_prefix cmd_suffix
|
|
164
139
|
if type task &>/dev/null; then
|
|
@@ -26,17 +26,20 @@ async function linkCommand() {
|
|
|
26
26
|
{
|
|
27
27
|
src: 'update.sh',
|
|
28
28
|
dest: 'ql',
|
|
29
|
+
tmp: 'ql_tmp',
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
src: 'task.sh',
|
|
32
33
|
dest: 'task',
|
|
34
|
+
tmp: 'task_tmp',
|
|
33
35
|
},
|
|
34
36
|
];
|
|
35
37
|
for (const link of linkShell) {
|
|
36
38
|
const source = path_1.default.join(index_1.default.rootPath, 'shell', link.src);
|
|
37
39
|
const target = path_1.default.join(commandDir, link.dest);
|
|
38
|
-
|
|
39
|
-
await promises_1.default.symlink(source,
|
|
40
|
+
const tmpTarget = path_1.default.join(commandDir, link.tmp);
|
|
41
|
+
await promises_1.default.symlink(source, tmpTarget);
|
|
42
|
+
await promises_1.default.rename(tmpTarget, target);
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
exports.default = async (src = 'deps') => {
|
|
@@ -346,7 +346,7 @@ let CronService = class CronService {
|
|
|
346
346
|
await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid: undefined }, { where: { id: ids } });
|
|
347
347
|
}
|
|
348
348
|
async runSingle(cronId) {
|
|
349
|
-
return pLimit_1.default.
|
|
349
|
+
return pLimit_1.default.manualRunWithCronLimit(() => {
|
|
350
350
|
return new Promise(async (resolve) => {
|
|
351
351
|
var _a;
|
|
352
352
|
const cron = await this.getDb({ id: cronId });
|
|
@@ -370,13 +370,16 @@ let CronService = class CronService {
|
|
|
370
370
|
}
|
|
371
371
|
const logPath = `${uniqPath}/${logTime}.log`;
|
|
372
372
|
const absolutePath = path_1.default.resolve(config_1.default.logPath, `${logPath}`);
|
|
373
|
-
const cp = (0, cross_spawn_1.spawn)(`real_log_path=${logPath} no_delay=true ${this.makeCommand(cron)}`, { shell: '/bin/bash' });
|
|
373
|
+
const cp = (0, cross_spawn_1.spawn)(`real_log_path=${logPath} real_time=true no_delay=true ${this.makeCommand(cron)}`, { shell: '/bin/bash' });
|
|
374
374
|
await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.running, pid: cp.pid, log_path: logPath }, { where: { id } });
|
|
375
|
+
cp.stdout.on('data', async (data) => {
|
|
376
|
+
await promises_1.default.appendFile(absolutePath, data.toString());
|
|
377
|
+
});
|
|
375
378
|
cp.stderr.on('data', async (data) => {
|
|
376
|
-
await promises_1.default.appendFile(
|
|
379
|
+
await promises_1.default.appendFile(absolutePath, data.toString());
|
|
377
380
|
});
|
|
378
381
|
cp.on('error', async (err) => {
|
|
379
|
-
await promises_1.default.appendFile(
|
|
382
|
+
await promises_1.default.appendFile(absolutePath, JSON.stringify(err));
|
|
380
383
|
});
|
|
381
384
|
cp.on('exit', async (code) => {
|
|
382
385
|
await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid: undefined }, { where: { id } });
|
|
@@ -51,6 +51,7 @@ let NotificationService = class NotificationService {
|
|
|
51
51
|
['aibotk', this.aibotk],
|
|
52
52
|
['iGot', this.iGot],
|
|
53
53
|
['pushPlus', this.pushPlus],
|
|
54
|
+
['wePlusBot', this.wePlusBot],
|
|
54
55
|
['email', this.email],
|
|
55
56
|
['pushMe', this.pushMe],
|
|
56
57
|
['webhook', this.webhook],
|
|
@@ -185,11 +186,11 @@ let NotificationService = class NotificationService {
|
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
async bark() {
|
|
188
|
-
let { barkPush, barkIcon, barkSound, barkGroup, barkLevel, barkUrl } = this.params;
|
|
189
|
+
let { barkPush, barkIcon = '', barkSound = '', barkGroup = '', barkLevel = '', barkUrl = '', barkArchive = '', } = this.params;
|
|
189
190
|
if (!barkPush.startsWith('http')) {
|
|
190
191
|
barkPush = `https://api.day.app/${barkPush}`;
|
|
191
192
|
}
|
|
192
|
-
const url = `${barkPush}/${encodeURIComponent(this.title)}/${encodeURIComponent(this.content)}?icon=${barkIcon}&sound=${barkSound}&group=${barkGroup}&level=${barkLevel}&url=${barkUrl}`;
|
|
193
|
+
const url = `${barkPush}/${encodeURIComponent(this.title)}/${encodeURIComponent(this.content)}?icon=${barkIcon}&sound=${barkSound}&group=${barkGroup}&level=${barkLevel}&url=${barkUrl}&isArchive=${barkArchive}`;
|
|
193
194
|
try {
|
|
194
195
|
const res = await got_1.default
|
|
195
196
|
.get(url, Object.assign(Object.assign({}, this.gotOption), { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }))
|
|
@@ -440,6 +441,37 @@ let NotificationService = class NotificationService {
|
|
|
440
441
|
throw new Error(error.response ? error.response.body : error);
|
|
441
442
|
}
|
|
442
443
|
}
|
|
444
|
+
async wePlusBot() {
|
|
445
|
+
const { wePlusBotToken, wePlusBotReceiver, wePlusBotVersion } = this.params;
|
|
446
|
+
let content = this.content;
|
|
447
|
+
let template = 'txt';
|
|
448
|
+
if (this.content.length > 800) {
|
|
449
|
+
template = 'html';
|
|
450
|
+
content = content.replace(/[\n\r]/g, '<br>');
|
|
451
|
+
}
|
|
452
|
+
const url = `https://www.weplusbot.com/send`;
|
|
453
|
+
try {
|
|
454
|
+
const res = await got_1.default
|
|
455
|
+
.post(url, Object.assign(Object.assign({}, this.gotOption), { json: {
|
|
456
|
+
token: `${wePlusBotToken}`,
|
|
457
|
+
title: `${this.title}`,
|
|
458
|
+
template: `${template}`,
|
|
459
|
+
content: `${content}`,
|
|
460
|
+
receiver: `${wePlusBotReceiver || ''}`,
|
|
461
|
+
version: `${wePlusBotVersion || 'pro'}`,
|
|
462
|
+
} }))
|
|
463
|
+
.json();
|
|
464
|
+
if (res.code === 200) {
|
|
465
|
+
return true;
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
throw new Error(JSON.stringify(res));
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
catch (error) {
|
|
472
|
+
throw new Error(error.response ? error.response.body : error);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
443
475
|
async lark() {
|
|
444
476
|
let { larkKey } = this.params;
|
|
445
477
|
if (!larkKey.startsWith('http')) {
|
|
@@ -492,9 +524,10 @@ let NotificationService = class NotificationService {
|
|
|
492
524
|
}
|
|
493
525
|
}
|
|
494
526
|
async pushMe() {
|
|
495
|
-
const { pushMeKey } = this.params;
|
|
527
|
+
const { pushMeKey, pushMeUrl } = this.params;
|
|
496
528
|
try {
|
|
497
|
-
const res = await got_1.default.post(
|
|
529
|
+
const res = await got_1.default.post(pushMeUrl || 'https://push.i-i.me/', Object.assign(Object.assign({}, this.gotOption), { json: {
|
|
530
|
+
push_key: pushMeKey,
|
|
498
531
|
title: this.title,
|
|
499
532
|
content: this.content,
|
|
500
533
|
}, headers: { 'Content-Type': 'application/json' } }));
|
|
@@ -76,7 +76,7 @@ let ScriptService = class ScriptService {
|
|
|
76
76
|
async runScript(filePath) {
|
|
77
77
|
const relativePath = path_1.default.relative(config_1.default.scriptPath, filePath);
|
|
78
78
|
const command = `${const_1.TASK_COMMAND} ${relativePath} now`;
|
|
79
|
-
const pid = await this.scheduleService.runTask(command
|
|
79
|
+
const pid = await this.scheduleService.runTask(`real_time=true ${command}`, this.taskCallbacks(filePath), { command }, 'start');
|
|
80
80
|
return { code: 200, data: pid };
|
|
81
81
|
}
|
|
82
82
|
async stopScript(filePath, pid) {
|
|
@@ -91,7 +91,10 @@ let ScriptService = class ScriptService {
|
|
|
91
91
|
return { code: 200 };
|
|
92
92
|
}
|
|
93
93
|
async getFile(filePath, fileName) {
|
|
94
|
-
|
|
94
|
+
let _filePath = (0, path_1.join)(config_1.default.scriptPath, filePath, fileName);
|
|
95
|
+
if (filePath.startsWith(config_1.default.dataPath)) {
|
|
96
|
+
_filePath = (0, path_1.join)(filePath, fileName);
|
|
97
|
+
}
|
|
95
98
|
const content = await (0, util_1.getFileContentByName)(_filePath);
|
|
96
99
|
return content;
|
|
97
100
|
}
|
|
@@ -272,11 +272,11 @@ let SystemService = class SystemService {
|
|
|
272
272
|
return { code: 400, message: '通知发送失败,请检查系统设置/通知配置' };
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
async run({ command
|
|
275
|
+
async run({ command }, callback) {
|
|
276
276
|
if (!command.startsWith(const_1.TASK_COMMAND)) {
|
|
277
277
|
command = `${const_1.TASK_COMMAND} ${command}`;
|
|
278
278
|
}
|
|
279
|
-
this.scheduleService.runTask(`
|
|
279
|
+
this.scheduleService.runTask(`real_time=true ${command}`, callback, {
|
|
280
280
|
command,
|
|
281
281
|
});
|
|
282
282
|
}
|
|
@@ -24,6 +24,9 @@ class TaskLimit {
|
|
|
24
24
|
this.cronLimit = new p_queue_cjs_1.default({
|
|
25
25
|
concurrency: Math.max(os_1.default.cpus().length, 4),
|
|
26
26
|
});
|
|
27
|
+
this.manualCronoLimit = new p_queue_cjs_1.default({
|
|
28
|
+
concurrency: Math.max(os_1.default.cpus().length, 4),
|
|
29
|
+
});
|
|
27
30
|
this.setCustomLimit();
|
|
28
31
|
this.handleEvents();
|
|
29
32
|
}
|
|
@@ -56,6 +59,7 @@ class TaskLimit {
|
|
|
56
59
|
var _a;
|
|
57
60
|
if (limit) {
|
|
58
61
|
this.cronLimit.concurrency = limit;
|
|
62
|
+
this.manualCronoLimit.concurrency = limit;
|
|
59
63
|
return;
|
|
60
64
|
}
|
|
61
65
|
await system_1.SystemModel.sync();
|
|
@@ -64,11 +68,15 @@ class TaskLimit {
|
|
|
64
68
|
});
|
|
65
69
|
if ((_a = doc === null || doc === void 0 ? void 0 : doc.info) === null || _a === void 0 ? void 0 : _a.cronConcurrency) {
|
|
66
70
|
this.cronLimit.concurrency = doc.info.cronConcurrency;
|
|
71
|
+
this.manualCronoLimit.concurrency = doc.info.cronConcurrency;
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
async runWithCronLimit(fn, options) {
|
|
70
75
|
return this.cronLimit.add(fn, options);
|
|
71
76
|
}
|
|
77
|
+
async manualRunWithCronLimit(fn, options) {
|
|
78
|
+
return this.manualCronoLimit.add(fn, options);
|
|
79
|
+
}
|
|
72
80
|
runDependeny(dependency, fn, options) {
|
|
73
81
|
this.queuedDependencyIds.add(dependency.id);
|
|
74
82
|
fn.dependency = dependency;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[419,5812],{38582:function(e,t,a){var r=(0,a(55258).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_lc939gab1iq.js"]});t.Z=r},91350:function(e,t,a){a.r(t),a.d(t,{CrontabStatus:function(){return r},OperationName:function(){return l},OperationPath:function(){return n}});var r=function(e){return e[e.running=0]="running",e[e.queued=.5]="queued",e[e.idle=1]="idle",e[e.disabled=2]="disabled",e}({}),l=function(e){return e[e["启用"]=0]="启用",e[e["禁用"]=1]="禁用",e[e["运行"]=2]="运行",e[e["停止"]=3]="停止",e[e["置顶"]=4]="置顶",e[e["取消置顶"]=5]="取消置顶",e}({}),n=function(e){return e[e.enable=0]="enable",e[e.disable=1]="disable",e[e.run=2]="run",e[e.stop=3]="stop",e[e.pin=4]="pin",e[e.unpin=5]="unpin",e}({})},10419:function(e,t,a){a.r(t);var r=a(12342),l=a.n(r),n=a(25359),i=a.n(n),o=a(57213),s=a.n(o),u=a(49811),c=a.n(u),p=a(54306),g=a.n(p),d=a(88265),h=a(63313),m=a(67393),Z=a(28756),P=a(84163),b=a(22159),v=a(24378),f=a(2947),x=a(57229),y=a(15207),k=a(32320),w=a(26839),q=a(38582),j=a(91350),B=a(19631),C=a(11527),_=["name"],S=["key","name"],R=["key","name"],I=[{name:d.ZP.get("命令"),value:"command"},{name:d.ZP.get("名称"),value:"name"},{name:d.ZP.get("定时规则"),value:"schedule"},{name:d.ZP.get("状态"),value:"status",onlySelect:!0},{name:d.ZP.get("标签"),value:"labels"},{name:d.ZP.get("订阅"),value:"sub_id",onlySelect:!0}],K={Reg:"",NotReg:"",In:"select",Nin:"select"},T=[{name:d.ZP.get("包含"),value:"Reg"},{name:d.ZP.get("不包含"),value:"NotReg"},{name:d.ZP.get("属于"),value:"In",type:"select"},{name:d.ZP.get("不属于"),value:"Nin",type:"select"}],U=[{name:d.ZP.get("顺序"),value:"ASC"},{name:d.ZP.get("倒序"),value:"DESC"}],A=function(e){return e.and="且",e.or="或",e}(A||{});t.default=function(e){var t=e.view,a=e.handleCancel,r=e.visible,n=m.Z.useForm(),o=g()(n,1)[0],u=(0,h.useState)(!1),p=g()(u,2),Q=p[0],H=p[1],N=(0,h.useState)("and"),X=g()(N,2),M=X[0],W=X[1],O=m.Z.useWatch("filters",o),E=(0,B.Z)((function(){return x.W.get("".concat(y.Z.apiPrefix,"subscriptions"))}),{cacheKey:"subscriptions"}).data,G={status:[{name:d.ZP.get("运行中"),value:j.CrontabStatus.running},{name:d.ZP.get("空闲中"),value:j.CrontabStatus.idle},{name:d.ZP.get("已禁用"),value:j.CrontabStatus.disabled}],sub_id:null==E?void 0:E.data.map((function(e){return{name:e.name,value:e.id}}))},D=function(){var e=c()(i()().mark((function e(r){var l,n,o,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),r.filterRelation=M,l=t?"put":"post",e.prev=3,e.next=6,x.W[l]("".concat(y.Z.apiPrefix,"crons/views"),t?s()(s()({},r),{},{id:t.id}):r);case 6:n=e.sent,o=n.code,u=n.data,200===o&&a(u),H(!1),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),H(!1);case 16:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(t){return e.apply(this,arguments)}}();(0,h.useEffect)((function(){t||o.resetFields(),o.setFieldsValue(t||{filters:[{property:"command"}]})}),[t,r]);var L=function(e){var t=e.name,a=l()(e,_),r=o.getFieldValue(["filters",t,"property"]);return(0,C.jsx)(Z.Z,s()(s()({style:{width:120},placeholder:d.ZP.get("请选择操作符")},a),{},{children:T.filter((function(e){return G[r]?"select"===e.type:e})).map((function(e){return(0,C.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))}))},F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,C.jsx)(Z.Z,{style:t,children:e.map((function(e){return(0,C.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))})},z=(0,C.jsx)(Z.Z,{style:{width:80},children:U.map((function(e){return(0,C.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))});return(0,C.jsx)(P.Z,{title:t?d.ZP.get("编辑视图"):d.ZP.get("创建视图"),open:r,forceRender:!0,width:580,centered:!0,maskClosable:!1,onOk:function(){o.validateFields().then((function(e){D(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return a()},confirmLoading:Q,children:(0,C.jsxs)(m.Z,{form:o,layout:"vertical",name:"env_modal",children:[(0,C.jsx)(m.Z.Item,{name:"name",label:d.ZP.get("视图名称"),rules:[{required:!0,message:d.ZP.get("请输入视图名称")}],children:(0,C.jsx)(b.Z,{placeholder:d.ZP.get("请输入视图名称")})}),(0,C.jsx)(m.Z.List,{name:"filters",children:function(e,t,a){var r=t.add,n=t.remove,i=a.errors;return(0,C.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,C.jsx)("div",{style:{position:"absolute",width:50,borderRadius:10,border:"1px solid rgb(190, 220, 255)",borderRight:"none",height:56*(e.length-1),top:46,left:15},children:(0,C.jsx)(v.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},onClick:function(){W("and"===M?"or":"and")},children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{children:A[M]}),(0,C.jsx)(q.Z,{type:"ql-icon-d-caret"})]})})}),(0,C.jsxs)("div",{children:[e.map((function(e){var t,a,r=e.key,i=e.name,o=l()(e,S);return(0,C.jsx)(m.Z.Item,{label:0===i?d.ZP.get("筛选条件"):"",style:{marginBottom:0},required:!0,className:"filter-item",children:(0,C.jsxs)(f.Z,{className:"view-create-modal-filters",align:"baseline",children:[(0,C.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"property"],rules:[{required:!0}],children:F(I,{width:120})})),(0,C.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"operation"],rules:[{required:!0,message:d.ZP.get("请选择操作符")}],children:(0,C.jsx)(L,{name:i})})),(0,C.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"value"],rules:[{required:!0,message:d.ZP.get("请输入内容")}],children:"select"===K[null==O?void 0:O[i].operation]?(t=null==O?void 0:O[i].property,(0,C.jsx)(Z.Z,{mode:"tags",allowClear:!0,placeholder:d.ZP.get("输入后回车增加自定义选项"),children:null===(a=G[t])||void 0===a?void 0:a.map((function(e){return(0,C.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))})):(0,C.jsx)(b.Z,{placeholder:d.ZP.get("请输入内容")})})),0!==i&&(0,C.jsx)(k.Z,{onClick:function(){return n(i)}})]})},r)})),(0,C.jsx)(m.Z.Item,{children:(0,C.jsxs)("a",{onClick:function(){return r({property:"command",operation:"Reg"})},children:[(0,C.jsx)(w.Z,{}),d.ZP.get("新增筛选条件")]})}),(0,C.jsx)(m.Z.ErrorList,{errors:i})]})]})}}),(0,C.jsx)(m.Z.List,{name:"sorts",children:function(e,t,a){var r=t.add,n=t.remove,i=a.errors;return(0,C.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,C.jsx)("div",{style:{position:"absolute",width:50,borderRadius:10,border:"1px solid rgb(190, 220, 255)",borderRight:"none",height:56*(e.length-1),top:46,left:15},children:(0,C.jsx)(v.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},children:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("span",{children:A[M]})})})}),(0,C.jsxs)("div",{children:[e.map((function(e){var t=e.key,a=e.name,r=l()(e,R);return(0,C.jsx)(m.Z.Item,{label:0===a?d.ZP.get("排序方式"):"",style:{marginBottom:0},className:"filter-item",children:(0,C.jsxs)(f.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,C.jsx)(m.Z.Item,s()(s()({},r),{},{name:[a,"property"],rules:[{required:!0}],children:F(I)})),(0,C.jsx)(m.Z.Item,s()(s()({},r),{},{name:[a,"type"],rules:[{required:!0}],children:z})),(0,C.jsx)(k.Z,{onClick:function(){return n(a)}})]})},t)})),(0,C.jsx)(m.Z.Item,{children:(0,C.jsxs)("a",{onClick:function(){return r({property:"command",type:"ASC"})},children:[(0,C.jsx)(w.Z,{}),d.ZP.get("新增排序方式")]})}),(0,C.jsx)(m.Z.ErrorList,{errors:i})]})]})}})]})})}},15207:function(e,t,a){var r=a(88265),l=window.__ENV__QlBaseUrl||"/";t.Z={siteName:r.ZP.get("青龙"),baseUrl:l,apiPrefix:"".concat(l,"api/"),authKey:"token",layouts:[{name:"primary",include:[/.*/],exclude:[/(\/(en|zh))*\/login/]}],i18n:{languages:[{key:"pt-br",title:"Português",flag:"/portugal.svg"},{key:"en",title:"English",flag:"/america.svg"},{key:"zh",title:r.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:r.ZP.get("定时任务"),value:"crons"},{name:r.ZP.get("环境变量"),value:"envs"},{name:r.ZP.get("订阅管理"),value:"subscriptions"},{name:r.ZP.get("配置文件"),value:"configs"},{name:r.ZP.get("脚本管理"),value:"scripts"},{name:r.ZP.get("日志管理"),value:"logs"},{name:r.ZP.get("依赖管理"),value:"dependencies"},{name:r.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:r.ZP.get("定时任务"),envs:r.ZP.get("环境变量"),subscriptions:r.ZP.get("订阅管理"),configs:r.ZP.get("配置文件"),scripts:r.ZP.get("脚本管理"),logs:r.ZP.get("日志管理"),dependencies:r.ZP.get("依赖管理"),system:r.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:r.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:r.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:r.ZP.get("钉钉机器人")},{value:"weWorkBot",label:r.ZP.get("企业微信机器人")},{value:"weWorkApp",label:r.ZP.get("企业微信应用")},{value:"aibotk",label:r.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:r.ZP.get("微加机器人")},{value:"chat",label:r.ZP.get("群晖chat")},{value:"email",label:r.ZP.get("邮箱")},{value:"lark",label:r.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:r.ZP.get("自定义通知")},{value:"closed",label:r.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:r.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:r.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:r.ZP.get("推送消息的优先级")}],chat:[{label:"chatUrl",tip:r.ZP.get("chat的url地址"),required:!0},{label:"chatToken",tip:r.ZP.get("chat的token码"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:r.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:r.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:r.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:r.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:r.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:r.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:r.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:r.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:r.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:r.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:r.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:r.ZP.get("BARK推送消息的跳转URL")},{label:"barkArchive",tip:r.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:r.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:r.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:r.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:r.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:r.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:r.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:r.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:r.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:r.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:r.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:r.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:r.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:r.ZP.get("请输入要发送的目标"),items:[{value:"room",label:r.ZP.get("群聊")},{value:"contact",label:r.ZP.get("好友")}]},{label:"aibotkName",tip:r.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:r.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:r.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:r.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")}],wePlusBot:[{label:"wePlusBotToken",tip:r.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:r.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:r.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],lark:[{label:"larkKey",tip:r.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:r.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:r.ZP.get("邮箱地址"),required:!0},{label:"emailPass",tip:r.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0}],pushMe:[{label:"pushMeKey",tip:r.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0},{label:"pushMeUrl",tip:r.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:r.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:r.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:r.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:r.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:r.ZP.get("请求头Content-Type"),required:!0,items:[{value:"text/plain"},{value:"application/json"},{value:"multipart/form-data"},{value:"application/x-www-form-urlencoded"}]},{label:"webhookUrl",tip:r.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:r.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:r.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":r.ZP.get("登录"),"/initialization":r.ZP.get("初始化"),"/crontab":r.ZP.get("定时任务"),"/env":r.ZP.get("环境变量"),"/subscription":r.ZP.get("订阅管理"),"/config":r.ZP.get("配置文件"),"/script":r.ZP.get("脚本管理"),"/diff":r.ZP.get("对比工具"),"/log":r.ZP.get("日志管理"),"/setting":r.ZP.get("系统设置"),"/error":r.ZP.get("错误日志"),"/dependence":r.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},57229:function(e,t,a){a.d(t,{W:function(){return m}});var r=a(25359),l=a.n(r),n=a(49811),i=a.n(n),o=a(88265),s=a(9835),u=a(15207),c=a(14851),p=a(73669);s.ZP.config({duration:2});var g=Date.now(),d=p.Z.create({timeout:6e4,params:{t:g}}),h=["/api/user/login","/open/auth/token","/api/user/two-factor/login","/api/system","/api/user/init","/api/user/notification/init"];d.interceptors.request.use((function(e){var t=localStorage.getItem(u.Z.authKey);return t&&!h.includes(e.url)?(e.headers.Authorization="Bearer ".concat(t),e):e})),d.interceptors.response.use(function(){var e=i()(l()().mark((function e(t){var a,r,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.status,![502,504].includes(a)){e.next=5;break}c.history.push("/error"),e.next=18;break;case 5:if(401!==a){e.next=9;break}"/login"!==c.history.location.pathname&&(localStorage.removeItem(u.Z.authKey),c.history.push("/login")),e.next=18;break;case 9:return e.prev=9,200!==(r=t.data).code&&(n=r.message||r.data)&&s.ZP.error({content:n,style:{maxWidth:500,margin:"0 auto"}}),e.abrupt("return",r);case 15:e.prev=15,e.t0=e.catch(9);case 17:case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,null,[[9,15]])})));return function(t){return e.apply(this,arguments)}}(),(function(e){if(e.response){var t=e.response.data?e.response.data.message||e.message||e.response.data:e.response.statusText,a=e.response.status;[502,504].includes(a)?c.history.push("/error"):401===a?"/login"!==c.history.location.pathname&&(s.ZP.error(o.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(u.Z.authKey),c.history.push("/login")):s.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}else console.log(e.message);return Promise.reject(e)}));var m=d}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[833],{15207:function(e,t,r){"use strict";var o=r(88265),n=window.__ENV__QlBaseUrl||"/";t.Z={siteName:o.ZP.get("青龙"),baseUrl:n,apiPrefix:"".concat(n,"api/"),authKey:"token",layouts:[{name:"primary",include:[/.*/],exclude:[/(\/(en|zh))*\/login/]}],i18n:{languages:[{key:"pt-br",title:"Português",flag:"/portugal.svg"},{key:"en",title:"English",flag:"/america.svg"},{key:"zh",title:o.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:o.ZP.get("定时任务"),value:"crons"},{name:o.ZP.get("环境变量"),value:"envs"},{name:o.ZP.get("订阅管理"),value:"subscriptions"},{name:o.ZP.get("配置文件"),value:"configs"},{name:o.ZP.get("脚本管理"),value:"scripts"},{name:o.ZP.get("日志管理"),value:"logs"},{name:o.ZP.get("依赖管理"),value:"dependencies"},{name:o.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:o.ZP.get("定时任务"),envs:o.ZP.get("环境变量"),subscriptions:o.ZP.get("订阅管理"),configs:o.ZP.get("配置文件"),scripts:o.ZP.get("脚本管理"),logs:o.ZP.get("日志管理"),dependencies:o.ZP.get("依赖管理"),system:o.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:o.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:o.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:o.ZP.get("钉钉机器人")},{value:"weWorkBot",label:o.ZP.get("企业微信机器人")},{value:"weWorkApp",label:o.ZP.get("企业微信应用")},{value:"aibotk",label:o.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:o.ZP.get("微加机器人")},{value:"chat",label:o.ZP.get("群晖chat")},{value:"email",label:o.ZP.get("邮箱")},{value:"lark",label:o.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:o.ZP.get("自定义通知")},{value:"closed",label:o.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:o.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:o.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:o.ZP.get("推送消息的优先级")}],chat:[{label:"chatUrl",tip:o.ZP.get("chat的url地址"),required:!0},{label:"chatToken",tip:o.ZP.get("chat的token码"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:o.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:o.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:o.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:o.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:o.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:o.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:o.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:o.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:o.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:o.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:o.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:o.ZP.get("BARK推送消息的跳转URL")},{label:"barkArchive",tip:o.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:o.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:o.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:o.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:o.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:o.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:o.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:o.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:o.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:o.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:o.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:o.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:o.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:o.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:o.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:o.ZP.get("请输入要发送的目标"),items:[{value:"room",label:o.ZP.get("群聊")},{value:"contact",label:o.ZP.get("好友")}]},{label:"aibotkName",tip:o.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:o.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:o.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:o.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")}],wePlusBot:[{label:"wePlusBotToken",tip:o.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:o.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:o.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],lark:[{label:"larkKey",tip:o.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:o.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:o.ZP.get("邮箱地址"),required:!0},{label:"emailPass",tip:o.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0}],pushMe:[{label:"pushMeKey",tip:o.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0},{label:"pushMeUrl",tip:o.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:o.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:o.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:o.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:o.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:o.ZP.get("请求头Content-Type"),required:!0,items:[{value:"text/plain"},{value:"application/json"},{value:"multipart/form-data"},{value:"application/x-www-form-urlencoded"}]},{label:"webhookUrl",tip:o.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:o.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:o.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":o.ZP.get("登录"),"/initialization":o.ZP.get("初始化"),"/crontab":o.ZP.get("定时任务"),"/env":o.ZP.get("环境变量"),"/subscription":o.ZP.get("订阅管理"),"/config":o.ZP.get("配置文件"),"/script":o.ZP.get("脚本管理"),"/diff":o.ZP.get("对比工具"),"/log":o.ZP.get("日志管理"),"/setting":o.ZP.get("系统设置"),"/error":o.ZP.get("错误日志"),"/dependence":o.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},57229:function(e,t,r){"use strict";r.d(t,{W:function(){return b}});var o=r(25359),n=r.n(o),a=r(49811),i=r.n(a),l=r(88265),s=r(9835),u=r(15207),g=r(14851),p=r(73669);s.ZP.config({duration:2});var c=Date.now(),d=p.Z.create({timeout:6e4,params:{t:c}}),h=["/api/user/login","/open/auth/token","/api/user/two-factor/login","/api/system","/api/user/init","/api/user/notification/init"];d.interceptors.request.use((function(e){var t=localStorage.getItem(u.Z.authKey);return t&&!h.includes(e.url)?(e.headers.Authorization="Bearer ".concat(t),e):e})),d.interceptors.response.use(function(){var e=i()(n()().mark((function e(t){var r,o,a;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.status,![502,504].includes(r)){e.next=5;break}g.history.push("/error"),e.next=18;break;case 5:if(401!==r){e.next=9;break}"/login"!==g.history.location.pathname&&(localStorage.removeItem(u.Z.authKey),g.history.push("/login")),e.next=18;break;case 9:return e.prev=9,200!==(o=t.data).code&&(a=o.message||o.data)&&s.ZP.error({content:a,style:{maxWidth:500,margin:"0 auto"}}),e.abrupt("return",o);case 15:e.prev=15,e.t0=e.catch(9);case 17:case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,null,[[9,15]])})));return function(t){return e.apply(this,arguments)}}(),(function(e){if(e.response){var t=e.response.data?e.response.data.message||e.message||e.response.data:e.response.statusText,r=e.response.status;[502,504].includes(r)?g.history.push("/error"):401===r?"/login"!==g.history.location.pathname&&(s.ZP.error(l.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(u.Z.authKey),g.history.push("/login")):s.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}else console.log(e.message);return Promise.reject(e)}));var b=d},40141:function(e,t,r){"use strict";r.d(t,{ZP:function(){return u},I1:function(){return c},o4:function(){return v},w7:function(){return p},DY:function(){return d},FA:function(){return b},rS:function(){return w},H$:function(){return m},W9:function(){return g},x$:function(){return h}});var o=r(93525),n=r.n(o),a=r(88265),i={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript"},l=r(11186),s=r.n(l);function u(){var e=navigator.userAgent.toLowerCase(),t=function(t){return t.test(e)},r=function(t){return(e.match(t)||[]).toString().replace(/[^0-9|_.]/g,"").replace(/_/g,".")},o="unknow";t(/windows|win32|win64|wow32|wow64/g)?o="windows":t(/macintosh|macintel/g)?o="macos":t(/x11/g)?o="linux":t(/android|adr/g)?o="android":t(/ios|iphone|ipad|ipod|iwatch/g)&&(o="ios");var n="unknow";"windows"===o?t(/windows nt 5.0|windows 2000/g)?n="2000":t(/windows nt 5.1|windows xp/g)?n="xp":t(/windows nt 5.2|windows 2003/g)?n="2003":t(/windows nt 6.0|windows vista/g)?n="vista":t(/windows nt 6.1|windows 7/g)?n="7":t(/windows nt 6.2|windows 8/g)?n="8":t(/windows nt 6.3|windows 8.1/g)?n="8.1":t(/windows nt 10.0|windows 10/g)&&(n="10"):"macos"===o?n=r(/os x [\d._]+/g):"android"===o?n=r(/android [\d._]+/g):"ios"===o&&(n=r(/os [\d._]+/g));var a="unknow";"windows"===o||"macos"===o||"linux"===o?a="desktop":("android"===o||"ios"===o||t(/mobile/g))&&(a="mobile");var i="unknow",l="unknow";t(/applewebkit/g)?(i="webkit",t(/edge/g)?l="edge":t(/opr/g)?l="opera":t(/chrome/g)?l="chrome":t(/safari/g)&&(l="safari")):t(/gecko/g)&&t(/firefox/g)?(i="gecko",l="firefox"):t(/presto/g)?(i="presto",l="opera"):t(/trident|compatible|msie/g)&&(i="trident",l="iexplore");var s="unknow";"webkit"===i?s=r(/applewebkit\/[\d._]+/g):"gecko"===i?s=r(/gecko\/[\d._]+/g):"presto"===i?s=r(/presto\/[\d._]+/g):"trident"===i&&(s=r(/trident\/[\d._]+/g));var u="unknow";"chrome"===l?u=r(/chrome\/[\d._]+/g):"safari"===l?u=r(/version\/[\d._]+/g):"firefox"===l?u=r(/firefox\/[\d._]+/g):"opera"===l?u=r(/opr\/[\d._]+/g):"iexplore"===l?u=r(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(u=r(/edge\/[\d._]+/g));var g="none",p="unknow";t(/micromessenger/g)?(g="wechat",p=r(/micromessenger\/[\d._]+/g)):t(/qqbrowser/g)?(g="qq",p=r(/qqbrowser\/[\d._]+/g)):t(/ucbrowser/g)?(g="uc",p=r(/ucbrowser\/[\d._]+/g)):t(/qihu 360se/g)?g="360":t(/2345explorer/g)?(g="2345",p=r(/2345explorer\/[\d._]+/g)):t(/metasr/g)?g="sougou":t(/lbbrowser/g)?g="liebao":t(/maxthon/g)&&(g="maxthon",p=r(/maxthon\/[\d._]+/g));var c=Object.assign({engine:i,engineVs:s,platform:a,supporter:l,supporterVs:u,system:o,systemVs:n},"none"===g?{}:{shell:g,shellVs:p});return console.log("%c\n .d88b. d888888b d8b db d888b db .d88b. d8b db d888b \n.8P Y8. `88' 888o 88 88' Y8b 88 .8P Y8. 888o 88 88' Y8b \n88 88 88 88V8o 88 88 88 88 88 88V8o 88 88 \n88 88 88 88 V8o88 88 ooo 88 88 88 88 V8o88 88 ooo \n`8P d8' .88. 88 V888 88. ~8~ 88booo. `8b d8' 88 V888 88. ~8~ \n `Y88'Y8 Y888888P VP V8P Y888P Y88888P `Y88P' VP V8P Y888P \n \n \n","color: blue;font-size: 14px;"),console.log("%c忘形雨笠烟蓑,知心牧唱樵歌。明月清风共我,闲人三个,从他今古消磨。\n","color: yellow;font-size: 18px;"),console.log("%c青龙运行环境:\n\n系统:".concat(c.system,"/").concat(c.systemVs,"\n浏览器:").concat(c.supporter,"/").concat(c.supporterVs,"\n内核:").concat(c.engine,"/").concat(c.engineVs),"color: green;font-size: 14px;font-weight: bold;"),c}function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.extraHeight,r=e.target;void 0===t&&(t=99);var o=null,n=0;(o=r||document.querySelector(".ant-table-wrapper"))&&(n=o.getBoundingClientRect().top);var a=document.body.clientHeight-n-t;return a}function p(e,t){var r,o,n=window.URL||window.webkitURL||window,a=new Blob([t]),i=document.createElementNS("http://www.w3.org/1999/xhtml","a");i.href=n.createObjectURL(a),i.download=e,r=i,(o=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r.dispatchEvent(o)}function c(e,t,r){var o=n()(e),a=[];return function e(o){if(o)for(var n=0;n<(null==o?void 0:o.length);n++){if(t(o[n]))return r?void(o[n].children?o[n].children.unshift(r):o[n].children=[r]):void o.splice(n,1);o[n].children&&(a.push(o[n].key),e(o[n].children))}}(o),o}function d(e,t){var r;return function e(o){if(o)for(var n=0;n<(null==o?void 0:o.length);n++)t(o[n])?r=o[n]:o[n].children&&e(o[n].children)}(n()(e)),r}function h(e){return[" ",a.ZP.get("执行结束")].some((function(t){return e.includes(t)}))}function b(e){var t=e.split(" ");if("repo"===t[1]||"raw"===t[1])return t[2];var r=t.find((function(e){return[".js",".ts",".sh",".py"].some((function(t){return e.endsWith(t)}))}));if(r){var o,n;r.startsWith("/ql/data/scripts")&&(r=r.replace("/ql/data/scripts/",""));var a=r.lastIndexOf("/");return a>=0?(n=r.slice(a+1),o=r.slice(0,a)):(n=r,o=""),[n,o]}}function P(e){try{var t=s().parseExpression(e);if(t)return t.next().toDate()}catch(e){}return null}function w(e,t){var r=P(e);return null!=t&&t.length&&t.forEach((function(e){var t=P(e);t&&(!r||t<r)&&(r=t)})),r}function m(e){var t=function(e){if(!e)return"";var t=e.split(".");return".".concat(t[t.length-1])}(e);return i[t]}function v(){var e=document.createElement("div");e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="transparent",e.style.zIndex="9999",document.body.appendChild(e),e.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()})),document.body.style.overflow="hidden"}},38433:function(){}}]);
|
package/static/dist/index.html
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[5825],{37126:function(e,n,t){t.d(n,{Z:function(){return s}});var a=t(14797),o=t(63313),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},c=t(46420),i=function(e,n){return o.createElement(c.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:n,icon:r}))};i.displayName="SearchOutlined";var s=o.forwardRef(i)},74301:function(e,n,t){t.r(n);var a=t(54306),o=t.n(a),r=t(88265),c=t(63313),i=t(9835),s=t(75310),u=t(24378),l=t(15207),d=t(23435),f=t(57229),E=t(82755),p=t(31988),h=t(14851),g=t(26747),m=t(95407),S=t(40141),N=t(11527);n.default=function(){var e=(0,h.useOutletContext)(),n=e.headerStyle,t=e.isPhone,a=e.theme,C=(0,c.useState)(""),M=o()(C,2),y=M[0],O=M[1],v=(0,c.useState)(!0),T=o()(v,2),_=T[0],U=T[1],P=(0,c.useState)("config.sh"),I=o()(P,2),A=I[0],R=I[1],x=(0,c.useState)("config.sh"),w=o()(x,2),Z=w[0],L=w[1],b=(0,c.useState)([]),D=o()(b,2),F=D[0],K=D[1],k=(0,c.useRef)(null),H=(0,c.useState)(!1),W=o()(H,2),G=W[0],j=W[1],B=(0,c.useState)("shell"),V=o()(B,2),Q=V[0],z=V[1],q=function(e){f.W.get("".concat(l.Z.apiPrefix,"configs/detail?path=").concat(encodeURIComponent(e))).then((function(e){var n=e.code,t=e.data;200===n&&O(t)}))},Y=function(){j(!0);var e=k.current?k.current.getValue().replace(/\r\n/g,"\n"):y;f.W.post("".concat(l.Z.apiPrefix,"configs/save"),{content:e,name:Z}).then((function(e){var n=e.code;e.data;200===n&&i.ZP.success(r.ZP.get("保存成功")),j(!1)}))};return(0,m.y1)("mod+s",(function(e){Y()}),{enableOnFormTags:["textarea"],preventDefault:!0}),(0,c.useEffect)((function(){U(!0),f.W.get("".concat(l.Z.apiPrefix,"configs/files")).then((function(e){var n=e.code,t=e.data;200===n&&K(t)})).finally((function(){return U(!1)})),q("config.sh")}),[]),(0,N.jsx)(d.ZP,{className:"ql-container-wrapper config-wrapper",title:A,loading:_,extra:[(0,N.jsx)(s.Z,{treeExpandAction:"click",className:"config-select",value:Z,dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:F,defaultValue:"config.sh",onSelect:function(e,n){L(e),R(n.value),q(n.value);var t=(0,S.H$)(e);z(t)}},"value"),(0,N.jsx)(u.Z,{loading:G,type:"primary",onClick:Y,children:r.ZP.get("保存")},"1")],header:{style:n},children:t?(0,N.jsx)(p.ZP,{value:y,theme:a.includes("dark")?"dark":"light",extensions:[g.RI.shell()],onChange:function(e){O(e)}}):(0,N.jsx)(E.ZP,{language:Q,value:y,theme:a,options:{fontSize:12,lineNumbersMinChars:3,folding:!1,glyphMargin:!1,accessibilitySupport:"off"},onMount:function(e){k.current=e}})})}},52105:function(e,n,t){var a=t(41171),o=t(63313),r=t(68098);n.Z=function(){var e=o.useState(!1),n=(0,a.Z)(e,2),t=n[0],c=n[1];return o.useEffect((function(){c((0,r.fk)())}),[]),t}},11847:function(e,n,t){t.d(n,{c4:function(){return r}});var a=t(22481),o=t(88028),r=["xxl","xl","lg","md","sm","xs"],c={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},i=new Map,s=-1,u={},l={matchHandlers:{},dispatch:function(e){return u=e,i.forEach((function(e){return e(u)})),i.size>=1},subscribe:function(e){return i.size||this.register(),s+=1,i.set(s,e),e(u),s},unsubscribe:function(e){i.delete(e),i.size||this.unregister()},unregister:function(){var e=this;Object.keys(c).forEach((function(n){var t=c[n],a=e.matchHandlers[t];null==a||a.mql.removeListener(null==a?void 0:a.listener)})),i.clear()},register:function(){var e=this;Object.keys(c).forEach((function(n){var t=c[n],r=function(t){var r=t.matches;e.dispatch((0,o.Z)((0,o.Z)({},u),(0,a.Z)({},n,r)))},i=window.matchMedia(t);i.addListener(r),e.matchHandlers[t]={mql:i,listener:r},r(i)}))}};n.ZP=l},1020:function(e,n,t){t.d(n,{F:function(){return i},Z:function(){return c}});var a=t(22481),o=t(84875),r=t.n(o);(0,t(20341).b)("warning","error","");function c(e,n,t){var o;return r()((o={},(0,a.Z)(o,"".concat(e,"-status-success"),"success"===n),(0,a.Z)(o,"".concat(e,"-status-warning"),"warning"===n),(0,a.Z)(o,"".concat(e,"-status-error"),"error"===n),(0,a.Z)(o,"".concat(e,"-status-validating"),"validating"===n),(0,a.Z)(o,"".concat(e,"-has-feedback"),t),o))}var i=function(e,n){return n||e}},68098:function(e,n,t){t.d(n,{fk:function(){return c},jD:function(){return r}});var a,o=t(46594),r=function(){return(0,o.Z)()&&window.document.documentElement},c=function(){if(!r())return!1;if(void 0!==a)return a;var e=document.createElement("div");return e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e),a=1===e.scrollHeight,document.body.removeChild(e),a}},20277:function(e,n,t){var a=t(88028),o=t(32602),r=t(63313),c=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)n.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(t[a[o]]=e[a[o]])}return t},i={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},s=r.forwardRef((function(e,n){var t=e.style,s=e.noStyle,u=e.disabled,l=c(e,["style","noStyle","disabled"]),d={};return s||(d=(0,a.Z)({},i)),u&&(d.pointerEvents="none"),d=(0,a.Z)((0,a.Z)({},d),t),r.createElement("div",(0,a.Z)({role:"button",tabIndex:0,ref:n},l,{onKeyDown:function(e){e.keyCode===o.Z.ENTER&&e.preventDefault()},onKeyUp:function(n){var t=n.keyCode,a=e.onClick;t===o.Z.ENTER&&a&&a()},style:d}))}));n.Z=s},32602:function(e,n){var t={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var n=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=t.F1&&n<=t.F12)return!1;switch(n){case t.ALT:case t.CAPS_LOCK:case t.CONTEXT_MENU:case t.CTRL:case t.DOWN:case t.END:case t.ESC:case t.HOME:case t.INSERT:case t.LEFT:case t.MAC_FF_META:case t.META:case t.NUMLOCK:case t.NUM_CENTER:case t.PAGE_DOWN:case t.PAGE_UP:case t.PAUSE:case t.PRINT_SCREEN:case t.RIGHT:case t.SHIFT:case t.UP:case t.WIN_KEY:case t.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=t.ZERO&&e<=t.NINE)return!0;if(e>=t.NUM_ZERO&&e<=t.NUM_MULTIPLY)return!0;if(e>=t.A&&e<=t.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case t.SPACE:case t.QUESTION_MARK:case t.NUM_PLUS:case t.NUM_MINUS:case t.NUM_PERIOD:case t.NUM_DIVISION:case t.SEMICOLON:case t.DASH:case t.EQUALS:case t.COMMA:case t.PERIOD:case t.SLASH:case t.APOSTROPHE:case t.SINGLE_QUOTE:case t.OPEN_SQUARE_BRACKET:case t.BACKSLASH:case t.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};n.Z=t},35019:function(e,n,t){t.d(n,{Z:function(){return s}});var a=t(2595),o="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/),r="aria-",c="data-";function i(e,n){return 0===e.indexOf(n)}function s(e){var n,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n=!1===t?{aria:!0,data:!0,attr:!0}:!0===t?{aria:!0}:(0,a.Z)({},t);var s={};return Object.keys(e).forEach((function(t){(n.aria&&("role"===t||i(t,r))||n.data&&i(t,c)||n.attr&&o.includes(t))&&(s[t]=e[t])})),s}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[9558,5812],{75909:function(e,n,t){var i=t(14797),r=t(87807),a=t(16803),o=t(63313),c=t(84875),l=t.n(c),s=t(12888),u=t(15152),d=["className","component","viewBox","spin","rotate","tabIndex","onClick","children"],f=o.forwardRef((function(e,n){var t=e.className,c=e.component,f=e.viewBox,m=e.spin,p=e.rotate,h=e.tabIndex,g=e.onClick,Z=e.children,v=(0,a.Z)(e,d);(0,u.Kp)(Boolean(c||Z),"Should have `component` prop or `children`."),(0,u.C3)();var x=o.useContext(s.Z),y=x.prefixCls,b=void 0===y?"anticon":y,j=x.rootClassName,P=l()(j,b,t),C=l()((0,r.Z)({},"".concat(b,"-spin"),!!m)),w=p?{msTransform:"rotate(".concat(p,"deg)"),transform:"rotate(".concat(p,"deg)")}:void 0,S=(0,i.Z)((0,i.Z)({},u.vD),{},{className:C,style:w,viewBox:f});f||delete S.viewBox;var N=h;return void 0===N&&g&&(N=-1),o.createElement("span",(0,i.Z)((0,i.Z)({role:"img"},v),{},{ref:n,tabIndex:N,onClick:g,className:P}),c?o.createElement(c,(0,i.Z)({},S),Z):Z?((0,u.Kp)(Boolean(f)||1===o.Children.count(Z)&&o.isValidElement(Z)&&"use"===o.Children.only(Z).type,"Make sure that you provide correct `viewBox` prop (default `0 0 1024 1024`) to the icon."),o.createElement("svg",(0,i.Z)((0,i.Z)({},S),{},{viewBox:f}),Z)):null)}));f.displayName="AntdIcon",n.Z=f},55258:function(e,n,t){t.d(n,{Z:function(){return d}});var i=t(14797),r=t(16803),a=t(63313),o=t(75909),c=["type","children"],l=new Set;function s(e){return Boolean("string"==typeof e&&e.length&&!l.has(e))}function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=e[n];if(s(t)){var i=document.createElement("script");i.setAttribute("src",t),i.setAttribute("data-namespace",t),e.length>n+1&&(i.onload=function(){u(e,n+1)},i.onerror=function(){u(e,n+1)}),l.add(t),document.body.appendChild(i)}}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.scriptUrl,t=e.extraCommonProps,l=void 0===t?{}:t;n&&"undefined"!=typeof document&&"undefined"!=typeof window&&"function"==typeof document.createElement&&(Array.isArray(n)?u(n.reverse()):u([n]));var s=a.forwardRef((function(e,n){var t=e.type,s=e.children,u=(0,r.Z)(e,c),d=null;return e.type&&(d=a.createElement("use",{xlinkHref:"#".concat(t)})),s&&(d=s),a.createElement(o.Z,(0,i.Z)((0,i.Z)((0,i.Z)({},l),u),{},{ref:n}),d)}));return s.displayName="Iconfont",s}},25265:function(e,n,t){t.d(n,{Z:function(){return l}});var i=t(14797),r=t(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},o=t(46420),c=function(e,n){return r.createElement(o.Z,(0,i.Z)((0,i.Z)({},e),{},{ref:n,icon:a}))};c.displayName="FileOutlined";var l=r.forwardRef(c)},37126:function(e,n,t){t.d(n,{Z:function(){return l}});var i=t(14797),r=t(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},o=t(46420),c=function(e,n){return r.createElement(o.Z,(0,i.Z)((0,i.Z)({},e),{},{ref:n,icon:a}))};c.displayName="SearchOutlined";var l=r.forwardRef(c)},38582:function(e,n,t){var i=(0,t(55258).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_lc939gab1iq.js"]});n.Z=i},74385:function(e,n,t){t.r(n),t.d(n,{default:function(){return I}});var i=t(57213),r=t.n(i),a=t(54306),o=t.n(a),c=t(88265),l=t(63313),s=t(92260),u=t(64865),d=t(84163),f=t(9835),m=t(394),p=t(51704),h=t(15367),g=t(24378),Z=t(1953),v=t(25265),x=t(44968),y=t(69685),b=t(20209),j=t(65601),P=t(7688),C=t(76657),w=t(3563),S=t(91350),N=t(87423),k=t(57229),E=t(15207),O=t(33680),B=t(82755),M=t(38582),R=t(40141),_=t(29030),T=t(61761),q=t(52053),z=t.n(q),A=t(11527),D=s.Z.Text,H=[{key:"log",tab:c.ZP.get("日志")},{key:"script",tab:c.ZP.get("脚本")}],I=function(e){var n,t,i,a,q=e.cron,I=void 0===q?{}:q,F=e.handleCancel,W=e.visible,L=e.theme,Y=e.isPhone,V=(0,l.useState)("log"),K=o()(V,2),U=K[0],$=K[1],G=(0,l.useState)(!0),J=o()(G,2),Q=(J[0],J[1]),X=(0,l.useState)([]),ee=o()(X,2),ne=ee[0],te=ee[1],ie=(0,l.useState)(""),re=o()(ie,2),ae=re[0],oe=re[1],ce=(0,l.useState)(""),le=o()(ce,2),se=le[0],ue=le[1],de=(0,l.useState)(!1),fe=o()(de,2),me=fe[0],pe=fe[1],he=(0,l.useRef)(null),ge=(0,l.useState)({}),Ze=o()(ge,2),ve=Ze[0],xe=Ze[1],ye=(0,l.useState)(""),be=o()(ye,2),je=be[0],Pe=be[1],Ce=(0,l.useState)(H),we=o()(Ce,2),Se=we[0],Ne=we[1],ke=(0,l.useState)({}),Ee=o()(ke,2),Oe=Ee[0],Be=Ee[1],Me=(0,l.useRef)(null),Re=function(e){var n=(0,l.useState)(0),t=o()(n,2),i=t[0],r=t[1];return(0,T.Z)(e,(function(e){var n=e.target.clientHeight;i!==n&&r(n)})),i}(Me),_e={log:(0,A.jsx)("div",{ref:Me,children:(0,A.jsx)(u.ZP,{children:(0,A.jsx)(_.Z,{data:ne,height:Re,itemHeight:47,itemKey:"filename",children:function(e){return(0,A.jsxs)(u.ZP.Item,{className:"log-item",onClick:function(){return Te(e)},children:[(0,A.jsx)(v.Z,{style:{marginRight:10}}),e.directory,"/",e.filename]})}})})}),script:ve.filename&&(0,A.jsx)(B.ZP,{language:(0,R.H$)(ve.filename),theme:L,value:se,options:{fontSize:12,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1,accessibilitySupport:"off"},onMount:function(e,n){he.current=e}})},Te=function(e){var n="".concat(E.Z.apiPrefix,"logs/detail?file=").concat(e.filename,"&path=").concat(e.directory||"");localStorage.setItem("logCron",n),Pe(n),k.W.get(n).then((function(e){var n=e.code,t=e.data;200===n&&(oe(t),pe(!0))}))},qe=function(){Q(!0),k.W.get("".concat(E.Z.apiPrefix,"crons/").concat(I.id,"/logs")).then((function(e){var n=e.code,t=e.data;200===n&&te(t)})).finally((function(){return Q(!1)}))};return(0,l.useEffect)((function(){I&&I.id&&(Be(I),qe(),function(){var e=(0,R.FA)(I.command);if(Array.isArray(e)){Ne(Se);var n=o()(e,2),t=n[0],i=n[1];xe({parent:i,filename:t}),k.W.get("".concat(E.Z.apiPrefix,"scripts/detail?file=").concat(t,"&path=").concat(i||"")).then((function(e){var n=e.code,t=e.data;200===n&&ue(t)}))}else Ne([Se[0]]),$("log")}())}),[I]),(0,A.jsxs)(d.Z,{title:(0,A.jsxs)("div",{className:"crontab-title-wrapper",children:[(0,A.jsxs)("div",{style:{minWidth:0,display:"flex",alignItems:"center"},children:[(0,A.jsx)(s.Z.Text,{style:{width:200,boxSizing:"content-box"},ellipsis:{onEllipsis:function(e){return e},tooltip:Oe.name},children:Oe.name}),(null===(n=Oe.labels)||void 0===n?void 0:n.length)>0&&""!==Oe.labels[0]&&(0,A.jsx)(m.Z,{type:"vertical"}),(null===(t=Oe.labels)||void 0===t?void 0:t.length)>0&&""!==Oe.labels[0]&&(null===(i=Oe.labels)||void 0===i?void 0:i.map((function(e,n){return(0,A.jsx)(p.Z,{color:"blue",style:{marginRight:5},children:e},e)})))]}),(0,A.jsxs)("div",{className:"operations",children:[(0,A.jsx)(h.Z,{title:Oe.status===S.CrontabStatus.idle?c.ZP.get("运行"):c.ZP.get("停止"),children:(0,A.jsx)(g.Z,{type:"link",icon:Oe.status===S.CrontabStatus.idle?(0,A.jsx)(x.Z,{}):(0,A.jsx)(y.Z,{}),size:"small",onClick:Oe.status===S.CrontabStatus.idle?function(){d.Z.confirm({title:c.ZP.get("确认运行"),content:(0,A.jsxs)(A.Fragment,{children:[c.ZP.get("确认运行定时任务")," ",(0,A.jsx)(D,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/run"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&(Be(r()(r()({},Oe),{},{status:S.CrontabStatus.running})),setTimeout((function(){qe()}),1e3))}))},onCancel:function(){console.log("Cancel")}})}:function(){d.Z.confirm({title:c.ZP.get("确认停止"),content:(0,A.jsxs)(A.Fragment,{children:[c.ZP.get("确认停止定时任务")," ",(0,A.jsx)(D,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/stop"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&Be(r()(r()({},Oe),{},{status:S.CrontabStatus.idle}))}))},onCancel:function(){console.log("Cancel")}})}})}),(0,A.jsx)(h.Z,{title:1===Oe.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用"),children:(0,A.jsx)(g.Z,{type:"link",icon:(0,A.jsx)(M.Z,{type:1===Oe.isDisabled?"ql-icon-enable":"ql-icon-disable"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Oe.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用")),content:(0,A.jsxs)(A.Fragment,{children:[c.ZP.get("确认"),1===Oe.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用"),c.ZP.get("定时任务")," ",(0,A.jsx)(D,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Oe.isDisabled?"enable":"disable"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&Be(r()(r()({},Oe),{},{isDisabled:1===Oe.isDisabled?0:1}))}))},onCancel:function(){console.log("Cancel")}})}})}),(0,A.jsx)(h.Z,{title:1===Oe.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶"),children:(0,A.jsx)(g.Z,{type:"link",icon:(0,A.jsx)(M.Z,{type:1===Oe.isPinned?"ql-icon-untop":"ql-icon-top"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Oe.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶")),content:(0,A.jsxs)(A.Fragment,{children:[c.ZP.get("确认"),1===Oe.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶"),c.ZP.get("定时任务")," ",(0,A.jsx)(D,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Oe.isPinned?"unpin":"pin"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&Be(r()(r()({},Oe),{},{isPinned:1===Oe.isPinned?0:1}))}))},onCancel:function(){console.log("Cancel")}})}})})]})]}),centered:!0,open:W,forceRender:!0,footer:!1,onCancel:function(){return F()},wrapClassName:"crontab-detail",width:Y?"":"80vw",children:[(0,A.jsxs)("div",{className:"card-wrapper",children:[(0,A.jsx)(Z.Z,{children:(0,A.jsxs)("div",{className:"cron-detail-info-item",children:[(0,A.jsx)("div",{className:"cron-detail-info-title",children:c.ZP.get("任务")}),(0,A.jsx)("div",{className:"cron-detail-info-value",children:Oe.command})]})}),(0,A.jsxs)(Z.Z,{style:{marginTop:10},children:[(0,A.jsxs)("div",{className:"cron-detail-info-item",children:[(0,A.jsx)("div",{className:"cron-detail-info-title",children:c.ZP.get("状态")}),(0,A.jsxs)("div",{className:"cron-detail-info-value",children:[(!Oe.isDisabled||Oe.status!==S.CrontabStatus.idle)&&(0,A.jsxs)(A.Fragment,{children:[Oe.status===S.CrontabStatus.idle&&(0,A.jsx)(p.Z,{icon:(0,A.jsx)(b.Z,{}),color:"default",children:c.ZP.get("空闲中")}),Oe.status===S.CrontabStatus.running&&(0,A.jsx)(p.Z,{icon:(0,A.jsx)(j.Z,{spin:!0}),color:"processing",children:c.ZP.get("运行中")}),Oe.status===S.CrontabStatus.queued&&(0,A.jsx)(p.Z,{icon:(0,A.jsx)(P.Z,{}),color:"default",children:c.ZP.get("队列中")})]}),1===Oe.isDisabled&&Oe.status===S.CrontabStatus.idle&&(0,A.jsx)(p.Z,{icon:(0,A.jsx)(C.Z,{}),color:"error",children:c.ZP.get("已禁用")})]})]}),(0,A.jsxs)("div",{className:"cron-detail-info-item",children:[(0,A.jsx)("div",{className:"cron-detail-info-title",children:c.ZP.get("定时")}),(0,A.jsxs)("div",{className:"cron-detail-info-value",children:[(0,A.jsx)("div",{children:Oe.schedule}),null===(a=Oe.extra_schedules)||void 0===a?void 0:a.map((function(e){return(0,A.jsx)("div",{children:e.schedule},e.schedule)}))]})]}),(0,A.jsxs)("div",{className:"cron-detail-info-item",children:[(0,A.jsx)("div",{className:"cron-detail-info-title",children:c.ZP.get("最后运行时间")}),(0,A.jsx)("div",{className:"cron-detail-info-value",children:Oe.last_execution_time?z()(1e3*Oe.last_execution_time).format("YYYY-MM-DD HH:mm:ss"):"-"})]}),(0,A.jsxs)("div",{className:"cron-detail-info-item",children:[(0,A.jsx)("div",{className:"cron-detail-info-title",children:c.ZP.get("最后运行时长")}),(0,A.jsx)("div",{className:"cron-detail-info-value",children:Oe.last_running_time?(0,N.E)(Oe.last_running_time):"-"})]}),(0,A.jsxs)("div",{className:"cron-detail-info-item",children:[(0,A.jsx)("div",{className:"cron-detail-info-title",children:c.ZP.get("下次运行时间")}),(0,A.jsx)("div",{className:"cron-detail-info-value",children:Oe.nextRunTime&&z()(Oe.nextRunTime).format("YYYY-MM-DD HH:mm:ss")})]})]}),(0,A.jsx)(Z.Z,{style:{marginTop:10},tabList:Se,activeTabKey:U,onTabChange:function(e){!function(e){$(e)}(e)},tabBarExtraContent:"script"===U&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(g.Z,{type:"primary",style:{marginRight:8},onClick:function(){d.Z.confirm({title:"确认保存",content:(0,A.jsxs)(A.Fragment,{children:[c.ZP.get("确认保存文件"),(0,A.jsxs)(D,{style:{wordBreak:"break-all"},type:"warning",children:[" ",ve.filename]}),c.ZP.get(",保存后不可恢复")]}),onOk:function(){var e=he.current?he.current.getValue().replace(/\r\n/g,"\n"):se;return new Promise((function(n,t){k.W.put("".concat(E.Z.apiPrefix,"scripts"),{filename:ve.filename,path:ve.parent||"",content:e}).then((function(t){var i=t.code;t.data;200===i&&(ue(e),f.ZP.success("保存成功")),n(null)})).catch((function(e){return t(e)}))}))},onCancel:function(){console.log("Cancel")}})},children:c.ZP.get("保存")}),(0,A.jsx)(g.Z,{type:"primary",icon:(0,A.jsx)(w.Z,{}),onClick:function(){var e;null===(e=he.current._domElement.parentElement)||void 0===e||e.requestFullscreen()}})]}),children:_e[U]})]}),(0,A.jsx)(O.default,{visible:me,handleCancel:function(){pe(!1)},cron:I,data:ae,logUrl:je})]})}},33680:function(e,n,t){t.r(n);var i=t(54306),r=t.n(i),a=t(88265),o=t(63313),c=t(89065),l=t(92260),s=t(84163),u=t(24378),d=t(57229),f=t(15207),m=t(65601),p=t(38101),h=t(4574),g=t(40141),Z=t(99120),v=t.n(Z),x=t(11527);c.Z.Countdown;n.default=function(e){var n=e.cron,t=e.handleCancel,i=e.visible,c=e.data,Z=e.logUrl,y=(0,o.useState)(a.ZP.get("启动中...")),b=r()(y,2),j=b[0],P=b[1],C=(0,o.useState)(!0),w=r()(C,2),S=w[0],N=w[1],k=(0,o.useState)(!0),E=r()(k,2),O=E[0],B=E[1],M=(0,o.useState)(!1),R=r()(M,2),_=R[0],T=R[1],q=(0,o.useRef)({value:0,down:!0}),z=Z||String(null==n?void 0:n.id),A=function e(t){t&&N(!0),d.W.get(Z||"".concat(f.Z.apiPrefix,"crons/").concat(n.id,"/log")).then((function(n){var t=n.code,i=n.data;if(200===t&&localStorage.getItem("logCron")===z&&i!==j){var r=i;P(r||a.ZP.get("暂无日志"));var o=Boolean(r&&!(0,g.x$)(r)&&!r.includes("任务未运行"));o||(0,g.x$)(j)||j===a.ZP.get("启动中...")||setTimeout((function(){D()})),B(o),o&&setTimeout((function(){D(),e()}),2e3)}})).finally((function(){t&&N(!1)}))},D=function(){q.current.down&&setTimeout((function(){document.querySelector("#log-flag").scrollIntoView({behavior:"smooth"})}),600)},H=function(){localStorage.removeItem("logCron"),t()};return(0,o.useEffect)((function(){n&&n.id&&i&&(A(!0),q.current.down=!0)}),[n,i]),(0,o.useEffect)((function(){c&&P(c)}),[c]),(0,o.useEffect)((function(){T(document.body.clientWidth<768)}),[]),(0,x.jsx)(s.Z,{title:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(O||S)&&(0,x.jsx)(m.Z,{spin:!0}),!O&&!S&&(0,x.jsx)(p.Z,{}),(0,x.jsx)(l.Z.Text,{ellipsis:!0,style:{marginLeft:5},children:n&&n.name})]}),open:i,centered:!0,className:"log-modal",forceRender:!0,onOk:function(){return H()},onCancel:function(){return H()},footer:[(0,x.jsx)(u.Z,{type:"primary",onClick:function(){return H()},children:a.ZP.get("知道了")})],children:(0,x.jsxs)("div",{onScroll:function(e){var n=e.target.scrollTop;q.current.down&&(q.current={value:n,down:n-q.current.value>-5||!n})},className:"log-container",children:[S?(0,x.jsx)(h.Z,{}):(0,x.jsx)("pre",{style:_?{fontFamily:"Source Code Pro",zoom:.83}:{},children:(0,x.jsx)(v(),{children:j})}),(0,x.jsx)("div",{id:"log-flag"})]})})}},91350:function(e,n,t){t.r(n),t.d(n,{CrontabStatus:function(){return i},OperationName:function(){return r},OperationPath:function(){return a}});var i=function(e){return e[e.running=0]="running",e[e.queued=.5]="queued",e[e.idle=1]="idle",e[e.disabled=2]="disabled",e}({}),r=function(e){return e[e["启用"]=0]="启用",e[e["禁用"]=1]="禁用",e[e["运行"]=2]="运行",e[e["停止"]=3]="停止",e[e["置顶"]=4]="置顶",e[e["取消置顶"]=5]="取消置顶",e}({}),a=function(e){return e[e.enable=0]="enable",e[e.disable=1]="disable",e[e.run=2]="run",e[e.stop=3]="stop",e[e.pin=4]="pin",e[e.unpin=5]="unpin",e}({})},87423:function(e,n,t){function i(e){var n=1e3*e,t=Math.floor(n/864e5),i=n%864e5,r=Math.floor(i/36e5),a=i%36e5,o=Math.floor(a/6e4),c=a%6e4,l=Math.round(c/1e3)+"秒";return o>0&&(l=o+"分"+l),r>0&&(l=r+"小时"+l),t>0&&(l=t+"天"+l),l}t.d(n,{E:function(){return i}})},52105:function(e,n,t){var i=t(41171),r=t(63313),a=t(68098);n.Z=function(){var e=r.useState(!1),n=(0,i.Z)(e,2),t=n[0],o=n[1];return r.useEffect((function(){o((0,a.fk)())}),[]),t}},11847:function(e,n,t){t.d(n,{c4:function(){return a}});var i=t(22481),r=t(88028),a=["xxl","xl","lg","md","sm","xs"],o={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},c=new Map,l=-1,s={},u={matchHandlers:{},dispatch:function(e){return s=e,c.forEach((function(e){return e(s)})),c.size>=1},subscribe:function(e){return c.size||this.register(),l+=1,c.set(l,e),e(s),l},unsubscribe:function(e){c.delete(e),c.size||this.unregister()},unregister:function(){var e=this;Object.keys(o).forEach((function(n){var t=o[n],i=e.matchHandlers[t];null==i||i.mql.removeListener(null==i?void 0:i.listener)})),c.clear()},register:function(){var e=this;Object.keys(o).forEach((function(n){var t=o[n],a=function(t){var a=t.matches;e.dispatch((0,r.Z)((0,r.Z)({},s),(0,i.Z)({},n,a)))},c=window.matchMedia(t);c.addListener(a),e.matchHandlers[t]={mql:c,listener:a},a(c)}))}};n.ZP=u},66216:function(e,n,t){var i=t(63313),r=(0,i.createContext)({});n.Z=r},40630:function(e,n,t){var i=t(22481),r=t(88028),a=t(69947),o=t(84875),c=t.n(o),l=t(63313),s=t(82259),u=t(66216),d=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t};var f=["xs","sm","md","lg","xl","xxl"],m=l.forwardRef((function(e,n){var t,o=l.useContext(s.E_),m=o.getPrefixCls,p=o.direction,h=l.useContext(u.Z),g=h.gutter,Z=h.wrap,v=h.supportFlexGap,x=e.prefixCls,y=e.span,b=e.order,j=e.offset,P=e.push,C=e.pull,w=e.className,S=e.children,N=e.flex,k=e.style,E=d(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),O=m("col",x),B={};f.forEach((function(n){var t,o={},c=e[n];"number"==typeof c?o.span=c:"object"===(0,a.Z)(c)&&(o=c||{}),delete E[n],B=(0,r.Z)((0,r.Z)({},B),(t={},(0,i.Z)(t,"".concat(O,"-").concat(n,"-").concat(o.span),void 0!==o.span),(0,i.Z)(t,"".concat(O,"-").concat(n,"-order-").concat(o.order),o.order||0===o.order),(0,i.Z)(t,"".concat(O,"-").concat(n,"-offset-").concat(o.offset),o.offset||0===o.offset),(0,i.Z)(t,"".concat(O,"-").concat(n,"-push-").concat(o.push),o.push||0===o.push),(0,i.Z)(t,"".concat(O,"-").concat(n,"-pull-").concat(o.pull),o.pull||0===o.pull),(0,i.Z)(t,"".concat(O,"-rtl"),"rtl"===p),t))}));var M=c()(O,(t={},(0,i.Z)(t,"".concat(O,"-").concat(y),void 0!==y),(0,i.Z)(t,"".concat(O,"-order-").concat(b),b),(0,i.Z)(t,"".concat(O,"-offset-").concat(j),j),(0,i.Z)(t,"".concat(O,"-push-").concat(P),P),(0,i.Z)(t,"".concat(O,"-pull-").concat(C),C),t),w,B),R={};if(g&&g[0]>0){var _=g[0]/2;R.paddingLeft=_,R.paddingRight=_}if(g&&g[1]>0&&!v){var T=g[1]/2;R.paddingTop=T,R.paddingBottom=T}return N&&(R.flex=function(e){return"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(N),!1!==Z||R.minWidth||(R.minWidth=0)),l.createElement("div",(0,r.Z)({},E,{style:(0,r.Z)((0,r.Z)({},R),k),className:M,ref:n}),S)}));n.Z=m},19698:function(e,n,t){var i=t(88028),r=t(22481),a=t(69947),o=t(41171),c=t(84875),l=t.n(c),s=t(63313),u=t(82259),d=t(52105),f=t(11847),m=t(20341),p=t(66216),h=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t};(0,m.b)("top","middle","bottom","stretch"),(0,m.b)("start","end","center","space-around","space-between","space-evenly");function g(e,n){var t=s.useState("string"==typeof e?e:""),i=(0,o.Z)(t,2),r=i[0],c=i[1];return s.useEffect((function(){!function(){if("string"==typeof e&&c(e),"object"===(0,a.Z)(e))for(var t=0;t<f.c4.length;t++){var i=f.c4[t];if(n[i]){var r=e[i];if(void 0!==r)return void c(r)}}}()}),[JSON.stringify(e),n]),r}var Z=s.forwardRef((function(e,n){var t,c=e.prefixCls,m=e.justify,Z=e.align,v=e.className,x=e.style,y=e.children,b=e.gutter,j=void 0===b?0:b,P=e.wrap,C=h(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),w=s.useContext(u.E_),S=w.getPrefixCls,N=w.direction,k=s.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),E=(0,o.Z)(k,2),O=E[0],B=E[1],M=s.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),R=(0,o.Z)(M,2),_=R[0],T=R[1],q=g(Z,_),z=g(m,_),A=(0,d.Z)(),D=s.useRef(j);s.useEffect((function(){var e=f.ZP.subscribe((function(e){T(e);var n=D.current||0;(!Array.isArray(n)&&"object"===(0,a.Z)(n)||Array.isArray(n)&&("object"===(0,a.Z)(n[0])||"object"===(0,a.Z)(n[1])))&&B(e)}));return function(){return f.ZP.unsubscribe(e)}}),[]);var H,I=S("row",c),F=(H=[void 0,void 0],(Array.isArray(j)?j:[j,void 0]).forEach((function(e,n){if("object"===(0,a.Z)(e))for(var t=0;t<f.c4.length;t++){var i=f.c4[t];if(O[i]&&void 0!==e[i]){H[n]=e[i];break}}else H[n]=e})),H),W=l()(I,(t={},(0,r.Z)(t,"".concat(I,"-no-wrap"),!1===P),(0,r.Z)(t,"".concat(I,"-").concat(z),z),(0,r.Z)(t,"".concat(I,"-").concat(q),q),(0,r.Z)(t,"".concat(I,"-rtl"),"rtl"===N),t),v),L={},Y=null!=F[0]&&F[0]>0?F[0]/-2:void 0,V=null!=F[1]&&F[1]>0?F[1]/-2:void 0;if(Y&&(L.marginLeft=Y,L.marginRight=Y),A){var K=(0,o.Z)(F,2);L.rowGap=K[1]}else V&&(L.marginTop=V,L.marginBottom=V);var U=(0,o.Z)(F,2),$=U[0],G=U[1],J=s.useMemo((function(){return{gutter:[$,G],wrap:P,supportFlexGap:A}}),[$,G,P,A]);return s.createElement(p.Z.Provider,{value:J},s.createElement("div",(0,i.Z)({},C,{className:W,style:(0,i.Z)((0,i.Z)({},L),x),ref:n}),y))}));n.Z=Z}}]);
|