@whyour/qinglong 0.15.6 → 0.16.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.
Files changed (25) hide show
  1. package/docker/310.Dockerfile +2 -1
  2. package/docker/Dockerfile +2 -1
  3. package/package.json +1 -1
  4. package/sample/notify.js +38 -23
  5. package/sample/notify.py +18 -20
  6. package/static/build/api/dependence.js +12 -0
  7. package/static/build/config/util.js +24 -22
  8. package/static/build/data/dependence.js +1 -0
  9. package/static/build/services/dependence.js +35 -4
  10. package/static/build/shared/pLimit.js +18 -5
  11. package/static/dist/{419.f9258e2f.async.js → 419.71c3c9c2.async.js} +1 -1
  12. package/static/dist/8430.0291dda0.async.js +1 -0
  13. package/static/dist/index.html +1 -1
  14. package/static/dist/{layouts__index.817c948a.async.js → layouts__index.a51b2768.async.js} +1 -1
  15. package/static/dist/{src__pages__crontab__detail.7d1c2d15.async.js → src__pages__crontab__detail.2ab4f3e8.async.js} +1 -1
  16. package/static/dist/{src__pages__crontab__index.5aece157.async.js → src__pages__crontab__index.f4269e9c.async.js} +1 -1
  17. package/static/dist/src__pages__dependence__index.52fca7ba.async.js +1 -0
  18. package/static/dist/src__pages__dependence__logModal.baba01d6.async.js +1 -0
  19. package/static/dist/src__pages__dependence__type.860703e8.async.js +1 -0
  20. package/static/dist/{src__pages__log__index.757b3471.async.js → src__pages__log__index.44c6a008.async.js} +1 -1
  21. package/static/dist/{src__pages__script__index.ed44bc1b.async.js → src__pages__script__index.364b93d9.async.js} +1 -1
  22. package/static/dist/{umi.889d3656.js → umi.cbe4d7e7.js} +1 -1
  23. package/version.yaml +6 -12
  24. package/static/dist/src__pages__dependence__index.27d29203.async.js +0 -1
  25. package/static/dist/src__pages__dependence__logModal.b44459a9.async.js +0 -1
@@ -58,7 +58,8 @@ RUN set -x && \
58
58
  rm -rf /root/.pnpm-store && \
59
59
  rm -rf /root/.local/share/pnpm/store && \
60
60
  rm -rf /root/.cache && \
61
- rm -rf /root/.npm
61
+ rm -rf /root/.npm && \
62
+ ulimit -c 0
62
63
 
63
64
  ARG SOURCE_COMMIT
64
65
  RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} && \
package/docker/Dockerfile CHANGED
@@ -59,7 +59,8 @@ RUN set -x && \
59
59
  rm -rf /root/.pnpm-store && \
60
60
  rm -rf /root/.local/share/pnpm/store && \
61
61
  rm -rf /root/.cache && \
62
- rm -rf /root/.npm
62
+ rm -rf /root/.npm && \
63
+ ulimit -c 0
63
64
 
64
65
  ARG SOURCE_COMMIT
65
66
  RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} && \
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
- "version": "0.15.6",
3
+ "version": "0.16.0",
4
4
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
5
  "repository": {
6
6
  "type": "git",
package/sample/notify.js CHANGED
@@ -816,7 +816,18 @@ function ChangeUserId(desp) {
816
816
  }
817
817
  }
818
818
 
