@whyour/qinglong 2.21.0 → 2.22.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/.dockerignore +13 -0
- package/.env.example +7 -0
- package/AGENTS.md +2 -2
- package/README-en.md +24 -0
- package/README.md +24 -0
- package/back/protos/api.proto +9 -1
- package/back/protos/cron.proto +4 -1
- package/deploy/kubernetes/README.md +81 -0
- package/deploy/kubernetes/base/kustomization.yaml +5 -0
- package/deploy/kubernetes/base/qinglong.yaml +95 -0
- package/deploy/kubernetes/overlays/example/kustomization.yaml +10 -0
- package/docker/Dockerfile +31 -12
- package/docker/Dockerfile.310 +31 -12
- package/docker/Dockerfile.debian +22 -14
- package/docker/Dockerfile.debian310 +24 -14
- package/docker/build-manifest.cjs +28 -0
- package/docker/verify-build.cjs +49 -0
- package/docs/releases/2.22.0-validation.md +49 -0
- package/docs/releases/2.22.0.md +54 -0
- package/ecosystem.config.js +10 -1
- package/package.json +11 -6
- package/sample/config.sample.sh +17 -2
- package/sample/notify.js +118 -0
- package/sample/notify.py +93 -0
- package/scripts/benchmark-execution.cjs +96 -0
- package/scripts/write-build-info.cjs +27 -0
- package/shell/api.sh +41 -14
- package/shell/check.sh +59 -19
- package/shell/lang/en.sh +6 -0
- package/shell/lang/zh.sh +6 -0
- package/shell/node_path_cache.sh +128 -0
- package/shell/otask.sh +10 -1
- package/shell/preload/sitecustomize.js +5 -1
- package/shell/share.sh +26 -9
- package/shell/start.sh +6 -3
- package/shell/task.sh +13 -3
- package/shell/update.sh +65 -4
- package/static/build/api/clientIp.js +42 -0
- package/static/build/api/config.js +8 -16
- package/static/build/api/cron.js +39 -3
- package/static/build/api/dashboard.js +50 -6
- package/static/build/api/env.js +2 -2
- package/static/build/api/health.js +2 -2
- package/static/build/api/index.js +4 -0
- package/static/build/api/log.js +39 -19
- package/static/build/api/retention.js +63 -0
- package/static/build/api/script.js +23 -22
- package/static/build/api/subscription.js +16 -2
- package/static/build/api/system.js +31 -9
- package/static/build/api/user.js +75 -15
- package/static/build/app.js +63 -54
- package/static/build/bootstrap/database.js +51 -0
- package/static/build/config/const.js +2 -0
- package/static/build/config/grpcCerts.js +4 -4
- package/static/build/config/index.js +0 -4
- package/static/build/config/share.js +5 -4
- package/static/build/config/util.js +136 -41
- package/static/build/data/cron.js +1 -0
- package/static/build/data/notify.js +18 -1
- package/static/build/data/sock.js +1 -0
- package/static/build/loaders/app.js +8 -6
- package/static/build/loaders/db.js +5 -35
- package/static/build/loaders/deps.js +30 -22
- package/static/build/loaders/express.js +44 -32
- package/static/build/loaders/initData.js +10 -7
- package/static/build/loaders/initFile.js +1 -1
- package/static/build/loaders/initTask.js +3 -2
- package/static/build/loaders/server.js +1 -1
- package/static/build/loaders/sock.js +72 -6
- package/static/build/middlewares/monitoring.js +12 -33
- package/static/build/middlewares/protectedPathCase.js +17 -0
- package/static/build/protos/api.js +78 -2
- package/static/build/protos/cron.js +21 -4
- package/static/build/protos/health.js +1 -1
- package/static/build/schedule/addCron.js +76 -10
- package/static/build/schedule/api.js +5 -2
- package/static/build/schedule/client.js +38 -6
- package/static/build/schedule/delCron.js +11 -1
- package/static/build/schedule/health.js +72 -7
- package/static/build/services/config.js +5 -42
- package/static/build/services/cron.js +353 -164
- package/static/build/services/dependence.js +66 -18
- package/static/build/services/grpc.js +2 -2
- package/static/build/services/health.js +4 -7
- package/static/build/services/http.js +9 -3
- package/static/build/services/log.js +2 -3
- package/static/build/services/metrics.js +46 -14
- package/static/build/services/notify.js +73 -5
- package/static/build/services/retention.js +123 -0
- package/static/build/services/schedule.js +57 -33
- package/static/build/services/script.js +4 -5
- package/static/build/services/subscription.js +57 -34
- package/static/build/services/system.js +49 -11
- package/static/build/services/user.js +244 -31
- package/static/build/shared/auth.js +22 -3
- package/static/build/shared/authMutation.js +17 -0
- package/static/build/shared/childProcess.js +82 -0
- package/static/build/shared/clientIp.js +27 -0
- package/static/build/shared/errors.js +9 -0
- package/static/build/shared/fileAccess.js +60 -0
- package/static/build/shared/i18n.js +62 -4
- package/static/build/shared/logReader.js +85 -0
- package/static/build/shared/logStreamManager.js +80 -60
- package/static/build/shared/pLimit.js +3 -2
- package/static/build/shared/password.js +30 -0
- package/static/build/shared/retention.js +58 -0
- package/static/build/shared/runCron.js +28 -15
- package/static/build/shared/schedulerMutationLock.js +44 -0
- package/static/build/shared/schedulerReadiness.js +82 -0
- package/static/build/shared/schemaMigrations.js +58 -0
- package/static/build/shared/startupProcess.js +48 -0
- package/static/build/shared/store.js +7 -0
- package/static/build/shared/trustProxy.js +119 -0
- package/static/build/validation/schedule.js +12 -3
- package/static/dist/{1885.e1ea09f6.async.js → 1885.b8f427bf.async.js} +1 -1
- package/static/dist/2031.6af40025.async.js +1 -0
- package/static/dist/2693.51c2636b.async.js +1 -0
- package/static/dist/{2890.9e373f5b.async.js → 2890.add55e85.async.js} +1 -1
- package/static/dist/2901.2ca95295.async.js +1 -0
- package/static/dist/445.a65ff63b.async.js +1 -0
- package/static/dist/4736.1d2b5cb6.async.js +1 -0
- package/static/dist/{4859.6592cebb.async.js → 4859.97d6653c.async.js} +1 -1
- package/static/dist/{6013.4e38de36.async.js → 6013.db535339.async.js} +1 -1
- package/static/dist/6212.9e6d9913.async.js +1 -0
- package/static/dist/{6339.ab305e96.async.js → 6431.4603ad0e.async.js} +1 -1
- package/static/dist/{6872.42f939f1.async.js → 6872.a503ef55.async.js} +1 -1
- package/static/dist/7231.f7e5b668.async.js +1 -0
- package/static/dist/{7355.f9f263d8.async.js → 7355.fca746f5.async.js} +1 -1
- package/static/dist/{7508.7dcee91c.async.js → 7508.d90eac63.async.js} +1 -1
- package/static/dist/{7984.594296a5.async.js → 7984.eaac7402.async.js} +1 -1
- package/static/dist/8844.a0fef08e.async.js +1 -0
- package/static/dist/index.html +2 -2
- package/static/dist/layouts__index.633d3553.async.js +1 -0
- package/static/dist/preload_helper.cf7de3fa.js +1 -0
- package/static/dist/{src__pages__config__index.a22ff7dc.async.js → src__pages__config__index.9aba4054.async.js} +1 -1
- package/static/dist/src__pages__crontab__detail.86b2eebb.async.js +1 -0
- package/static/dist/src__pages__crontab__index.ae4e06f2.async.js +1 -0
- package/static/dist/{src__pages__crontab__logModal.0b8cce8c.async.js → src__pages__crontab__logModal.930535e2.async.js} +1 -1
- package/static/dist/src__pages__crontab__modal.a2c8fdcc.async.js +1 -0
- package/static/dist/src__pages__crontab__viewCreateModal.7b4f9cbe.async.js +1 -0
- package/static/dist/src__pages__crontab__viewManageModal.cd454ea0.async.js +1 -0
- package/static/dist/src__pages__dashboard__index.243c5a35.async.js +1 -0
- package/static/dist/src__pages__dashboard__taskResultModal.7795d6e1.async.js +1 -0
- package/static/dist/src__pages__dependence__index.874d501f.async.js +1 -0
- package/static/dist/src__pages__dependence__logModal.154efe7a.async.js +1 -0
- package/static/dist/src__pages__dependence__modal.a29c1a0f.async.js +1 -0
- package/static/dist/{src__pages__diff__index.013b7c75.async.js → src__pages__diff__index.1714b941.async.js} +1 -1
- package/static/dist/src__pages__env__editNameModal.c13d47d2.async.js +1 -0
- package/static/dist/src__pages__env__index.fd6fd2b0.async.js +1 -0
- package/static/dist/src__pages__env__modal.4d71adb3.async.js +1 -0
- package/static/dist/src__pages__error__index.aae50c94.async.js +1 -0
- package/static/dist/src__pages__initialization__index.82a2e967.async.js +1 -0
- package/static/dist/src__pages__log__index.71250e0d.async.js +1 -0
- package/static/dist/{src__pages__login__index.8c813eb1.async.js → src__pages__login__index.a0fd5ed8.async.js} +1 -1
- package/static/dist/src__pages__script__editModal.22acdf7c.async.js +1 -0
- package/static/dist/src__pages__script__editNameModal.1a521cc0.async.js +1 -0
- package/static/dist/src__pages__script__index.a18b2692.async.js +1 -0
- package/static/dist/src__pages__script__renameModal.0ab029e7.async.js +1 -0
- package/static/dist/src__pages__script__saveModal.8965b74c.async.js +1 -0
- package/static/dist/src__pages__script__setting.35ad4f02.async.js +1 -0
- package/static/dist/src__pages__setting__appModal.7eaeb9d3.async.js +1 -0
- package/static/dist/src__pages__setting__checkUpdate.d175b154.async.js +1 -0
- package/static/dist/src__pages__setting__clientIp.3a8711ed.async.js +1 -0
- package/static/dist/src__pages__setting__dependence.9c0f749b.async.js +1 -0
- package/static/dist/src__pages__setting__index.cb397741.async.js +1 -0
- package/static/dist/src__pages__setting__loginLog.e0a1f54d.async.js +1 -0
- package/static/dist/src__pages__setting__notification.2ffe4e5a.async.js +1 -0
- package/static/dist/src__pages__setting__other.3d0b8492.async.js +1 -0
- package/static/dist/{src__pages__setting__progress.8823ac90.async.js → src__pages__setting__progress.2ccae3d7.async.js} +1 -1
- package/static/dist/src__pages__setting__security.e2d71ebb.async.js +1 -0
- package/static/dist/src__pages__setting__systemLog.b3046955.async.js +1 -0
- package/static/dist/src__pages__subscription__index.43086a06.async.js +1 -0
- package/static/dist/src__pages__subscription__logModal.cdba5139.async.js +1 -0
- package/static/dist/src__pages__subscription__modal.38991e1e.async.js +1 -0
- package/static/dist/{umi.ca04a019.js → umi.fc019050.js} +1 -1
- package/test/back/auth-security.test.cjs +74 -0
- package/test/back/build-provenance.test.cjs +150 -0
- package/test/back/cron-log-name.test.cjs +110 -0
- package/test/back/cron-validation.test.cjs +45 -0
- package/test/back/dashboard-failures.test.cjs +173 -0
- package/test/back/database-bootstrap.test.cjs +193 -0
- package/test/back/dependence-cache-status.test.cjs +125 -0
- package/test/back/deprecated-file-routes.test.cjs +82 -0
- package/test/back/ecosystem.test.cjs +28 -0
- package/test/back/env-name-parsing.test.cjs +96 -0
- package/test/back/execution-lifecycle.test.cjs +236 -0
- package/test/back/file-access-security.test.cjs +47 -0
- package/test/back/fileTreeListing.test.cjs +57 -0
- package/test/back/grpc-cron-response.test.cjs +60 -0
- package/test/back/http-exclusive-listen.test.cjs +31 -0
- package/test/back/http-security.test.cjs +213 -0
- package/test/back/listen-security.test.cjs +67 -0
- package/test/back/log-path-security.test.cjs +158 -0
- package/test/back/logReader.test.cjs +72 -0
- package/test/back/manual-execution.test.cjs +85 -0
- package/test/back/manual-stop-claim.test.cjs +220 -0
- package/test/back/metrics.test.cjs +34 -0
- package/test/back/monitoring.test.cjs +73 -0
- package/test/back/node-path-cache.test.cjs +173 -0
- package/test/back/node-path-lock.test.cjs +178 -0
- package/test/back/npm-publication.test.cjs +70 -0
- package/test/back/primary-apm.test.cjs +24 -0
- package/test/back/process-exit-state.test.cjs +81 -0
- package/test/back/process-stop-signal.test.cjs +77 -0
- package/test/back/protected-path-case.test.cjs +58 -0
- package/test/back/qlServiceLogCommand.test.cjs +128 -0
- package/test/back/retention.test.cjs +131 -0
- package/test/back/role-loading.test.cjs +118 -0
- package/test/back/schedule-health.test.cjs +86 -0
- package/test/back/scheduler-file-lock.test.cjs +51 -0
- package/test/back/scheduler-mutation.test.cjs +312 -0
- package/test/back/scheduler-readiness.test.cjs +85 -0
- package/test/back/scheduler-reconciliation.test.cjs +152 -0
- package/test/back/scheduler-rpc-timeout.test.cjs +49 -0
- package/test/back/schema-migrations.test.cjs +127 -0
- package/test/back/shell-api-parsing.test.cjs +184 -0
- package/test/back/sock-polling.test.cjs +297 -0
- package/test/back/sock-security.test.cjs +72 -0
- package/test/back/start-env-preservation.test.cjs +53 -0
- package/test/back/stop-failure-feedback.test.cjs +158 -0
- package/test/back/stop-race.test.cjs +167 -0
- package/test/back/subscription-cleanup.test.cjs +53 -0
- package/test/back/subscription-stop-state.test.cjs +66 -0
- package/test/back/system-dependence-cache.test.cjs +126 -0
- package/test/back/task-time.test.cjs +116 -0
- package/test/back/user-api.test.cjs +99 -0
- package/test/back/user-security.test.cjs +248 -0
- package/test/back/worker-apm.test.cjs +84 -0
- package/test/back/wpush-grpc.test.cjs +115 -0
- package/test/front/cron-log-pagination.test.cjs +214 -0
- package/test/front/http-auth.test.cjs +152 -0
- package/test/front/http-error.test.cjs +29 -0
- package/test/helpers/load-security-module.cjs +42 -0
- package/version.yaml +19 -34
- package/CLAUDE.md +0 -43
- package/static/dist/1147.c420132e.async.js +0 -1
- package/static/dist/134.54df9e38.async.js +0 -1
- package/static/dist/2208.f7ba3dfa.async.js +0 -1
- package/static/dist/2286.164bb089.async.js +0 -1
- package/static/dist/3191.63263871.async.js +0 -1
- package/static/dist/4902.555f92ab.async.js +0 -1
- package/static/dist/5520.ff2cfd6b.async.js +0 -1
- package/static/dist/6431.c50479be.async.js +0 -1
- package/static/dist/8826.2447a104.async.js +0 -1
- package/static/dist/layouts__index.a7a2bfe0.async.js +0 -1
- package/static/dist/preload_helper.0431c0f3.js +0 -1
- package/static/dist/src__pages__crontab__detail.b9c36808.async.js +0 -1
- package/static/dist/src__pages__crontab__index.fed99fd0.async.js +0 -1
- package/static/dist/src__pages__crontab__modal.f7041c7c.async.js +0 -1
- package/static/dist/src__pages__crontab__viewCreateModal.4d589f66.async.js +0 -1
- package/static/dist/src__pages__crontab__viewManageModal.0e317746.async.js +0 -1
- package/static/dist/src__pages__dashboard__index.b30f2f47.async.js +0 -1
- package/static/dist/src__pages__dependence__index.3d87ceac.async.js +0 -1
- package/static/dist/src__pages__dependence__logModal.0681830b.async.js +0 -1
- package/static/dist/src__pages__dependence__modal.11124896.async.js +0 -1
- package/static/dist/src__pages__env__editNameModal.5d264b25.async.js +0 -1
- package/static/dist/src__pages__env__index.baa27d4e.async.js +0 -1
- package/static/dist/src__pages__env__modal.7f2ef1bc.async.js +0 -1
- package/static/dist/src__pages__error__index.f156b45e.async.js +0 -1
- package/static/dist/src__pages__initialization__index.e96d4ba8.async.js +0 -1
- package/static/dist/src__pages__log__index.e0978bae.async.js +0 -1
- package/static/dist/src__pages__script__editModal.cbf4ec0e.async.js +0 -1
- package/static/dist/src__pages__script__editNameModal.3e7e100d.async.js +0 -1
- package/static/dist/src__pages__script__index.2765d1b8.async.js +0 -1
- package/static/dist/src__pages__script__renameModal.5e987ef5.async.js +0 -1
- package/static/dist/src__pages__script__saveModal.3f9d23d6.async.js +0 -1
- package/static/dist/src__pages__script__setting.a535793a.async.js +0 -1
- package/static/dist/src__pages__setting__appModal.251cd14f.async.js +0 -1
- package/static/dist/src__pages__setting__checkUpdate.46efe057.async.js +0 -1
- package/static/dist/src__pages__setting__dependence.8a7a9529.async.js +0 -1
- package/static/dist/src__pages__setting__index.cc85fdfb.async.js +0 -1
- package/static/dist/src__pages__setting__loginLog.cea6056c.async.js +0 -1
- package/static/dist/src__pages__setting__notification.390fc905.async.js +0 -1
- package/static/dist/src__pages__setting__other.b22d2165.async.js +0 -1
- package/static/dist/src__pages__setting__security.598720a8.async.js +0 -1
- package/static/dist/src__pages__setting__systemLog.67406721.async.js +0 -1
- package/static/dist/src__pages__subscription__index.d0ab2abc.async.js +0 -1
- package/static/dist/src__pages__subscription__logModal.3864b37f.async.js +0 -1
- package/static/dist/src__pages__subscription__modal.3562c670.async.js +0 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
const assert = require('node:assert/strict');
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const fsp = require('node:fs/promises');
|
|
5
|
+
const os = require('node:os');
|
|
6
|
+
const path = require('node:path');
|
|
7
|
+
const vm = require('node:vm');
|
|
8
|
+
const ts = require('typescript');
|
|
9
|
+
const { readLogChunk } = require('../../back/shared/logReader');
|
|
10
|
+
|
|
11
|
+
const source = fs.readFileSync(
|
|
12
|
+
path.join(__dirname, '../../src/pages/crontab/logModal.tsx'),
|
|
13
|
+
'utf8',
|
|
14
|
+
);
|
|
15
|
+
const ast = ts.createSourceFile(
|
|
16
|
+
'logModal.tsx',
|
|
17
|
+
source,
|
|
18
|
+
ts.ScriptTarget.Latest,
|
|
19
|
+
true,
|
|
20
|
+
ts.ScriptKind.TSX,
|
|
21
|
+
);
|
|
22
|
+
const declarations = new Map();
|
|
23
|
+
function visit(node) {
|
|
24
|
+
if (
|
|
25
|
+
ts.isVariableDeclaration(node) &&
|
|
26
|
+
['getCronLog', 'cancel'].includes(node.name.getText(ast))
|
|
27
|
+
)
|
|
28
|
+
declarations.set(node.name.getText(ast), node.initializer.getText(ast));
|
|
29
|
+
ts.forEachChild(node, visit);
|
|
30
|
+
}
|
|
31
|
+
visit(ast);
|
|
32
|
+
|
|
33
|
+
function fixture(get) {
|
|
34
|
+
const timers = new Map();
|
|
35
|
+
const storage = new Map([['logCron', '1']]);
|
|
36
|
+
const values = { content: '', executing: true };
|
|
37
|
+
const pending = [];
|
|
38
|
+
let timerId = 0;
|
|
39
|
+
const context = {
|
|
40
|
+
logUrl: undefined,
|
|
41
|
+
config: { apiPrefix: '/api/' },
|
|
42
|
+
cron: { id: 1 },
|
|
43
|
+
uniqPath: '1',
|
|
44
|
+
LOG_CHUNK_BYTES: 256 * 1024,
|
|
45
|
+
MAX_LOG_VIEW_CHARS: 1024 * 1024,
|
|
46
|
+
logOffsetRef: { current: undefined },
|
|
47
|
+
valueRef: { current: '' },
|
|
48
|
+
pollTimerRef: {},
|
|
49
|
+
request: {
|
|
50
|
+
get(url) {
|
|
51
|
+
const result = get(url);
|
|
52
|
+
pending.push(result);
|
|
53
|
+
return result;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
localStorage: {
|
|
57
|
+
getItem: (key) => storage.get(key),
|
|
58
|
+
removeItem: (key) => storage.delete(key),
|
|
59
|
+
},
|
|
60
|
+
intl: { get: (value) => value },
|
|
61
|
+
setLoading() {},
|
|
62
|
+
autoScroll() {},
|
|
63
|
+
handleCancel() {},
|
|
64
|
+
setValue(value) {
|
|
65
|
+
values.content = value;
|
|
66
|
+
},
|
|
67
|
+
setExecuting(value) {
|
|
68
|
+
values.executing = value;
|
|
69
|
+
},
|
|
70
|
+
setTimeout(fn, delay) {
|
|
71
|
+
timers.set(++timerId, { fn, delay });
|
|
72
|
+
return timerId;
|
|
73
|
+
},
|
|
74
|
+
clearTimeout(id) {
|
|
75
|
+
timers.delete(id);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
vm.createContext(context);
|
|
79
|
+
for (const [name, initializer] of declarations)
|
|
80
|
+
vm.runInContext(
|
|
81
|
+
ts.transpile(`var ${name} = ${initializer}`, {
|
|
82
|
+
target: ts.ScriptTarget.ES2020,
|
|
83
|
+
}),
|
|
84
|
+
context,
|
|
85
|
+
);
|
|
86
|
+
async function settle() {
|
|
87
|
+
await Promise.all(pending.splice(0));
|
|
88
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
values,
|
|
92
|
+
timers,
|
|
93
|
+
start() {
|
|
94
|
+
context.getCronLog(true);
|
|
95
|
+
},
|
|
96
|
+
settle,
|
|
97
|
+
async read() {
|
|
98
|
+
context.getCronLog(true);
|
|
99
|
+
await settle();
|
|
100
|
+
},
|
|
101
|
+
async tick() {
|
|
102
|
+
const [id, timer] = timers.entries().next().value;
|
|
103
|
+
timers.delete(id);
|
|
104
|
+
timer.fn();
|
|
105
|
+
await settle();
|
|
106
|
+
},
|
|
107
|
+
close() {
|
|
108
|
+
context.cancel();
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
test('completed tasks drain unread chunks and display the final exit marker', async (t) => {
|
|
114
|
+
const dir = await fsp.mkdtemp(path.join(os.tmpdir(), 'ql-log-pagination-'));
|
|
115
|
+
t.after(() => fsp.rm(dir, { recursive: true, force: true }));
|
|
116
|
+
const file = path.join(dir, 'task.log');
|
|
117
|
+
await fsp.writeFile(file, 'started\n');
|
|
118
|
+
let running = true;
|
|
119
|
+
const offsets = [];
|
|
120
|
+
const view = fixture(async (url) => {
|
|
121
|
+
const query = new URL(url, 'http://localhost').searchParams;
|
|
122
|
+
const offset = query.has('offset')
|
|
123
|
+
? Number(query.get('offset'))
|
|
124
|
+
: undefined;
|
|
125
|
+
offsets.push(offset);
|
|
126
|
+
const chunk = await readLogChunk(file, {
|
|
127
|
+
offset,
|
|
128
|
+
tail: query.get('tail') === 'true',
|
|
129
|
+
limit: Number(query.get('limit')),
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
code: 200,
|
|
133
|
+
data: chunk.content,
|
|
134
|
+
logStatus: running ? 'running' : 'completed',
|
|
135
|
+
...chunk,
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
await view.read();
|
|
139
|
+
assert.equal(view.timers.values().next().value.delay, 2000);
|
|
140
|
+
await fsp.appendFile(file, 'x'.repeat(600 * 1024) + '\nFINAL_EXIT_CODE=1\n');
|
|
141
|
+
running = false;
|
|
142
|
+
await view.tick();
|
|
143
|
+
assert.equal(view.values.executing, false);
|
|
144
|
+
assert.equal(view.timers.values().next().value.delay, 0);
|
|
145
|
+
await view.tick();
|
|
146
|
+
await view.tick();
|
|
147
|
+
assert.ok(view.values.content.endsWith('FINAL_EXIT_CODE=1\n'));
|
|
148
|
+
assert.equal(view.timers.size, 0);
|
|
149
|
+
assert.deepEqual(offsets, [undefined, 8, 8 + 256 * 1024, 8 + 512 * 1024]);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test('completed tail does not refetch discarded historical data', async () => {
|
|
153
|
+
const view = fixture(async () => ({
|
|
154
|
+
code: 200,
|
|
155
|
+
data: 'tail',
|
|
156
|
+
logStatus: 'completed',
|
|
157
|
+
nextOffset: 900000,
|
|
158
|
+
total: 900000,
|
|
159
|
+
truncated: true,
|
|
160
|
+
}));
|
|
161
|
+
await view.read();
|
|
162
|
+
assert.equal(view.values.content, 'tail');
|
|
163
|
+
assert.equal(view.timers.size, 0);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test('running tasks poll without new bytes and closing cancels polling', async () => {
|
|
167
|
+
const view = fixture(async () => ({
|
|
168
|
+
code: 200,
|
|
169
|
+
data: '',
|
|
170
|
+
logStatus: 'running',
|
|
171
|
+
nextOffset: 0,
|
|
172
|
+
total: 0,
|
|
173
|
+
}));
|
|
174
|
+
await view.read();
|
|
175
|
+
assert.equal(view.values.executing, true);
|
|
176
|
+
assert.equal(view.timers.values().next().value.delay, 2000);
|
|
177
|
+
view.close();
|
|
178
|
+
assert.equal(view.timers.size, 0);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
test('closing ignores an in-flight response with unread data', async () => {
|
|
182
|
+
let resolve;
|
|
183
|
+
const view = fixture(
|
|
184
|
+
() =>
|
|
185
|
+
new Promise((done) => {
|
|
186
|
+
resolve = done;
|
|
187
|
+
}),
|
|
188
|
+
);
|
|
189
|
+
view.start();
|
|
190
|
+
view.close();
|
|
191
|
+
resolve({
|
|
192
|
+
code: 200,
|
|
193
|
+
data: 'late',
|
|
194
|
+
logStatus: 'completed',
|
|
195
|
+
nextOffset: 4,
|
|
196
|
+
total: 100,
|
|
197
|
+
});
|
|
198
|
+
await view.settle();
|
|
199
|
+
assert.equal(view.values.content, '');
|
|
200
|
+
assert.equal(view.timers.size, 0);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
test('legacy and non-advancing completed responses do not loop', async () => {
|
|
204
|
+
for (const pagination of [{}, { nextOffset: 0, total: 100 }]) {
|
|
205
|
+
const view = fixture(async () => ({
|
|
206
|
+
code: 200,
|
|
207
|
+
data: '',
|
|
208
|
+
logStatus: 'completed',
|
|
209
|
+
...pagination,
|
|
210
|
+
}));
|
|
211
|
+
await view.read();
|
|
212
|
+
assert.equal(view.timers.size, 0);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
const assert = require('node:assert/strict');
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const ts = require('typescript');
|
|
6
|
+
const axios = require('axios');
|
|
7
|
+
|
|
8
|
+
function fixture(pathname = '/login', baseUrl = '/') {
|
|
9
|
+
const storage = new Map([['token', 'expired-token']]);
|
|
10
|
+
const pushes = [];
|
|
11
|
+
const history = { location: { pathname }, push: (p) => pushes.push(p) };
|
|
12
|
+
const config = { authKey: 'token', baseUrl };
|
|
13
|
+
const mocks = {
|
|
14
|
+
axios,
|
|
15
|
+
'react-intl-universal': { get: (s) => s },
|
|
16
|
+
antd: {
|
|
17
|
+
message: { config() {}, error() {} },
|
|
18
|
+
notification: { error() {} },
|
|
19
|
+
},
|
|
20
|
+
'./config': config,
|
|
21
|
+
'@umijs/max': { history },
|
|
22
|
+
'./httpError': { getErrorDetails: () => [] },
|
|
23
|
+
};
|
|
24
|
+
const source = fs.readFileSync(
|
|
25
|
+
path.join(__dirname, '../../src/utils/http.tsx'),
|
|
26
|
+
'utf8',
|
|
27
|
+
);
|
|
28
|
+
const { outputText } = ts.transpileModule(source, {
|
|
29
|
+
compilerOptions: {
|
|
30
|
+
module: ts.ModuleKind.CommonJS,
|
|
31
|
+
jsx: ts.JsxEmit.React,
|
|
32
|
+
esModuleInterop: true,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const module = { exports: {} };
|
|
36
|
+
new Function('require', 'module', 'exports', 'localStorage', outputText)(
|
|
37
|
+
(name) => {
|
|
38
|
+
assert.ok(Object.hasOwn(mocks, name), name);
|
|
39
|
+
return mocks[name];
|
|
40
|
+
},
|
|
41
|
+
module,
|
|
42
|
+
module.exports,
|
|
43
|
+
{
|
|
44
|
+
getItem: (k) => storage.get(k) ?? null,
|
|
45
|
+
removeItem: (k) => storage.delete(k),
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
return { request: module.exports.request, storage, pushes };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
for (const pathname of ['/login', '/dashboard']) {
|
|
52
|
+
test(`401 clears expired credentials on ${pathname}`, async () => {
|
|
53
|
+
const { request, storage, pushes } = fixture(pathname);
|
|
54
|
+
await assert.rejects(
|
|
55
|
+
request.get('/api/user', {
|
|
56
|
+
adapter: async (config) => {
|
|
57
|
+
throw new axios.AxiosError(
|
|
58
|
+
'Unauthorized',
|
|
59
|
+
'ERR_BAD_REQUEST',
|
|
60
|
+
config,
|
|
61
|
+
null,
|
|
62
|
+
{ status: 401, data: { message: 'expired' }, config },
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
assert.equal(storage.has('token'), false);
|
|
68
|
+
assert.deepEqual(pushes, pathname === '/login' ? [] : ['/login']);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
for (const baseUrl of ['/', '/panel/']) {
|
|
72
|
+
test(`health is anonymous while protected requests keep credentials (${baseUrl})`, async () => {
|
|
73
|
+
const { request } = fixture('/login', baseUrl);
|
|
74
|
+
const headers = [];
|
|
75
|
+
const adapter = async (config) => {
|
|
76
|
+
headers.push(config.headers.get('Authorization'));
|
|
77
|
+
return { status: 200, data: { code: 200 }, config };
|
|
78
|
+
};
|
|
79
|
+
await request.get(`${baseUrl}api/health`, { adapter });
|
|
80
|
+
await request.get(`${baseUrl}api/user`, { adapter });
|
|
81
|
+
assert.deepEqual(headers, [undefined, 'Bearer expired-token']);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function healthFixture(get) {
|
|
86
|
+
const source = fs.readFileSync(
|
|
87
|
+
path.join(__dirname, '../../src/layouts/index.tsx'),
|
|
88
|
+
'utf8',
|
|
89
|
+
);
|
|
90
|
+
const ast = ts.createSourceFile(
|
|
91
|
+
'index.tsx',
|
|
92
|
+
source,
|
|
93
|
+
ts.ScriptTarget.Latest,
|
|
94
|
+
true,
|
|
95
|
+
ts.ScriptKind.TSX,
|
|
96
|
+
);
|
|
97
|
+
let initializer;
|
|
98
|
+
function visit(node) {
|
|
99
|
+
if (
|
|
100
|
+
ts.isVariableDeclaration(node) &&
|
|
101
|
+
node.name.getText(ast) === 'getHealthStatus'
|
|
102
|
+
)
|
|
103
|
+
initializer = node.initializer;
|
|
104
|
+
ts.forEachChild(node, visit);
|
|
105
|
+
}
|
|
106
|
+
visit(ast);
|
|
107
|
+
assert.ok(initializer, 'layout health bootstrap exists');
|
|
108
|
+
const { outputText } = ts.transpileModule(
|
|
109
|
+
`const bootstrap = ${initializer.getText(ast)};`,
|
|
110
|
+
{
|
|
111
|
+
compilerOptions: { target: ts.ScriptTarget.ES2020 },
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
const events = [];
|
|
115
|
+
const bootstrap = new Function(
|
|
116
|
+
'request',
|
|
117
|
+
'config',
|
|
118
|
+
'history',
|
|
119
|
+
'window',
|
|
120
|
+
'getSystemInfo',
|
|
121
|
+
'setInitLoading',
|
|
122
|
+
`${outputText}; return bootstrap;`,
|
|
123
|
+
)(
|
|
124
|
+
{ get },
|
|
125
|
+
{ apiPrefix: '/api/' },
|
|
126
|
+
{ push: (p) => events.push(p) },
|
|
127
|
+
{ location: { reload: () => events.push('reload') } },
|
|
128
|
+
() => events.push('system'),
|
|
129
|
+
(value) => events.push(['loading', value]),
|
|
130
|
+
);
|
|
131
|
+
return { bootstrap, events };
|
|
132
|
+
}
|
|
133
|
+
for (const status of [401, 503, undefined]) {
|
|
134
|
+
test(`health failure ${
|
|
135
|
+
status ?? 'network'
|
|
136
|
+
} settles without reloading`, async () => {
|
|
137
|
+
const { bootstrap, events } = healthFixture(async () => {
|
|
138
|
+
throw status ? { response: { status } } : new Error('Network Error');
|
|
139
|
+
});
|
|
140
|
+
bootstrap();
|
|
141
|
+
await new Promise(setImmediate);
|
|
142
|
+
assert.deepEqual(events, ['/error', ['loading', false]]);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
test('healthy bootstrap continues loading system information', async () => {
|
|
146
|
+
const { bootstrap, events } = healthFixture(async () => ({
|
|
147
|
+
data: { status: 'ok' },
|
|
148
|
+
}));
|
|
149
|
+
bootstrap();
|
|
150
|
+
await new Promise(setImmediate);
|
|
151
|
+
assert.deepEqual(events, ['system', ['loading', false]]);
|
|
152
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const assert = require('node:assert/strict');
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
|
|
4
|
+
const { getErrorDetails } = require('../../src/utils/httpError');
|
|
5
|
+
|
|
6
|
+
test('validation errors include the failing field names', () => {
|
|
7
|
+
const details = getErrorDetails({
|
|
8
|
+
message: 'Validation failed',
|
|
9
|
+
validation: {
|
|
10
|
+
body: {
|
|
11
|
+
source: 'body',
|
|
12
|
+
keys: ['labels', 'allow_multiple_instances'],
|
|
13
|
+
message: 'request body contains invalid values',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
assert.deepEqual(details, [
|
|
19
|
+
'labels: request body contains invalid values',
|
|
20
|
+
'allow_multiple_instances: request body contains invalid values',
|
|
21
|
+
]);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('existing API error details remain visible', () => {
|
|
25
|
+
assert.deepEqual(
|
|
26
|
+
getErrorDetails({ errors: [{ message: 'duplicate value', value: 'foo' }] }),
|
|
27
|
+
['duplicate value (foo)'],
|
|
28
|
+
);
|
|
29
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const fs = require('node:fs');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const { createRequire } = require('node:module');
|
|
4
|
+
const ts = require('typescript');
|
|
5
|
+
|
|
6
|
+
module.exports = function loadSecurityModule(
|
|
7
|
+
file,
|
|
8
|
+
mocks = {},
|
|
9
|
+
cache = new Map(),
|
|
10
|
+
) {
|
|
11
|
+
file = path.resolve(file);
|
|
12
|
+
if (cache.has(file)) return cache.get(file).exports;
|
|
13
|
+
const module = { exports: {} };
|
|
14
|
+
cache.set(file, module);
|
|
15
|
+
const localRequire = createRequire(file);
|
|
16
|
+
const requireModule = (name) => {
|
|
17
|
+
if (Object.hasOwn(mocks, name)) return mocks[name];
|
|
18
|
+
if (name.startsWith('.')) {
|
|
19
|
+
const target = path.resolve(path.dirname(file), name);
|
|
20
|
+
if (fs.existsSync(`${target}.ts`)) {
|
|
21
|
+
return loadSecurityModule(`${target}.ts`, mocks, cache);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return localRequire(name);
|
|
25
|
+
};
|
|
26
|
+
const { outputText } = ts.transpileModule(fs.readFileSync(file, 'utf8'), {
|
|
27
|
+
compilerOptions: {
|
|
28
|
+
module: ts.ModuleKind.CommonJS,
|
|
29
|
+
target: ts.ScriptTarget.ES2020,
|
|
30
|
+
experimentalDecorators: true,
|
|
31
|
+
esModuleInterop: true,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
// Use the host realm: express-unless checks RegExp with instanceof.
|
|
35
|
+
new Function('require', 'module', 'exports', '__dirname', outputText)(
|
|
36
|
+
requireModule,
|
|
37
|
+
module,
|
|
38
|
+
module.exports,
|
|
39
|
+
path.dirname(file),
|
|
40
|
+
);
|
|
41
|
+
return module.exports;
|
|
42
|
+
};
|
package/version.yaml
CHANGED
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
version: 2.
|
|
2
|
-
changeLogLink: https://
|
|
3
|
-
publishTime: 2026-
|
|
1
|
+
version: 2.22.0
|
|
2
|
+
changeLogLink: https://github.com/whyour/qinglong/blob/master/docs/releases/2.22.0.md
|
|
3
|
+
publishTime: 2026-09-26 0000
|
|
4
4
|
changeLog: |
|
|
5
|
-
1.
|
|
6
|
-
2.
|
|
7
|
-
3.
|
|
8
|
-
4.
|
|
9
|
-
5.
|
|
10
|
-
6.
|
|
11
|
-
7. 新增
|
|
12
|
-
8.
|
|
13
|
-
9.
|
|
14
|
-
10.
|
|
15
|
-
11.
|
|
16
|
-
12.
|
|
17
|
-
13.
|
|
18
|
-
14.
|
|
19
|
-
15.
|
|
20
|
-
16.
|
|
21
|
-
17. 修复 work_dir 验证和目录判断
|
|
22
|
-
18. 修复多个 API 问题(getCronById、定时任务参数、任务退出码等)
|
|
23
|
-
19. 修复 ESM 依赖查询路径
|
|
24
|
-
20. 修复 CodeMirror 页面切换多实例崩溃
|
|
25
|
-
21. 修复 IPv6 网络连接问题
|
|
26
|
-
22. 修复内部服务 IP 地址
|
|
27
|
-
23. 修复 gRPC extra_schedules 为空时序列化报错
|
|
28
|
-
24. 修复 HITOKOTO 参数布尔/字符串类型处理
|
|
29
|
-
25. 修复 Server酱 返回错误时 undefined 异常
|
|
30
|
-
26. 修复环境变量 position 数据类型异常
|
|
31
|
-
27. 修复 Docker 健康检查 QlPort 环境变量读取
|
|
32
|
-
28. 修复任务统计日志
|
|
33
|
-
29. 升级 multer 解决 CVE 漏洞
|
|
34
|
-
30. 升级 nodemailer
|
|
35
|
-
|
|
5
|
+
1. 新增独立远程 CLI,覆盖任务、订阅、环境变量、配置、脚本等 OpenAPI
|
|
6
|
+
2. 新增可选面板内部 TypeScript 工具,默认保留 Shell 入口
|
|
7
|
+
3. 仪表盘支持查看今日成功和失败任务明细
|
|
8
|
+
4. 新增客户端 IP 与代理链诊断、可信代理设置和登录 IP 黑名单
|
|
9
|
+
5. 新增历史运行实例和统计数据清理预览、手动清理及数据库压缩
|
|
10
|
+
6. 新增 WPUSH 通知,支持面板、JS、Python 和 gRPC
|
|
11
|
+
7. 新增 ql log 服务日志命令,优化大目录和大日志读取,修复中文日志名
|
|
12
|
+
8. 修复任务结束后大日志尾部未读完的问题
|
|
13
|
+
9. 修复调度锁、调度恢复、执行就绪和任务停止竞争,准确反馈停止失败
|
|
14
|
+
10. 加固密码存储、JWT 与两步验证、文件访问和旧文件接口
|
|
15
|
+
11. 修复登录令牌过期后页面反复刷新,完善任务参数校验提示
|
|
16
|
+
12. 降低常驻依赖、指标缓存和重复 WebSocket 鉴权开销
|
|
17
|
+
13. 优化 Node 路径缓存及 Alpine 并发缓存锁,修复依赖安装状态
|
|
18
|
+
14. 改善启动错误诊断,保留用户 .env 配置,严格处理数据库迁移失败
|
|
19
|
+
15. 镜像增加来源证明、SBOM 和构建产物一致性校验,改进多架构构建
|
|
20
|
+
16. 升级前请备份完整数据;密码迁移后回退旧版需恢复升级前数据或重置账号
|
package/CLAUDE.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<!-- gitnexus:start -->
|
|
2
|
-
# GitNexus — Code Intelligence
|
|
3
|
-
|
|
4
|
-
This project is indexed by GitNexus as **qinglong** (2740 symbols, 6583 relationships, 230 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
|
5
|
-
|
|
6
|
-
> Index stale? Run `node .gitnexus/run.cjs analyze` from the project root — it auto-selects an available runner. No `.gitnexus/run.cjs` yet? `npx gitnexus analyze` (npm 11 crash → `npm i -g gitnexus`; #1939).
|
|
7
|
-
|
|
8
|
-
## Always Do
|
|
9
|
-
|
|
10
|
-
- **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run `impact({target: "symbolName", direction: "upstream"})` and report the blast radius (direct callers, affected processes, risk level) to the user.
|
|
11
|
-
- **MUST run `detect_changes()` before committing** to verify your changes only affect expected symbols and execution flows. For regression review, compare against the default branch: `detect_changes({scope: "compare", base_ref: "develop"})`.
|
|
12
|
-
- **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
|
|
13
|
-
- When exploring unfamiliar code, use `query({query: "concept"})` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
|
|
14
|
-
- When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use `context({name: "symbolName"})`.
|
|
15
|
-
|
|
16
|
-
## Never Do
|
|
17
|
-
|
|
18
|
-
- NEVER edit a function, class, or method without first running `impact` on it.
|
|
19
|
-
- NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
|
|
20
|
-
- NEVER rename symbols with find-and-replace — use `rename` which understands the call graph.
|
|
21
|
-
- NEVER commit changes without running `detect_changes()` to check affected scope.
|
|
22
|
-
|
|
23
|
-
## Resources
|
|
24
|
-
|
|
25
|
-
| Resource | Use for |
|
|
26
|
-
|----------|---------|
|
|
27
|
-
| `gitnexus://repo/qinglong/context` | Codebase overview, check index freshness |
|
|
28
|
-
| `gitnexus://repo/qinglong/clusters` | All functional areas |
|
|
29
|
-
| `gitnexus://repo/qinglong/processes` | All execution flows |
|
|
30
|
-
| `gitnexus://repo/qinglong/process/{name}` | Step-by-step execution trace |
|
|
31
|
-
|
|
32
|
-
## CLI
|
|
33
|
-
|
|
34
|
-
| Task | Read this skill file |
|
|
35
|
-
|------|---------------------|
|
|
36
|
-
| Understand architecture / "How does X work?" | `.claude/skills/gitnexus/gitnexus-exploring/SKILL.md` |
|
|
37
|
-
| Blast radius / "What breaks if I change X?" | `.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md` |
|
|
38
|
-
| Trace bugs / "Why is X failing?" | `.claude/skills/gitnexus/gitnexus-debugging/SKILL.md` |
|
|
39
|
-
| Rename / extract / split / refactor | `.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md` |
|
|
40
|
-
| Tools, resources, schema reference | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |
|
|
41
|
-
| Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |
|
|
42
|
-
|
|
43
|
-
<!-- gitnexus:end -->
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[1147],{3475:function(e,a,i){"use strict";var r=i(72317),t=window.__ENV__QlBaseUrl||"/";a.Z={siteName:r.ZP.get("青龙"),baseUrl:t,apiPrefix:"".concat(t,"api/"),authKey:"token",layouts:[{name:"primary",include:[/.*/],exclude:[/(\/(en|zh))*\/login/]}],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:"ntfy",label:"Ntfy"},{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:"wxPusherBot",label:"wxPusher"},{value:"openiLink",label:"OpeniLink"},{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("推送消息的优先级")}],ntfy:[{label:"ntfyUrl",tip:r.ZP.get("ntfy的url地址,例如 https://ntfy.sh"),required:!0},{label:"ntfyTopic",tip:r.ZP.get("ntfy应用topic"),required:!0},{label:"ntfyPriority",tip:r.ZP.get("推送消息的优先级")},{label:"ntfyToken",tip:r.ZP.get("ntfy应用token")},{label:"ntfyUsername",tip:r.ZP.get("ntfy应用用户名")},{label:"ntfyPassword",tip:r.ZP.get("ntfy应用密码")},{label:"ntfyActions",tip:r.ZP.get("ntfy用户动作")}],chat:[{label:"synologyChatUrl",tip:r.ZP.get("synologyChat的url地址"),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("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")},{label:"pushplusTemplate",tip:r.ZP.get("发送模板")},{label:"pushplusChannel",tip:r.ZP.get("发送渠道")},{label:"pushplusWebhook",tip:r.ZP.get("webhook编码")},{label:"pushplusCallbackUrl",tip:r.ZP.get("发送结果回调地址")},{label:"pushplusTo",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,为空默认使用专业版")}],wxPusherBot:[{label:"wxPusherBotAppToken",tip:r.ZP.get("wxPusherBot的appToken"),required:!0},{label:"wxPusherBotTopicIds",tip:r.ZP.get("wxPusherBot的topicIds"),required:!1},{label:"wxPusherBotUids",tip:r.ZP.get("wxPusherBot的uids"),required:!1}],openiLink:[{label:"openiLinkAppToken",tip:r.ZP.get("OpeniLink的app_token,在OpeniLink Hub后台安装App后获取,参考 https://openilink.com/docs/hub/apps"),required:!0},{label:"openiLinkHubUrl",tip:r.ZP.get("OpeniLink Hub地址,默认为 https://hub.openilink.com,自建Hub时填写自己的地址")},{label:"openiLinkContextToken",tip:r.ZP.get("OpeniLink的context_token,用于标识消息会话上下文,可从消息事件中获取")}],lark:[{label:"larkKey",tip:r.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0},{label:"larkSecret",tip:r.ZP.get("飞书群组机器人加签密钥,安全设置中开启签名校验后获得")}],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},{label:"emailTo",tip:r.ZP.get("收件邮箱地址,多个分号分隔,默认发送给发件邮箱地址")}],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("依赖管理"),"/dashboard":r.ZP.get("仪表盘")},dependenceTypes:["nodejs","python3","linux"]}},97302:function(e,a,i){"use strict";i.d(a,{eY:function(){return r},um:function(){return t},z:function(){return o}});var r=" ",t={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript",".ini":"ini",".json":"json"},o=["UTC","Africa/Abidjan","Africa/Accra","Africa/Addis Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar es Salaam","Africa/Djibouti","Africa/Douala","Africa/El Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La Rioja","America/Argentina/Mendoza","America/Argentina/Rio Gallegos","America/Argentina/Salta","America/Argentina/San Juan","America/Argentina/San Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa Vista","America/Bogota","America/Boise","America/Cambridge Bay","America/Campo Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Ciudad Juarez","America/Costa Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El Salvador","America/Fort Nelson","America/Fortaleza","America/Glace Bay","America/Goose Bay","America/Grand Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La Paz","America/Lima","America/Los Angeles","America/Lower Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New York","America/Nome","America/Noronha","America/North Dakota/Beulah","America/North Dakota/Center","America/North Dakota/New Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Paramaribo","America/Phoenix","America/Port of Spain","America/Port-au-Prince","America/Porto Velho","America/Puerto Rico","America/Punta Arenas","America/Rankin Inlet","America/Recife","America/Regina","America/Resolute","America/Rio Branco","America/Santarem","America/Santiago","America/Santo Domingo","America/Sao Paulo","America/Scoresbysund","America/Sitka","America/St Barthelemy","America/St Johns","America/St Kitts","America/St Lucia","America/St Thomas","America/St Vincent","America/Swift Current","America/Tegucigalpa","America/Thule","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho Chi Minh","Asia/Hong Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South Georgia","Atlantic/St Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken Hill","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Etc/GMT","Etc/GMT+1","Etc/GMT+10","Etc/GMT+11","Etc/GMT+12","Etc/GMT+2","Etc/GMT+3","Etc/GMT+4","Etc/GMT+5","Etc/GMT+6","Etc/GMT+7","Etc/GMT+8","Etc/GMT+9","Etc/GMT-1","Etc/GMT-10","Etc/GMT-11","Etc/GMT-12","Etc/GMT-13","Etc/GMT-14","Etc/GMT-2","Etc/GMT-3","Etc/GMT-4","Etc/GMT-5","Etc/GMT-6","Etc/GMT-7","Etc/GMT-8","Etc/GMT-9","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle of Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kirov","Europe/Kyiv","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kanton","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"]},16314:function(e,a,i){"use strict";i.d(a,{W:function(){return P}});var r=i(90228),t=i.n(r),o=i(87999),n=i.n(o),c=i(72317),l=i(61508),s=i(33839),u=i(3475),p=i(98783),A=i(69313),g=i(52676);l.ZP.config({duration:2});var d=Date.now(),m=A.Z.create({timeout:6e4,params:{t:d}}),h=["".concat(u.Z.baseUrl,"api/user/login"),"".concat(u.Z.baseUrl,"open/auth/token"),"".concat(u.Z.baseUrl,"api/user/two-factor/login"),"".concat(u.Z.baseUrl,"api/system"),"".concat(u.Z.baseUrl,"api/user/init"),"".concat(u.Z.baseUrl,"api/user/notification/init")];m.interceptors.request.use((function(e){var a=localStorage.getItem(u.Z.authKey);return a&&!h.includes(e.url)?(e.headers.Authorization="Bearer ".concat(a),e):e})),m.interceptors.response.use(function(){var e=n()(t()().mark((function e(a){var i,r,o;return t()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=a.status,![502,504].includes(i)){e.next=5;break}p.history.push("/error"),e.next=18;break;case 5:if(401!==i){e.next=9;break}"/login"!==p.history.location.pathname&&(localStorage.removeItem(u.Z.authKey),p.history.push("/login")),e.next=18;break;case 9:return e.prev=9,200!==(r=a.data).code&&(o=r.message||r.data)&&s.Z.error({message:o,description:null!=r&&r.errors?(0,g.jsx)(g.Fragment,{children:null==r?void 0:r.errors.map((function(e){return(0,g.jsx)("div",{children:e.message})}))}):void 0}),e.abrupt("return",r);case 15:e.prev=15,e.t0=e.catch(9);case 17:case 18:return e.abrupt("return",a);case 19:case"end":return e.stop()}}),e,null,[[9,15]])})));return function(a){return e.apply(this,arguments)}}(),(function(e){if(e.response){var a=e.response.data?e.response.data.message||e.message:e.response.statusText,i=e.response.status;if([502,504].includes(i))p.history.push("/error");else if(401===i)"/login"!==p.history.location.pathname&&(l.ZP.error(c.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(u.Z.authKey),p.history.push("/login"));else{var r,t,o,n;if("function"==typeof(null===(r=e.config)||void 0===r?void 0:r.onError))return null===(n=e.config)||void 0===n?void 0:n.onError(e.response);a&&s.Z.error({message:a,description:null!==(t=e.response)&&void 0!==t&&null!==(t=t.data)&&void 0!==t&&t.errors?(0,g.jsx)(g.Fragment,{children:null===(o=e.response)||void 0===o||null===(o=o.data)||void 0===o||null===(o=o.errors)||void 0===o?void 0:o.map((function(e){return(0,g.jsxs)("div",{children:[e.message," (",e.value,")"]})}))}):void 0})}}else console.log(e.message);return Promise.reject(e)}));var P=m},48916:function(e,a,i){"use strict";i.d(a,{DY:function(){return g},FA:function(){return m},H$:function(){return b},I1:function(){return A},W9:function(){return u},ZP:function(){return s},o4:function(){return f},rS:function(){return P},w7:function(){return p},x$:function(){return d}});var r=i(15558),t=i.n(r),o=i(72317),n=i(97302),c=i(91379),l=i.n(c);function s(){var e=navigator.userAgent.toLowerCase(),a=function(a){return a.test(e)},i=function(a){return(e.match(a)||[]).toString().replace(/[^0-9|_.]/g,"").replace(/_/g,".")},r="unknow";a(/windows|win32|win64|wow32|wow64/g)?r="windows":a(/macintosh|macintel/g)?r="macos":a(/x11/g)?r="linux":a(/android|adr/g)?r="android":a(/ios|iphone|ipad|ipod|iwatch/g)&&(r="ios");var t="unknow";"windows"===r?a(/windows nt 5.0|windows 2000/g)?t="2000":a(/windows nt 5.1|windows xp/g)?t="xp":a(/windows nt 5.2|windows 2003/g)?t="2003":a(/windows nt 6.0|windows vista/g)?t="vista":a(/windows nt 6.1|windows 7/g)?t="7":a(/windows nt 6.2|windows 8/g)?t="8":a(/windows nt 6.3|windows 8.1/g)?t="8.1":a(/windows nt 10.0|windows 10/g)&&(t="10"):"macos"===r?t=i(/os x [\d._]+/g):"android"===r?t=i(/android [\d._]+/g):"ios"===r&&(t=i(/os [\d._]+/g));var o="unknow";"windows"===r||"macos"===r||"linux"===r?o="desktop":("android"===r||"ios"===r||a(/mobile/g))&&(o="mobile");var n="unknow",c="unknow";a(/applewebkit/g)?(n="webkit",a(/edge/g)?c="edge":a(/opr/g)?c="opera":a(/chrome/g)?c="chrome":a(/safari/g)&&(c="safari")):a(/gecko/g)&&a(/firefox/g)?(n="gecko",c="firefox"):a(/presto/g)?(n="presto",c="opera"):a(/trident|compatible|msie/g)&&(n="trident",c="iexplore");var l="unknow";"webkit"===n?l=i(/applewebkit\/[\d._]+/g):"gecko"===n?l=i(/gecko\/[\d._]+/g):"presto"===n?l=i(/presto\/[\d._]+/g):"trident"===n&&(l=i(/trident\/[\d._]+/g));var s="unknow";"chrome"===c?s=i(/chrome\/[\d._]+/g):"safari"===c?s=i(/version\/[\d._]+/g):"firefox"===c?s=i(/firefox\/[\d._]+/g):"opera"===c?s=i(/opr\/[\d._]+/g):"iexplore"===c?s=i(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===c&&(s=i(/edge\/[\d._]+/g));var u="none",p="unknow";a(/micromessenger/g)?(u="wechat",p=i(/micromessenger\/[\d._]+/g)):a(/qqbrowser/g)?(u="qq",p=i(/qqbrowser\/[\d._]+/g)):a(/ucbrowser/g)?(u="uc",p=i(/ucbrowser\/[\d._]+/g)):a(/qihu 360se/g)?u="360":a(/2345explorer/g)?(u="2345",p=i(/2345explorer\/[\d._]+/g)):a(/metasr/g)?u="sougou":a(/lbbrowser/g)?u="liebao":a(/maxthon/g)&&(u="maxthon",p=i(/maxthon\/[\d._]+/g));var A=Object.assign({engine:n,engineVs:l,platform:o,supporter:c,supporterVs:s,system:r,systemVs:t},"none"===u?{}:{shell:u,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(A.system,"/").concat(A.systemVs,"\n浏览器:").concat(A.supporter,"/").concat(A.supporterVs,"\n内核:").concat(A.engine,"/").concat(A.engineVs),"color: green;font-size: 14px;font-weight: bold;"),A}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=e.extraHeight,i=e.target;void 0===a&&(a=99);var r=null,t=0;(r=i||document.querySelector(".ant-table-wrapper"))&&(t=r.getBoundingClientRect().top);var o=document.body.clientHeight-t-a;return o}function p(e,a){var i,r,t=window.URL||window.webkitURL||window,o=new Blob([a]),n=document.createElementNS("http://www.w3.org/1999/xhtml","a");n.href=t.createObjectURL(o),n.download=e,i=n,(r=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(r)}function A(e,a,i){var r=t()(e),o=[];return function e(r){if(r)for(var t=0;t<(null==r?void 0:r.length);t++){if(a(r[t]))return i?void(r[t].children?r[t].children.unshift(i):r[t].children=[i]):void r.splice(t,1);r[t].children&&(o.push(r[t].key),e(r[t].children))}}(r),r}function g(e,a){var i;return function e(r){if(r)for(var t=0;t<(null==r?void 0:r.length);t++)a(r[t])?i=r[t]:r[t].children&&e(r[t].children)}(t()(e)),i}function d(e){return[n.eY,o.ZP.get("执行结束")].some((function(a){return e.includes(a)}))}function m(e){var a=e.split(" ");if("repo"===a[1]||"raw"===a[1])return a[2];var i=a.find((function(e){return[".js",".ts",".sh",".py"].some((function(a){return e.endsWith(a)}))}));if(i){var r,t,o="".concat(window.__ENV__QL_DIR,"/data/scripts");i.startsWith(o)&&(i=i.replace(o,""));var n=i.lastIndexOf("/");return n>=0?(t=i.slice(n+1),r=i.slice(0,n)):(t=i,r=""),[t,r]}}function h(e){try{var a=l().parse(e);if(a)return a.next().toDate()}catch(e){}return null}function P(e,a){var i=h(e);return null!=a&&a.length&&a.forEach((function(e){var a=h(e.schedule);a&&(!i||a<i)&&(i=a)})),i}function b(e){var a=function(e){if(!e)return"";var a=e.split(".");return".".concat(a[a.length-1])}(e);return n.um[a]}function f(){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"}},16130:function(){},6057:function(){}}]);
|