819
- function qywxamNotify(text, desp) {
819
+ async function qywxamNotify(text, desp) {
820
+ const MAX_LENGTH = 900;
821
+ if (desp.length > MAX_LENGTH) {
822
+ let d = desp.substr(0, MAX_LENGTH) + "\n==More==";
823
+ await do_qywxamNotify(text, d);
824
+ await qywxamNotify(text, desp.substr(MAX_LENGTH));
825
+ } else {
826
+ return await do_qywxamNotify(text,desp);
827
+ }
828
+ }
829
+
830
+ function do_qywxamNotify(text, desp) {
820
831
  return new Promise((resolve) => {
821
832
  if (QYWX_AM) {
822
833
  const QYWX_AM_AY = QYWX_AM.split(',');
@@ -1315,6 +1326,31 @@ function webhookNotify(text, desp) {
1315
1326
  });
1316
1327
  }
1317
1328
 
1329
+ function parseString(input) {
1330
+ const regex = /(\w+):\s*((?:(?!\n\w+:).)*)/g;
1331
+ const matches = {};
1332
+
1333
+ let match;
1334
+ while ((match = regex.exec(input)) !== null) {
1335
+ const [, key, value] = match;
1336
+ const _key = key.trim();
1337
+ if (!_key || matches[_key]) {
1338
+ continue;
1339
+ }
1340
+
1341
+ const _value = value.trim();
1342
+
1343
+ try {
1344
+ const jsonValue = JSON.parse(_value);
1345
+ matches[_key] = jsonValue;
1346
+ } catch (error) {
1347
+ matches[_key] = _value;
1348
+ }
1349
+ }
1350
+
1351
+ return matches;
1352
+ }
1353
+
1318
1354
  function parseHeaders(headers) {
1319
1355
  if (!headers) return {};
1320
1356
 
@@ -1344,28 +1380,7 @@ function parseBody(body, contentType) {
1344
1380
  return body;
1345
1381
  }
1346
1382
 
1347
- const parsed = {};
1348
- let key;
1349
- let val;
1350
- let i;
1351
-
1352
- body &&
1353
- body.split('\n').forEach(function parser(line) {
1354
- i = line.indexOf(':');
1355
- key = line.substring(0, i).trim();
1356
- val = line.substring(i + 1).trim();
1357
-
1358
- if (!key || parsed[key]) {
1359
- return;
1360
- }
1361
-
1362
- try {
1363
- const jsonValue = JSON.parse(val);
1364
- parsed[key] = jsonValue;
1365
- } catch (error) {
1366
- parsed[key] = val;
1367
- }
1368
- });
1383
+ const parsed = parseString(body);
1369
1384
 
1370
1385
  switch (contentType) {
1371
1386
  case 'multipart/form-data':
package/sample/notify.py CHANGED
@@ -578,7 +578,9 @@ def aibotk(title: str, content: str) -> None:
578
578
  or not push_config.get("AIBOTK_TYPE")
579
579
  or not push_config.get("AIBOTK_NAME")
580
580
  ):
581
- print("智能微秘书 的 AIBOTK_KEY 或者 AIBOTK_TYPE 或者 AIBOTK_NAME 未设置!!\n取消推送")
581
+ print(
582
+ "智能微秘书 的 AIBOTK_KEY 或者 AIBOTK_TYPE 或者 AIBOTK_NAME 未设置!!\n取消推送"
583
+ )
582
584
  return
583
585
  print("智能微秘书 服务启动")
584
586
 
@@ -748,29 +750,25 @@ def parse_headers(headers):
748
750
  return parsed
749
751
 
750
752
 
753
+ def parse_string(input_string):
754
+ matches = {}
755
+ pattern = r'(\w+):\s*((?:(?!\n\w+:).)*)'
756
+ regex = re.compile(pattern)
757
+ for match in regex.finditer(input_string):
758
+ key, value = match.group(1).strip(), match.group(2).strip()
759
+ try:
760
+ json_value = json.loads(value)
761
+ matches[key] = json_value
762
+ except:
763
+ matches[key] = value
764
+ return matches
765
+
766
+
751
767
  def parse_body(body, content_type):
752
768
  if not body or content_type == "text/plain":
753
769
  return body
754
770
 
755
- parsed = {}
756
- lines = body.split("\n")
757
-
758
- for line in lines:
759
- i = line.find(":")
760
- if i == -1:
761
- continue
762
-
763
- key = line[:i].strip()
764
- val = line[i + 1 :].strip()
765
-
766
- if not key or key in parsed:
767
- continue
768
-
769
- try:
770
- json_value = json.loads(val)
771
- parsed[key] = json_value
772
- except:
773
- parsed[key] = val
771
+ parsed = parse_string(input_string)
774
772
 
775
773
  if content_type == "application/x-www-form-urlencoded":
776
774
  data = urlencode(parsed, doseq=True)
@@ -111,5 +111,17 @@ exports.default = (app) => {
111
111
  return next(e);
112
112
  }
113
113
  });
114
+ route.put('/cancel', (0, celebrate_1.celebrate)({
115
+ body: celebrate_1.Joi.array().items(celebrate_1.Joi.number().required()),
116
+ }), async (req, res, next) => {
117
+ try {
118
+ const dependenceService = typedi_1.Container.get(dependence_1.default);
119
+ await dependenceService.cancel(req.body);
120
+ return res.send({ code: 200 });
121
+ }
122
+ catch (e) {
123
+ return next(e);
124
+ }
125
+ });
114
126
  };
115
127
  //# sourceMappingURL=dependence.js.map
@@ -352,30 +352,32 @@ function parseHeaders(headers) {
352
352
  return parsed;
353
353
  }
354
354
  exports.parseHeaders = parseHeaders;
355
+ function parseString(input) {
356
+ const regex = /(\w+):\s*((?:(?!\n\w+:).)*)/g;
357
+ const matches = {};
358
+ let match;
359
+ while ((match = regex.exec(input)) !== null) {
360
+ const [, key, value] = match;
361
+ const _key = key.trim();
362
+ if (!_key || matches[_key]) {
363
+ continue;
364
+ }
365
+ const _value = value.trim();
366
+ try {
367
+ const jsonValue = JSON.parse(_value);
368
+ matches[_key] = jsonValue;
369
+ }
370
+ catch (error) {
371
+ matches[_key] = _value;
372
+ }
373
+ }
374
+ return matches;
375
+ }
355
376
  function parseBody(body, contentType) {
356
377
  if (contentType === 'text/plain' || !body) {
357
378
  return body;
358
379
  }
359
- const parsed = {};
360
- let key;
361
- let val;
362
- let i;
363
- body &&
364
- body.split('\n').forEach(function parser(line) {
365
- i = line.indexOf(':');
366
- key = line.substring(0, i).trim();
367
- val = line.substring(i + 1).trim();
368
- if (!key || parsed[key]) {
369
- return;
370
- }
371
- try {
372
- const jsonValue = JSON.parse(val);
373
- parsed[key] = jsonValue;
374
- }
375
- catch (error) {
376
- parsed[key] = val;
377
- }
378
- });
380
+ const parsed = parseString(body);
379
381
  switch (contentType) {
380
382
  case 'multipart/form-data':
381
383
  return Object.keys(parsed).reduce((p, c) => {
@@ -416,8 +418,8 @@ async function killTask(pid) {
416
418
  }
417
419
  }
418
420
  exports.killTask = killTask;
419
- async function getPid(name) {
420
- const taskCommand = `ps -eo pid,command | grep "${name}" | grep -v grep | awk '{print $1}' | head -1 | xargs echo -n`;
421
+ async function getPid(cmd) {
422
+ const taskCommand = `ps -eo pid,command | grep "${cmd}" | grep -v grep | awk '{print $1}' | head -1 | xargs echo -n`;
421
423
  const pid = await promiseExec(taskCommand);
422
424
  return pid ? Number(pid) : undefined;
423
425
  }
@@ -27,6 +27,7 @@ var DependenceStatus;
27
27
  DependenceStatus[DependenceStatus["removed"] = 4] = "removed";
28
28
  DependenceStatus[DependenceStatus["removeFailed"] = 5] = "removeFailed";
29
29
  DependenceStatus[DependenceStatus["queued"] = 6] = "queued";
30
+ DependenceStatus[DependenceStatus["cancelled"] = 7] = "cancelled";
30
31
  })(DependenceStatus || (exports.DependenceStatus = DependenceStatus = {}));
31
32
  var DependenceTypes;
32
33
  (function (DependenceTypes) {
@@ -80,8 +80,11 @@ let DependenceService = class DependenceService {
80
80
  async removeDb(ids) {
81
81
  await dependence_1.DependenceModel.destroy({ where: { id: ids } });
82
82
  }
83
- async dependencies({ searchValue, type }, sort = { position: -1 }, query = {}) {
83
+ async dependencies({ searchValue, type, status, }, sort = [], query = {}) {
84
84
  let condition = Object.assign(Object.assign({}, query), { type: dependence_1.DependenceTypes[type] });
85
+ if (status) {
86
+ condition.status = status.split(',').map(Number);
87
+ }
85
88
  if (searchValue) {
86
89
  const encodeText = encodeURI(searchValue);
87
90
  const reg = {
@@ -93,7 +96,7 @@ let DependenceService = class DependenceService {
93
96
  condition = Object.assign(Object.assign({}, condition), { name: reg });
94
97
  }
95
98
  try {
96
- const result = await this.find(condition);
99
+ const result = await this.find(condition, sort);
97
100
  return result;
98
101
  }
99
102
  catch (error) {
@@ -111,6 +114,24 @@ let DependenceService = class DependenceService {
111
114
  this.installDependenceOneByOne(docs, true, true);
112
115
  return docs;
113
116
  }
117
+ async cancel(ids) {
118
+ const docs = await dependence_1.DependenceModel.findAll({ where: { id: ids } });
119
+ for (const doc of docs) {
120
+ pLimit_1.default.removeQueuedDependency(doc);
121
+ const depInstallCommand = dependence_1.InstallDependenceCommandTypes[doc.type];
122
+ const depUnInstallCommand = dependence_1.unInstallDependenceCommandTypes[doc.type];
123
+ const installCmd = `${depInstallCommand} ${doc.name.trim()}`;
124
+ const unInstallCmd = `${depUnInstallCommand} ${doc.name.trim()}`;
125
+ const pids = await Promise.all([
126
+ (0, util_1.getPid)(installCmd),
127
+ (0, util_1.getPid)(unInstallCmd),
128
+ ]);
129
+ for (const pid of pids) {
130
+ pid && (await (0, util_1.killTask)(pid));
131
+ }
132
+ }
133
+ await dependence_1.DependenceModel.update({ status: dependence_1.DependenceStatus.cancelled }, { where: { id: ids } });
134
+ }
114
135
  async find(query, sort = []) {
115
136
  const docs = await dependence_1.DependenceModel.findAll({
116
137
  where: Object.assign({}, query),
@@ -133,9 +154,13 @@ let DependenceService = class DependenceService {
133
154
  });
134
155
  }
135
156
  installOrUninstallDependency(dependency, isInstall = true, force = false) {
136
- return pLimit_1.default.runOneByOne(() => {
157
+ return pLimit_1.default.runDependeny(dependency, () => {
137
158
  return new Promise(async (resolve) => {
138
159
  var _a;
160
+ if (pLimit_1.default.firstDependencyId !== dependency.id) {
161
+ return resolve(null);
162
+ }
163
+ pLimit_1.default.removeQueuedDependency(dependency);
139
164
  const depIds = [dependency.id];
140
165
  const status = isInstall
141
166
  ? dependence_1.DependenceStatus.installing
@@ -249,7 +274,13 @@ let DependenceService = class DependenceService {
249
274
  ? dependence_1.DependenceStatus.installFailed
250
275
  : dependence_1.DependenceStatus.removeFailed;
251
276
  }
252
- await dependence_1.DependenceModel.update({ status }, { where: { id: depIds } });
277
+ const docs = await dependence_1.DependenceModel.findAll({ where: { id: depIds } });
278
+ const _docIds = docs
279
+ .filter((x) => x.status !== dependence_1.DependenceStatus.cancelled)
280
+ .map((x) => x.id);
281
+ if (_docIds.length > 0) {
282
+ await dependence_1.DependenceModel.update({ status }, { where: { id: _docIds } });
283
+ }
253
284
  // 如果删除依赖成功或者强制删除
254
285
  if ((isSucceed || force) && !isInstall) {
255
286
  this.removeDb(depIds);
@@ -14,10 +14,16 @@ class TaskLimit {
14
14
  get cronLimitPendingCount() {
15
15
  return this.cronLimit.size;
16
16
  }
17
+ get firstDependencyId() {
18
+ return [...this.queuedDependencyIds.values()][0];
19
+ }
17
20
  constructor() {
18
- this.oneLimit = new p_queue_cjs_1.default({ concurrency: 1 });
21
+ this.dependenyLimit = new p_queue_cjs_1.default({ concurrency: 1 });
22
+ this.queuedDependencyIds = new Set([]);
19
23
  this.updateLogLimit = new p_queue_cjs_1.default({ concurrency: 1 });
20
- this.cronLimit = new p_queue_cjs_1.default({ concurrency: Math.max(os_1.default.cpus().length, 4) });
24
+ this.cronLimit = new p_queue_cjs_1.default({
25
+ concurrency: Math.max(os_1.default.cpus().length, 4),
26
+ });
21
27
  this.setCustomLimit();
22
28
  this.handleEvents();
23
29
  }
@@ -31,7 +37,7 @@ class TaskLimit {
31
37
  this.cronLimit.on('completed', (param) => {
32
38
  logger_1.default.info(`[schedule][任务处理成功] 参数 ${JSON.stringify(param)}`);
33
39
  });
34
- this.cronLimit.on('error', error => {
40
+ this.cronLimit.on('error', (error) => {
35
41
  logger_1.default.error(`[schedule][任务处理错误] 参数 ${JSON.stringify(error)}`);
36
42
  });
37
43
  this.cronLimit.on('next', () => {
@@ -41,6 +47,11 @@ class TaskLimit {
41
47
  logger_1.default.info(`[schedule][任务队列] 空闲中...`);
42
48
  });
43
49
  }
50
+ removeQueuedDependency(dependency) {
51
+ if (this.queuedDependencyIds.has(dependency.id)) {
52
+ this.queuedDependencyIds.delete(dependency.id);
53
+ }
54
+ }
44
55
  async setCustomLimit(limit) {
45
56
  var _a;
46
57
  if (limit) {
@@ -58,8 +69,10 @@ class TaskLimit {
58
69
  async runWithCronLimit(fn, options) {
59
70
  return this.cronLimit.add(fn, options);
60
71
  }
61
- runOneByOne(fn, options) {
62
- return this.oneLimit.add(fn, options);
72
+ runDependeny(dependency, fn, options) {
73
+ this.queuedDependencyIds.add(dependency.id);
74
+ fn.dependency = dependency;
75
+ return this.dependenyLimit.add(fn, options);
63
76
  }
64
77
  updateDepLog(fn, options) {
65
78
  return this.updateLogLimit.add(fn, options);
@@ -1 +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_ob5y15ewlyq.js"]});t.Z=r},91350:function(e,t,a){a.r(t),a.d(t,{CrontabStatus:function(){return r},OperationName:function(){return n},OperationPath:function(){return l}});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}({}),n=function(e){return e[e["启用"]=0]="启用",e[e["禁用"]=1]="禁用",e[e["运行"]=2]="运行",e[e["停止"]=3]="停止",e[e["置顶"]=4]="置顶",e[e["取消置顶"]=5]="取消置顶",e}({}),l=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),n=a.n(r),l=a(25359),i=a.n(l),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),C=a(19631),B=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,l=m.Z.useForm(),o=g()(l,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),W=X[0],O=X[1],E=m.Z.useWatch("filters",o),M=(0,C.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==M?void 0:M.data.map((function(e){return{name:e.name,value:e.id}}))},D=function(){var e=c()(i()().mark((function e(r){var n,l,o,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),r.filterRelation=W,n=t?"put":"post",e.prev=3,e.next=6,x.W[n]("".concat(y.Z.apiPrefix,"crons/views"),t?s()(s()({},r),{},{id:t.id}):r);case 6:l=e.sent,o=l.code,u=l.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=n()(e,_),r=o.getFieldValue(["filters",t,"property"]);return(0,B.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,B.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,B.jsx)(Z.Z,{style:t,children:e.map((function(e){return(0,B.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))})},z=(0,B.jsx)(Z.Z,{style:{width:80},children:U.map((function(e){return(0,B.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))});return(0,B.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,B.jsxs)(m.Z,{form:o,layout:"vertical",name:"env_modal",children:[(0,B.jsx)(m.Z.Item,{name:"name",label:d.ZP.get("视图名称"),rules:[{required:!0,message:d.ZP.get("请输入视图名称")}],children:(0,B.jsx)(b.Z,{placeholder:d.ZP.get("请输入视图名称")})}),(0,B.jsx)(m.Z.List,{name:"filters",children:function(e,t,a){var r=t.add,l=t.remove,i=a.errors;return(0,B.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,B.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,B.jsx)(v.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},onClick:function(){O("and"===W?"or":"and")},children:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("span",{children:A[W]}),(0,B.jsx)(q.Z,{type:"ql-icon-d-caret"})]})})}),(0,B.jsxs)("div",{children:[e.map((function(e){var t,a,r=e.key,i=e.name,o=n()(e,S);return(0,B.jsx)(m.Z.Item,{label:0===i?d.ZP.get("筛选条件"):"",style:{marginBottom:0},required:!0,className:"filter-item",children:(0,B.jsxs)(f.Z,{className:"view-create-modal-filters",align:"baseline",children:[(0,B.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"property"],rules:[{required:!0}],children:F(I,{width:120})})),(0,B.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"operation"],rules:[{required:!0,message:d.ZP.get("请选择操作符")}],children:(0,B.jsx)(L,{name:i})})),(0,B.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"value"],rules:[{required:!0,message:d.ZP.get("请输入内容")}],children:"select"===K[null==E?void 0:E[i].operation]?(t=null==E?void 0:E[i].property,(0,B.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,B.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))})):(0,B.jsx)(b.Z,{placeholder:d.ZP.get("请输入内容")})})),0!==i&&(0,B.jsx)(k.Z,{onClick:function(){return l(i)}})]})},r)})),(0,B.jsx)(m.Z.Item,{children:(0,B.jsxs)("a",{onClick:function(){return r({property:"command",operation:"Reg"})},children:[(0,B.jsx)(w.Z,{}),d.ZP.get("新增筛选条件")]})}),(0,B.jsx)(m.Z.ErrorList,{errors:i})]})]})}}),(0,B.jsx)(m.Z.List,{name:"sorts",children:function(e,t,a){var r=t.add,l=t.remove,i=a.errors;return(0,B.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,B.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,B.jsx)(v.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},children:(0,B.jsx)(B.Fragment,{children:(0,B.jsx)("span",{children:A[W]})})})}),(0,B.jsxs)("div",{children:[e.map((function(e){var t=e.key,a=e.name,r=n()(e,R);return(0,B.jsx)(m.Z.Item,{label:0===a?d.ZP.get("排序方式"):"",style:{marginBottom:0},className:"filter-item",children:(0,B.jsxs)(f.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,B.jsx)(m.Z.Item,s()(s()({},r),{},{name:[a,"property"],rules:[{required:!0}],children:F(I)})),(0,B.jsx)(m.Z.Item,s()(s()({},r),{},{name:[a,"type"],rules:[{required:!0}],children:z})),(0,B.jsx)(k.Z,{onClick:function(){return l(a)}})]})},t)})),(0,B.jsx)(m.Z.Item,{children:(0,B.jsxs)("a",{onClick:function(){return r({property:"command",type:"ASC"})},children:[(0,B.jsx)(w.Z,{}),d.ZP.get("新增排序方式")]})}),(0,B.jsx)(m.Z.ErrorList,{errors:i})]})]})}})]})})}},15207:function(e,t,a){var r=a(88265),n=window.__ENV__QlBaseUrl||"/";t.Z={siteName:r.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: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:"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")}],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("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")}],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}],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),n=a.n(r),l=a(49811),i=a.n(l),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()(n()().mark((function e(t){var a,r,l;return n()().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&&(l=r.message||r.data)&&s.ZP.error({content:l,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}}]);
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 n},OperationPath:function(){return l}});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}({}),n=function(e){return e[e["启用"]=0]="启用",e[e["禁用"]=1]="禁用",e[e["运行"]=2]="运行",e[e["停止"]=3]="停止",e[e["置顶"]=4]="置顶",e[e["取消置顶"]=5]="取消置顶",e}({}),l=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),n=a.n(r),l=a(25359),i=a.n(l),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),C=a(19631),B=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,l=m.Z.useForm(),o=g()(l,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),W=X[0],O=X[1],E=m.Z.useWatch("filters",o),M=(0,C.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==M?void 0:M.data.map((function(e){return{name:e.name,value:e.id}}))},D=function(){var e=c()(i()().mark((function e(r){var n,l,o,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return H(!0),r.filterRelation=W,n=t?"put":"post",e.prev=3,e.next=6,x.W[n]("".concat(y.Z.apiPrefix,"crons/views"),t?s()(s()({},r),{},{id:t.id}):r);case 6:l=e.sent,o=l.code,u=l.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=n()(e,_),r=o.getFieldValue(["filters",t,"property"]);return(0,B.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,B.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,B.jsx)(Z.Z,{style:t,children:e.map((function(e){return(0,B.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))})},z=(0,B.jsx)(Z.Z,{style:{width:80},children:U.map((function(e){return(0,B.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))});return(0,B.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,B.jsxs)(m.Z,{form:o,layout:"vertical",name:"env_modal",children:[(0,B.jsx)(m.Z.Item,{name:"name",label:d.ZP.get("视图名称"),rules:[{required:!0,message:d.ZP.get("请输入视图名称")}],children:(0,B.jsx)(b.Z,{placeholder:d.ZP.get("请输入视图名称")})}),(0,B.jsx)(m.Z.List,{name:"filters",children:function(e,t,a){var r=t.add,l=t.remove,i=a.errors;return(0,B.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,B.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,B.jsx)(v.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},onClick:function(){O("and"===W?"or":"and")},children:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("span",{children:A[W]}),(0,B.jsx)(q.Z,{type:"ql-icon-d-caret"})]})})}),(0,B.jsxs)("div",{children:[e.map((function(e){var t,a,r=e.key,i=e.name,o=n()(e,S);return(0,B.jsx)(m.Z.Item,{label:0===i?d.ZP.get("筛选条件"):"",style:{marginBottom:0},required:!0,className:"filter-item",children:(0,B.jsxs)(f.Z,{className:"view-create-modal-filters",align:"baseline",children:[(0,B.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"property"],rules:[{required:!0}],children:F(I,{width:120})})),(0,B.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"operation"],rules:[{required:!0,message:d.ZP.get("请选择操作符")}],children:(0,B.jsx)(L,{name:i})})),(0,B.jsx)(m.Z.Item,s()(s()({},o),{},{name:[i,"value"],rules:[{required:!0,message:d.ZP.get("请输入内容")}],children:"select"===K[null==E?void 0:E[i].operation]?(t=null==E?void 0:E[i].property,(0,B.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,B.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.name)}))})):(0,B.jsx)(b.Z,{placeholder:d.ZP.get("请输入内容")})})),0!==i&&(0,B.jsx)(k.Z,{onClick:function(){return l(i)}})]})},r)})),(0,B.jsx)(m.Z.Item,{children:(0,B.jsxs)("a",{onClick:function(){return r({property:"command",operation:"Reg"})},children:[(0,B.jsx)(w.Z,{}),d.ZP.get("新增筛选条件")]})}),(0,B.jsx)(m.Z.ErrorList,{errors:i})]})]})}}),(0,B.jsx)(m.Z.List,{name:"sorts",children:function(e,t,a){var r=t.add,l=t.remove,i=a.errors;return(0,B.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,B.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,B.jsx)(v.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},children:(0,B.jsx)(B.Fragment,{children:(0,B.jsx)("span",{children:A[W]})})})}),(0,B.jsxs)("div",{children:[e.map((function(e){var t=e.key,a=e.name,r=n()(e,R);return(0,B.jsx)(m.Z.Item,{label:0===a?d.ZP.get("排序方式"):"",style:{marginBottom:0},className:"filter-item",children:(0,B.jsxs)(f.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,B.jsx)(m.Z.Item,s()(s()({},r),{},{name:[a,"property"],rules:[{required:!0}],children:F(I)})),(0,B.jsx)(m.Z.Item,s()(s()({},r),{},{name:[a,"type"],rules:[{required:!0}],children:z})),(0,B.jsx)(k.Z,{onClick:function(){return l(a)}})]})},t)})),(0,B.jsx)(m.Z.Item,{children:(0,B.jsxs)("a",{onClick:function(){return r({property:"command",type:"ASC"})},children:[(0,B.jsx)(w.Z,{}),d.ZP.get("新增排序方式")]})}),(0,B.jsx)(m.Z.ErrorList,{errors:i})]})]})}})]})})}},15207:function(e,t,a){var r=a(88265),n=window.__ENV__QlBaseUrl||"/";t.Z={siteName:r.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: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:"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")}],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("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")}],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}],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),n=a.n(r),l=a(49811),i=a.n(l),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()(n()().mark((function e(t){var a,r,l;return n()().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&&(l=r.message||r.data)&&s.ZP.error({content:l,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([[8430],{75909:function(t,e,n){"use strict";var r=n(14797),i=n(87807),a=n(16803),c=n(63313),s=n(84875),o=n.n(s),u=n(12888),l=n(15152),f=["className","component","viewBox","spin","rotate","tabIndex","onClick","children"],d=c.forwardRef((function(t,e){var n=t.className,s=t.component,d=t.viewBox,h=t.spin,v=t.rotate,m=t.tabIndex,p=t.onClick,g=t.children,$=(0,a.Z)(t,f);(0,l.Kp)(Boolean(s||g),"Should have `component` prop or `children`."),(0,l.C3)();var y=c.useContext(u.Z),M=y.prefixCls,w=void 0===M?"anticon":M,Z=y.rootClassName,C=o()(Z,w,n),D=o()((0,i.Z)({},"".concat(w,"-spin"),!!h)),S=v?{msTransform:"rotate(".concat(v,"deg)"),transform:"rotate(".concat(v,"deg)")}:void 0,H=(0,r.Z)((0,r.Z)({},l.vD),{},{className:D,style:S,viewBox:d});d||delete H.viewBox;var x=m;return void 0===x&&p&&(x=-1),c.createElement("span",(0,r.Z)((0,r.Z)({role:"img"},$),{},{ref:e,tabIndex:x,onClick:p,className:C}),s?c.createElement(s,(0,r.Z)({},H),g):g?((0,l.Kp)(Boolean(d)||1===c.Children.count(g)&&c.isValidElement(g)&&"use"===c.Children.only(g).type,"Make sure that you provide correct `viewBox` prop (default `0 0 1024 1024`) to the icon."),c.createElement("svg",(0,r.Z)((0,r.Z)({},H),{},{viewBox:d}),g)):null)}));d.displayName="AntdIcon",e.Z=d},55258:function(t,e,n){"use strict";n.d(e,{Z:function(){return f}});var r=n(14797),i=n(16803),a=n(63313),c=n(75909),s=["type","children"],o=new Set;function u(t){return Boolean("string"==typeof t&&t.length&&!o.has(t))}function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t[e];if(u(n)){var r=document.createElement("script");r.setAttribute("src",n),r.setAttribute("data-namespace",n),t.length>e+1&&(r.onload=function(){l(t,e+1)},r.onerror=function(){l(t,e+1)}),o.add(n),document.body.appendChild(r)}}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.scriptUrl,n=t.extraCommonProps,o=void 0===n?{}:n;e&&"undefined"!=typeof document&&"undefined"!=typeof window&&"function"==typeof document.createElement&&(Array.isArray(e)?l(e.reverse()):l([e]));var u=a.forwardRef((function(t,e){var n=t.type,u=t.children,l=(0,i.Z)(t,s),f=null;return t.type&&(f=a.createElement("use",{xlinkHref:"#".concat(n)})),u&&(f=u),a.createElement(c.Z,(0,r.Z)((0,r.Z)((0,r.Z)({},o),l),{},{ref:e}),f)}));return u.displayName="Iconfont",u}},5868:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(14797),i=n(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1a184.31 184.31 0 00-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9a184.31 184.31 0 00-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8a63 63 0 01-63 63H232a63 63 0 01-63-63c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5.2 13 .7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7a273 273 0 0022.7 49c24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2a281.38 281.38 0 00123.2-149.5A120 120 0 01836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7.4-6.4.7-12.8.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3C584 874.3 548.8 884 512 884s-72-9.7-102.9-27.8c-30.3-17.7-55.6-43-73.3-73.3A202.75 202.75 0 01308 680V412h408v268z"}}]},name:"bug",theme:"outlined"},c=n(46420),s=function(t,e){return i.createElement(c.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:a}))};s.displayName="BugOutlined";var o=i.forwardRef(s)},20209:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(14797),i=n(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},c=n(46420),s=function(t,e){return i.createElement(c.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:a}))};s.displayName="ClockCircleOutlined";var o=i.forwardRef(s)},42011:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(14797),i=n(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z"}}]},name:"delete",theme:"filled"},c=n(46420),s=function(t,e){return i.createElement(c.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:a}))};s.displayName="DeleteFilled";var o=i.forwardRef(s)},13740:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(14797),i=n(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},c=n(46420),s=function(t,e){return i.createElement(c.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:a}))};s.displayName="DeleteOutlined";var o=i.forwardRef(s)},97674:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(14797),i=n(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 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},c=n(46420),s=function(t,e){return i.createElement(c.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:a}))};s.displayName="FileTextOutlined";var o=i.forwardRef(s)},65601:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(14797),i=n(63313),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874c-47-47-84-101.7-109.8-162.7C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3 22.2 52.4 53.9 99.5 94.3 139.9 40.4 40.4 87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952c59.4 0 117-11.6 171.3-34.6 52.4-22.2 99.5-53.9 139.9-94.3 40.4-40.4 72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512c0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874c-47 47-101.8 83.9-162.7 109.7-63.1 26.8-130.2 40.3-199.3 40.3z"}}]},name:"loading-3-quarters",theme:"outlined"},c=n(46420),s=function(t,e){return i.createElement(c.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:a}))};s.displayName="Loading3QuartersOutlined";var o=i.forwardRef(s)},32320:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(14797),i=n(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},c=n(46420),s=function(t,e){return i.createElement(c.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:a}))};s.displayName="MinusCircleOutlined";var o=i.forwardRef(s)},28557:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(14797),i=n(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},c=n(46420),s=function(t,e){return i.createElement(c.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:e,icon:a}))};s.displayName="SyncOutlined";var o=i.forwardRef(s)},52053:function(t){t.exports=function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",a="minute",c="hour",s="day",o="week",u="month",l="quarter",f="year",d="date",h="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},g=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},$={s:g,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),a=n-i<0,c=e.clone().add(r+(a?-1:1),u);return+(-(r+(n-i)/(a?i-c:c-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:f,w:o,d:s,D:d,h:c,m:a,s:i,ms:r,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",M={};M[y]=p;var w=function(t){return t instanceof S},Z=function t(e,n,r){var i;if(!e)return y;if("string"==typeof e){var a=e.toLowerCase();M[a]&&(i=a),n&&(M[a]=n,i=a);var c=e.split("-");if(!i&&c.length>1)return t(c[0])}else{var s=e.name;M[s]=e,i=s}return!r&&i&&(y=i),i||!r&&y},C=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},D=$;D.l=Z,D.i=w,D.w=function(t,e){return C(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function p(t){this.$L=Z(t.locale,null,!0),this.parse(t)}var g=p.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(v);if(r){var i=r[2]-1||0,a=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return D},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(t,e){var n=C(t);return this.startOf(e)<=n&&n<=this.endOf(e)},g.isAfter=function(t,e){return C(t)<this.startOf(e)},g.isBefore=function(t,e){return this.endOf(e)<C(t)},g.$g=function(t,e,n){return D.u(t)?this[e]:this.set(n,t)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(t,e){var n=this,r=!!D.u(e)||e,l=D.p(t),h=function(t,e){var i=D.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(s)},v=function(t,e){return D.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},m=this.$W,p=this.$M,g=this.$D,$="set"+(this.$u?"UTC":"");switch(l){case f:return r?h(1,0):h(31,11);case u:return r?h(1,p):h(0,p+1);case o:var y=this.$locale().weekStart||0,M=(m<y?m+7:m)-y;return h(r?g-M:g+(6-M),p);case s:case d:return v($+"Hours",0);case c:return v($+"Minutes",1);case a:return v($+"Seconds",2);case i:return v($+"Milliseconds",3);default:return this.clone()}},g.endOf=function(t){return this.startOf(t,!1)},g.$set=function(t,e){var n,o=D.p(t),l="set"+(this.$u?"UTC":""),h=(n={},n[s]=l+"Date",n[d]=l+"Date",n[u]=l+"Month",n[f]=l+"FullYear",n[c]=l+"Hours",n[a]=l+"Minutes",n[i]=l+"Seconds",n[r]=l+"Milliseconds",n)[o],v=o===s?this.$D+(e-this.$W):e;if(o===u||o===f){var m=this.clone().set(d,1);m.$d[h](v),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else h&&this.$d[h](v);return this.init(),this},g.set=function(t,e){return this.clone().$set(t,e)},g.get=function(t){return this[D.p(t)]()},g.add=function(r,l){var d,h=this;r=Number(r);var v=D.p(l),m=function(t){var e=C(h);return D.w(e.date(e.date()+Math.round(t*r)),h)};if(v===u)return this.set(u,this.$M+r);if(v===f)return this.set(f,this.$y+r);if(v===s)return m(1);if(v===o)return m(7);var p=(d={},d[a]=e,d[c]=n,d[i]=t,d)[v]||1,g=this.$d.getTime()+r*p;return D.w(g,this)},g.subtract=function(t,e){return this.add(-1*t,e)},g.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=D.z(this),a=this.$H,c=this.$m,s=this.$M,o=n.weekdays,u=n.months,l=function(t,n,i,a){return t&&(t[n]||t(e,r))||i[n].slice(0,a)},f=function(t){return D.s(a%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},v={YY:String(this.$y).slice(-2),YYYY:D.s(this.$y,4,"0"),M:s+1,MM:D.s(s+1,2,"0"),MMM:l(n.monthsShort,s,u,3),MMMM:l(u,s),D:this.$D,DD:D.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,o,2),ddd:l(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(a),HH:D.s(a,2,"0"),h:f(1),hh:f(2),a:d(a,c,!0),A:d(a,c,!1),m:String(c),mm:D.s(c,2,"0"),s:String(this.$s),ss:D.s(this.$s,2,"0"),SSS:D.s(this.$ms,3,"0"),Z:i};return r.replace(m,(function(t,e){return e||v[t]||i.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(r,d,h){var v,m=D.p(d),p=C(r),g=(p.utcOffset()-this.utcOffset())*e,$=this-p,y=D.m(this,p);return y=(v={},v[f]=y/12,v[u]=y,v[l]=y/3,v[o]=($-g)/6048e5,v[s]=($-g)/864e5,v[c]=$/n,v[a]=$/e,v[i]=$/t,v)[m]||$,h?y:D.a(y)},g.daysInMonth=function(){return this.endOf(u).$D},g.$locale=function(){return M[this.$L]},g.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=Z(t,e,!0);return r&&(n.$L=r),n},g.clone=function(){return D.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},p}(),H=S.prototype;return C.prototype=H,[["$ms",r],["$s",i],["$m",a],["$H",c],["$W",s],["$M",u],["$y",f],["$D",d]].forEach((function(t){H[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),C.extend=function(t,e){return t.$i||(t(e,S,C),t.$i=!0),C},C.locale=Z,C.isDayjs=w,C.unix=function(t){return C(1e3*t)},C.en=M[y],C.Ls=M,C.p={},C}()}}]);
@@ -10,6 +10,6 @@
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
13
- <script src="./umi.889d3656.js"></script>
13
+ <script src="./umi.cbe4d7e7.js"></script>
14
14
 
15
15
  </body></html>
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[1717],{38582:function(e,t,n){var a=(0,n(55258).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_ob5y15ewlyq.js"]});t.Z=a},80331:function(e,t,n){n.r(t),n.d(t,{default:function(){return N}});var a=n(57213),i=n.n(a),o=n(54306),s=n.n(o),r=n(88265),c=n(63313),u=n(4574),l=n(62284),d=n(71571),h=n(68834),p=n(38582),f=n(11527),m={route:{routes:[{name:r.ZP.get("登录"),path:"/login",hideInMenu:!0,component:"@/pages/login/index"},{name:r.ZP.get("初始化"),path:"/initialization",hideInMenu:!0,component:"@/pages/initialization/index"},{name:r.ZP.get("错误"),path:"/error",hideInMenu:!0,component:"@/pages/error/index"},{path:"/crontab",name:r.ZP.get("定时任务"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-crontab"}),component:"@/pages/crontab/index"},{path:"/subscription",name:r.ZP.get("订阅管理"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-subs"}),component:"@/pages/subscription/index"},{path:"/env",name:r.ZP.get("环境变量"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-env"}),component:"@/pages/env/index"},{path:"/config",name:r.ZP.get("配置文件"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-config"}),component:"@/pages/config/index"},{path:"/script",name:r.ZP.get("脚本管理"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-script"}),component:"@/pages/script/index"},{path:"/dependence",name:r.ZP.get("依赖管理"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-dependence"}),component:"@/pages/dependence/index"},{path:"/log",name:r.ZP.get("日志管理"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-log"}),component:"@/pages/log/index"},{path:"/diff",name:r.ZP.get("对比工具"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-diff"}),component:"@/pages/diff/index"},{path:"/setting",name:r.ZP.get("系统设置"),icon:(0,f.jsx)(h.Z,{}),component:"@/pages/password/index"}]},navTheme:"light",fixSiderbar:!0,contentWidth:"Fixed",splitMenus:!1,siderWidth:180},g=n(14851),v=n(50988),x=n(3513),b=n(63386),k=n(85153),y=n(15207),Z=n(57229),S=n(86563),w=n.n(S),j=n(3094),P=n(12094),I=n(15367),E=n(13217),q=n(34133),C=n(83535),L=n(45638),z=n(79516),T=n(42078),A=n(97724),M=n(82755);var _=n(21758);function N(){var e=(0,g.useLocation)(),t=(0,j.e)(),n=(0,j.F)(),a=n.theme,o=n.reloadTheme,h=(0,c.useState)({}),p=s()(h,2),S=p[0],N=p[1],R=(0,c.useState)(!0),F=s()(R,2),O=F[0],W=F[1],H=(0,c.useState)(),U=s()(H,2),B=U[0],D=U[1],J=(0,c.useState)(!1),K=s()(J,2),Q=K[0],G=K[1],V=(0,c.useState)(!0),X=s()(V,2),Y=X[0],$=X[1],ee=d||{},te=ee.enable,ne=ee.disable,ae=(ee.exportGeneratedCSS,ee.setFetchMethod),ie=ee.auto,oe=function(){Z.W.get("".concat(y.Z.apiPrefix,"system")).then((function(e){var t,n=e.code,a=e.data;200===n&&(D(a),a.isInitialized?(t=a.version,T.S({dsn:"https://49b9ad1a6201bfe027db296ab7c6d672@o1098464.ingest.sentry.io/6122818",integrations:[new A.gE({shouldCreateSpanForRequest:function(e){return!e.includes("/api/ws")&&!e.includes("/api/static")}})],release:t,tracesSampleRate:.1,beforeBreadcrumb:function(e,t){if(e.data&&e.data.url){var n=e.data.url.replace(/token=.*/,"");e.data.url=n}return e}}),M._m.config({paths:{vs:"".concat(y.Z.baseUrl,"monaco-editor/min/vs")},"vs/nls":{availableLanguages:{"*":"zh-cn"}}}),se()):g.history.push("/initialization"))})).catch((function(e){console.log(e)}))},se=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&W(!0),Z.W.get("".concat(y.Z.apiPrefix,"user")).then((function(n){var a=n.code,i=n.data;200===a&&i.username&&(N(i),"/"===e.pathname&&g.history.push("/crontab")),t&&W(!1)})).catch((function(e){console.log(e)}))},re=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];se(e)};if((0,c.useEffect)((function(){B&&B.isInitialized&&!S&&se()}),[e.pathname]),(0,c.useEffect)((function(){Z.W.get("".concat(y.Z.apiPrefix,"public/health")).then((function(e){var t;1===(null==e||null===(t=e.data)||void 0===t?void 0:t.status)?oe():g.history.push("/error")})).catch((function(e){g.history.push("/error")})).finally((function(){return $(!1)}))}),[]),(0,c.useEffect)((function(){"vs-dark"===a?document.body.setAttribute("data-dark","true"):document.body.setAttribute("data-dark","false")}),[a]),(0,c.useEffect)((function(){w()();var e=localStorage.getItem("qinglong_dark_theme")||"auto";if("undefined"!=typeof window&&void 0!==window.matchMedia)return d?(ae(fetch),"dark"===e?te({}):"light"===e?ne():ie({}),function(){ne()}):function(){return null}}),[]),(0,c.useEffect)((function(){if(S&&S.username){var e=_.Z.getInstance("".concat(window.location.origin).concat(y.Z.apiPrefix,"ws?token=").concat(localStorage.getItem(y.Z.authKey)));return function(){e.close()}}}),[S]),(0,c.useEffect)((function(){window.onload=function(){var e=performance.timing;console.log("白屏时间: ".concat(e.responseStart-e.navigationStart)),console.log("请求完毕至DOM加载: ".concat(e.domInteractive-e.responseEnd)),console.log("解释dom树耗时: ".concat(e.domComplete-e.domInteractive)),console.log("从开始至load总耗时: ".concat(e.loadEventEnd-e.navigationStart)),L.uT("白屏时间 ".concat(e.responseStart-e.navigationStart))}}),[]),Y)return(0,f.jsx)(u.Z,{});if(["/login","/initialization","/error"].includes(e.pathname)&&(null!=B&&B.isInitialized&&"/initialization"===e.pathname&&g.history.push("/crontab"),B||"/error"===e.pathname))return(0,f.jsx)(g.Outlet,{context:i()(i()({},t),{},{theme:a,user:S,reloadUser:re,reloadTheme:o})});var ce=navigator.userAgent.includes("Firefox"),ue=navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome"),le=navigator.userAgent.includes("QQBrowser"),de={items:[{label:r.ZP.get("退出登录"),className:"side-menu-user-drop-menu",onClick:function(){Z.W.post("".concat(y.Z.apiPrefix,"user/logout")).then((function(){localStorage.removeItem(y.Z.authKey),g.history.push("/login")}))},key:"logout",icon:(0,f.jsx)(v.Z,{})}]};return O?(0,f.jsx)(u.Z,{}):(0,f.jsx)(l.ZP,i()(i()({selectedKeys:[e.pathname],loading:O,ErrorBoundary:z.SV,logo:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(P.Z,{preview:!1,src:"https://qn.whyour.cn/logo.png"}),(0,f.jsxs)("div",{className:"title",children:[(0,f.jsx)("span",{className:"title",children:r.ZP.get("青龙")}),(0,f.jsx)("a",{href:null==B?void 0:B.changeLogLink,target:"_blank",rel:"noopener noreferrer",onClick:function(e){e.stopPropagation()},children:(0,f.jsx)(I.Z,{title:"develop"===(null==B?void 0:B.branch)?r.ZP.get("开发版"):r.ZP.get("正式版"),children:(0,f.jsx)(E.Z,{size:"small",dot:"develop"===(null==B?void 0:B.branch),children:(0,f.jsxs)("span",{style:{fontSize:ce?9:12,color:"#666",marginLeft:2,zoom:ue?.66:.8,letterSpacing:le?-2:0},children:["v",null==B?void 0:B.version]})})})})]})]}),title:!1,menuItemRender:function(t,n){return t.isUrl||!t.path||e.pathname===t.path?n:(0,f.jsx)(g.Link,{to:t.path,children:n})},pageTitleRender:function(t,n,a){var i=y.Z.documentTitleMap[e.pathname]||r.ZP.get("未找到");return"".concat(i," - ").concat(r.ZP.get("青龙"))},onCollapse:G,collapsed:Q,rightContentRender:function(){return t.isPhone&&(0,f.jsx)(q.Z,{menu:de,placement:"bottomRight",trigger:["click"],children:(0,f.jsxs)("span",{className:"side-menu-user-wrapper",children:[(0,f.jsx)(C.C,{shape:"square",size:"small",icon:(0,f.jsx)(x.Z,{}),src:S.avatar?"".concat(y.Z.apiPrefix,"static/").concat(S.avatar):""}),(0,f.jsx)("span",{style:{marginLeft:5},children:S.username})]})})},collapsedButtonRender:function(e){return(0,f.jsxs)("span",{className:"side-menu-container",onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[!e&&!t.isPhone&&(0,f.jsx)(q.Z,{menu:de,placement:"topLeft",trigger:["hover"],children:(0,f.jsxs)("span",{className:"side-menu-user-wrapper",children:[(0,f.jsx)(C.C,{shape:"square",size:"small",icon:(0,f.jsx)(x.Z,{}),src:S.avatar?"".concat(y.Z.apiPrefix,"static/").concat(S.avatar):""}),(0,f.jsx)("span",{style:{marginLeft:5},children:S.username})]})}),(0,f.jsx)("span",{className:"side-menu-collapse-button",onClick:function(){return G(!e)},children:e?(0,f.jsx)(b.Z,{}):(0,f.jsx)(k.Z,{})})]})}},m),{},{children:(0,f.jsx)(g.Outlet,{context:i()(i()({},t),{},{theme:a,user:S,reloadUser:re,reloadTheme:o,systemInfo:B})})}))}},3094:function(e,t,n){n.d(t,{F:function(){return c},e:function(){return r}});var a=n(54306),i=n.n(a),o=n(63313),s=n(40141),r=function(){var e=(0,o.useState)("100%"),t=i()(e,2),n=t[0],a=t[1],r=(0,o.useState)(0),c=i()(r,2),u=c[0],l=c[1],d=(0,o.useState)(-48),h=i()(d,2),p=h[0],f=h[1],m=(0,o.useState)(!1),g=i()(m,2),v=g[0],x=g[1],b=(0,o.useMemo)((function(){return(0,s.ZP)()}),[]).platform;return(0,o.useEffect)((function(){"mobile"===b&&document.body.offsetWidth<768?(a("auto"),l(0),f(0),x(!0),document.body.setAttribute("data-mode","phone")):(a("100%"),l(0),f(-48),x(!1),document.body.setAttribute("data-mode","desktop"))}),[]),{headerStyle:{padding:"4px 16px 4px 15px",position:"sticky",top:0,left:0,zIndex:20,marginTop:p,width:n,marginLeft:u},isPhone:v}},c=function(){var e=(0,o.useState)(),t=i()(e,2),n=t[0],a=t[1];return(0,o.useEffect)((function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;a(n?"vs-dark":"vs");var i=function(e){"auto"!==t&&t||(e.matches?a("vs-dark"):a("vs"))};"function"==typeof e.addEventListener?e.addEventListener("change",i):"function"==typeof e.addListener&&e.addListener(i)}),[]),{theme:n,reloadTheme:function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;a(n?"vs-dark":"vs")}}}},21758:function(e,t,n){var a=n(93525),i=n.n(a),o=n(12342),s=n.n(o),r=n(25359),c=n.n(r),u=n(49811),l=n.n(u),d=n(21140),h=n.n(d),p=n(63466),f=n.n(p),m=n(52510),g=n.n(m),v=n(78078),x=n.n(v),b=["type"],k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h()(this,e),g()(this,"url",void 0),g()(this,"socket",null),g()(this,"subscriptions",new Map),g()(this,"options",void 0),g()(this,"reconnectAttempts",0),g()(this,"heartbeatTimeout",null),g()(this,"state","closed"),this.url=t,this.options={maxReconnectAttempts:n.maxReconnectAttempts||5,reconnectInterval:n.reconnectInterval||3e3,heartbeatInterval:n.heartbeatInterval||3e4},this.init()}var t,n;return f()(e,[{key:"init",value:(n=l()(c()().mark((function e(){var t=this;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.state="connecting",this.emit("connecting");case 3:if(!(this.reconnectAttempts<this.options.maxReconnectAttempts)){e.next=16;break}return this.socket=new(x())(this.url),this.setupEventListeners(),this.startHeartbeat(),e.next=9,this.waitForClose();case 9:return this.stopHeartbeat(),this.socket=null,this.reconnectAttempts++,e.next=14,new Promise((function(e){return setTimeout(e,t.options.reconnectInterval)}));case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this.handleError(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(){return n.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.socket&&(this.socket.onopen=function(){e.state="open",e.emit("open")},this.socket.onmessage=function(t){var n=JSON.parse(t.data);e.dispatchMessage(n)},this.socket.onclose=function(){e.state="closed",e.emit("close")})}},{key:"waitForClose",value:(t=l()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null===(t=this.socket)||void 0===t?void 0:t.readyState)===x().CLOSED){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,100)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"subscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(!n.has(t)){n.add(t),this.subscriptions.set(e,n);var a={action:"subscribe",topic:e};this.send(a)}}},{key:"unsubscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(n.has(t)){n.delete(t);var a={action:"unsubscribe",topic:e};this.send(a)}}},{key:"send",value:function(e){var t;(null===(t=this.socket)||void 0===t?void 0:t.readyState)===x().OPEN&&this.socket.send(JSON.stringify(e))}},{key:"dispatchMessage",value:function(e){var t=e.type,n=s()(e,b),a=this.subscriptions.get(t)||new Set;i()(a).forEach((function(e){return e(n)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatTimeout=setInterval((function(){var t;(null===(t=e.socket)||void 0===t?void 0:t.readyState)===x().OPEN&&e.socket.send(JSON.stringify({type:"heartbeat"}))}),this.options.heartbeatInterval)}},{key:"stopHeartbeat",value:function(){this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout)}},{key:"close",value:function(){this.socket&&(this.state="closed",this.stopHeartbeat(),this.socket.close(),this.emit("close"))}},{key:"handleError",value:function(e){console.error("WebSocket错误:",e),this.emit("error",e)}},{key:"on",value:function(e,t){}},{key:"emit",value:function(e,t){}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return e.instance||(e.instance=new e(t,n)),e.instance}}]),e}();g()(k,"instance",null),t.Z=k}}]);
1
+ "use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[1717],{38582:function(e,t,n){var a=(0,n(55258).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_lc939gab1iq.js"]});t.Z=a},80331:function(e,t,n){n.r(t),n.d(t,{default:function(){return N}});var a=n(57213),i=n.n(a),o=n(54306),s=n.n(o),r=n(88265),c=n(63313),u=n(4574),l=n(62284),d=n(71571),h=n(68834),p=n(38582),f=n(11527),m={route:{routes:[{name:r.ZP.get("登录"),path:"/login",hideInMenu:!0,component:"@/pages/login/index"},{name:r.ZP.get("初始化"),path:"/initialization",hideInMenu:!0,component:"@/pages/initialization/index"},{name:r.ZP.get("错误"),path:"/error",hideInMenu:!0,component:"@/pages/error/index"},{path:"/crontab",name:r.ZP.get("定时任务"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-crontab"}),component:"@/pages/crontab/index"},{path:"/subscription",name:r.ZP.get("订阅管理"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-subs"}),component:"@/pages/subscription/index"},{path:"/env",name:r.ZP.get("环境变量"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-env"}),component:"@/pages/env/index"},{path:"/config",name:r.ZP.get("配置文件"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-config"}),component:"@/pages/config/index"},{path:"/script",name:r.ZP.get("脚本管理"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-script"}),component:"@/pages/script/index"},{path:"/dependence",name:r.ZP.get("依赖管理"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-dependence"}),component:"@/pages/dependence/index"},{path:"/log",name:r.ZP.get("日志管理"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-log"}),component:"@/pages/log/index"},{path:"/diff",name:r.ZP.get("对比工具"),icon:(0,f.jsx)(p.Z,{type:"ql-icon-diff"}),component:"@/pages/diff/index"},{path:"/setting",name:r.ZP.get("系统设置"),icon:(0,f.jsx)(h.Z,{}),component:"@/pages/password/index"}]},navTheme:"light",fixSiderbar:!0,contentWidth:"Fixed",splitMenus:!1,siderWidth:180},g=n(14851),v=n(50988),x=n(3513),b=n(63386),k=n(85153),y=n(15207),Z=n(57229),S=n(86563),w=n.n(S),j=n(3094),P=n(12094),I=n(15367),E=n(13217),q=n(34133),C=n(83535),L=n(45638),z=n(79516),T=n(42078),A=n(97724),M=n(82755);var _=n(21758);function N(){var e=(0,g.useLocation)(),t=(0,j.e)(),n=(0,j.F)(),a=n.theme,o=n.reloadTheme,h=(0,c.useState)({}),p=s()(h,2),S=p[0],N=p[1],R=(0,c.useState)(!0),F=s()(R,2),O=F[0],W=F[1],H=(0,c.useState)(),U=s()(H,2),B=U[0],D=U[1],J=(0,c.useState)(!1),K=s()(J,2),Q=K[0],G=K[1],V=(0,c.useState)(!0),X=s()(V,2),Y=X[0],$=X[1],ee=d||{},te=ee.enable,ne=ee.disable,ae=(ee.exportGeneratedCSS,ee.setFetchMethod),ie=ee.auto,oe=function(){Z.W.get("".concat(y.Z.apiPrefix,"system")).then((function(e){var t,n=e.code,a=e.data;200===n&&(D(a),a.isInitialized?(t=a.version,T.S({dsn:"https://49b9ad1a6201bfe027db296ab7c6d672@o1098464.ingest.sentry.io/6122818",integrations:[new A.gE({shouldCreateSpanForRequest:function(e){return!e.includes("/api/ws")&&!e.includes("/api/static")}})],release:t,tracesSampleRate:.1,beforeBreadcrumb:function(e,t){if(e.data&&e.data.url){var n=e.data.url.replace(/token=.*/,"");e.data.url=n}return e}}),M._m.config({paths:{vs:"".concat(y.Z.baseUrl,"monaco-editor/min/vs")},"vs/nls":{availableLanguages:{"*":"zh-cn"}}}),se()):g.history.push("/initialization"))})).catch((function(e){console.log(e)}))},se=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&W(!0),Z.W.get("".concat(y.Z.apiPrefix,"user")).then((function(n){var a=n.code,i=n.data;200===a&&i.username&&(N(i),"/"===e.pathname&&g.history.push("/crontab")),t&&W(!1)})).catch((function(e){console.log(e)}))},re=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];se(e)};if((0,c.useEffect)((function(){B&&B.isInitialized&&!S&&se()}),[e.pathname]),(0,c.useEffect)((function(){Z.W.get("".concat(y.Z.apiPrefix,"public/health")).then((function(e){var t;1===(null==e||null===(t=e.data)||void 0===t?void 0:t.status)?oe():g.history.push("/error")})).catch((function(e){g.history.push("/error")})).finally((function(){return $(!1)}))}),[]),(0,c.useEffect)((function(){"vs-dark"===a?document.body.setAttribute("data-dark","true"):document.body.setAttribute("data-dark","false")}),[a]),(0,c.useEffect)((function(){w()();var e=localStorage.getItem("qinglong_dark_theme")||"auto";if("undefined"!=typeof window&&void 0!==window.matchMedia)return d?(ae(fetch),"dark"===e?te({}):"light"===e?ne():ie({}),function(){ne()}):function(){return null}}),[]),(0,c.useEffect)((function(){if(S&&S.username){var e=_.Z.getInstance("".concat(window.location.origin).concat(y.Z.apiPrefix,"ws?token=").concat(localStorage.getItem(y.Z.authKey)));return function(){e.close()}}}),[S]),(0,c.useEffect)((function(){window.onload=function(){var e=performance.timing;console.log("白屏时间: ".concat(e.responseStart-e.navigationStart)),console.log("请求完毕至DOM加载: ".concat(e.domInteractive-e.responseEnd)),console.log("解释dom树耗时: ".concat(e.domComplete-e.domInteractive)),console.log("从开始至load总耗时: ".concat(e.loadEventEnd-e.navigationStart)),L.uT("白屏时间 ".concat(e.responseStart-e.navigationStart))}}),[]),Y)return(0,f.jsx)(u.Z,{});if(["/login","/initialization","/error"].includes(e.pathname)&&(null!=B&&B.isInitialized&&"/initialization"===e.pathname&&g.history.push("/crontab"),B||"/error"===e.pathname))return(0,f.jsx)(g.Outlet,{context:i()(i()({},t),{},{theme:a,user:S,reloadUser:re,reloadTheme:o})});var ce=navigator.userAgent.includes("Firefox"),ue=navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome"),le=navigator.userAgent.includes("QQBrowser"),de={items:[{label:r.ZP.get("退出登录"),className:"side-menu-user-drop-menu",onClick:function(){Z.W.post("".concat(y.Z.apiPrefix,"user/logout")).then((function(){localStorage.removeItem(y.Z.authKey),g.history.push("/login")}))},key:"logout",icon:(0,f.jsx)(v.Z,{})}]};return O?(0,f.jsx)(u.Z,{}):(0,f.jsx)(l.ZP,i()(i()({selectedKeys:[e.pathname],loading:O,ErrorBoundary:z.SV,logo:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(P.Z,{preview:!1,src:"https://qn.whyour.cn/logo.png"}),(0,f.jsxs)("div",{className:"title",children:[(0,f.jsx)("span",{className:"title",children:r.ZP.get("青龙")}),(0,f.jsx)("a",{href:null==B?void 0:B.changeLogLink,target:"_blank",rel:"noopener noreferrer",onClick:function(e){e.stopPropagation()},children:(0,f.jsx)(I.Z,{title:"develop"===(null==B?void 0:B.branch)?r.ZP.get("开发版"):r.ZP.get("正式版"),children:(0,f.jsx)(E.Z,{size:"small",dot:"develop"===(null==B?void 0:B.branch),children:(0,f.jsxs)("span",{style:{fontSize:ce?9:12,color:"#666",marginLeft:2,zoom:ue?.66:.8,letterSpacing:le?-2:0},children:["v",null==B?void 0:B.version]})})})})]})]}),title:!1,menuItemRender:function(t,n){return t.isUrl||!t.path||e.pathname===t.path?n:(0,f.jsx)(g.Link,{to:t.path,children:n})},pageTitleRender:function(t,n,a){var i=y.Z.documentTitleMap[e.pathname]||r.ZP.get("未找到");return"".concat(i," - ").concat(r.ZP.get("青龙"))},onCollapse:G,collapsed:Q,rightContentRender:function(){return t.isPhone&&(0,f.jsx)(q.Z,{menu:de,placement:"bottomRight",trigger:["click"],children:(0,f.jsxs)("span",{className:"side-menu-user-wrapper",children:[(0,f.jsx)(C.C,{shape:"square",size:"small",icon:(0,f.jsx)(x.Z,{}),src:S.avatar?"".concat(y.Z.apiPrefix,"static/").concat(S.avatar):""}),(0,f.jsx)("span",{style:{marginLeft:5},children:S.username})]})})},collapsedButtonRender:function(e){return(0,f.jsxs)("span",{className:"side-menu-container",onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[!e&&!t.isPhone&&(0,f.jsx)(q.Z,{menu:de,placement:"topLeft",trigger:["hover"],children:(0,f.jsxs)("span",{className:"side-menu-user-wrapper",children:[(0,f.jsx)(C.C,{shape:"square",size:"small",icon:(0,f.jsx)(x.Z,{}),src:S.avatar?"".concat(y.Z.apiPrefix,"static/").concat(S.avatar):""}),(0,f.jsx)("span",{style:{marginLeft:5},children:S.username})]})}),(0,f.jsx)("span",{className:"side-menu-collapse-button",onClick:function(){return G(!e)},children:e?(0,f.jsx)(b.Z,{}):(0,f.jsx)(k.Z,{})})]})}},m),{},{children:(0,f.jsx)(g.Outlet,{context:i()(i()({},t),{},{theme:a,user:S,reloadUser:re,reloadTheme:o,systemInfo:B})})}))}},3094:function(e,t,n){n.d(t,{F:function(){return c},e:function(){return r}});var a=n(54306),i=n.n(a),o=n(63313),s=n(40141),r=function(){var e=(0,o.useState)("100%"),t=i()(e,2),n=t[0],a=t[1],r=(0,o.useState)(0),c=i()(r,2),u=c[0],l=c[1],d=(0,o.useState)(-48),h=i()(d,2),p=h[0],f=h[1],m=(0,o.useState)(!1),g=i()(m,2),v=g[0],x=g[1],b=(0,o.useMemo)((function(){return(0,s.ZP)()}),[]).platform;return(0,o.useEffect)((function(){"mobile"===b&&document.body.offsetWidth<768?(a("auto"),l(0),f(0),x(!0),document.body.setAttribute("data-mode","phone")):(a("100%"),l(0),f(-48),x(!1),document.body.setAttribute("data-mode","desktop"))}),[]),{headerStyle:{padding:"4px 16px 4px 15px",position:"sticky",top:0,left:0,zIndex:20,marginTop:p,width:n,marginLeft:u},isPhone:v}},c=function(){var e=(0,o.useState)(),t=i()(e,2),n=t[0],a=t[1];return(0,o.useEffect)((function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;a(n?"vs-dark":"vs");var i=function(e){"auto"!==t&&t||(e.matches?a("vs-dark"):a("vs"))};"function"==typeof e.addEventListener?e.addEventListener("change",i):"function"==typeof e.addListener&&e.addListener(i)}),[]),{theme:n,reloadTheme:function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;a(n?"vs-dark":"vs")}}}},21758:function(e,t,n){var a=n(93525),i=n.n(a),o=n(12342),s=n.n(o),r=n(25359),c=n.n(r),u=n(49811),l=n.n(u),d=n(21140),h=n.n(d),p=n(63466),f=n.n(p),m=n(52510),g=n.n(m),v=n(78078),x=n.n(v),b=["type"],k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h()(this,e),g()(this,"url",void 0),g()(this,"socket",null),g()(this,"subscriptions",new Map),g()(this,"options",void 0),g()(this,"reconnectAttempts",0),g()(this,"heartbeatTimeout",null),g()(this,"state","closed"),this.url=t,this.options={maxReconnectAttempts:n.maxReconnectAttempts||5,reconnectInterval:n.reconnectInterval||3e3,heartbeatInterval:n.heartbeatInterval||3e4},this.init()}var t,n;return f()(e,[{key:"init",value:(n=l()(c()().mark((function e(){var t=this;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.state="connecting",this.emit("connecting");case 3:if(!(this.reconnectAttempts<this.options.maxReconnectAttempts)){e.next=16;break}return this.socket=new(x())(this.url),this.setupEventListeners(),this.startHeartbeat(),e.next=9,this.waitForClose();case 9:return this.stopHeartbeat(),this.socket=null,this.reconnectAttempts++,e.next=14,new Promise((function(e){return setTimeout(e,t.options.reconnectInterval)}));case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this.handleError(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(){return n.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.socket&&(this.socket.onopen=function(){e.state="open",e.emit("open")},this.socket.onmessage=function(t){var n=JSON.parse(t.data);e.dispatchMessage(n)},this.socket.onclose=function(){e.state="closed",e.emit("close")})}},{key:"waitForClose",value:(t=l()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null===(t=this.socket)||void 0===t?void 0:t.readyState)===x().CLOSED){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,100)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"subscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(!n.has(t)){n.add(t),this.subscriptions.set(e,n);var a={action:"subscribe",topic:e};this.send(a)}}},{key:"unsubscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(n.has(t)){n.delete(t);var a={action:"unsubscribe",topic:e};this.send(a)}}},{key:"send",value:function(e){var t;(null===(t=this.socket)||void 0===t?void 0:t.readyState)===x().OPEN&&this.socket.send(JSON.stringify(e))}},{key:"dispatchMessage",value:function(e){var t=e.type,n=s()(e,b),a=this.subscriptions.get(t)||new Set;i()(a).forEach((function(e){return e(n)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatTimeout=setInterval((function(){var t;(null===(t=e.socket)||void 0===t?void 0:t.readyState)===x().OPEN&&e.socket.send(JSON.stringify({type:"heartbeat"}))}),this.options.heartbeatInterval)}},{key:"stopHeartbeat",value:function(){this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout)}},{key:"close",value:function(){this.socket&&(this.state="closed",this.stopHeartbeat(),this.socket.close(),this.emit("close"))}},{key:"handleError",value:function(e){console.error("WebSocket错误:",e),this.emit("error",e)}},{key:"on",value:function(e,t){}},{key:"emit",value:function(e,t){}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return e.instance||(e.instance=new e(t,n)),e.instance}}]),e}();g()(k,"instance",null),t.Z=k}}]);