@whyour/qinglong 2.18.3-3 → 2.19.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/.env.example +7 -9
  2. package/docker/310.Dockerfile +18 -9
  3. package/docker/Dockerfile +18 -9
  4. package/docker/docker-entrypoint.sh +14 -15
  5. package/docker/front.conf +0 -32
  6. package/ecosystem.config.js +5 -25
  7. package/package.json +9 -11
  8. package/sample/notify.js +5 -3
  9. package/shell/check.sh +0 -2
  10. package/shell/preload/sitecustomize.js +38 -15
  11. package/shell/preload/sitecustomize.py +42 -18
  12. package/shell/share.sh +23 -75
  13. package/shell/update.sh +21 -20
  14. package/static/build/api/health.js +32 -0
  15. package/static/build/api/index.js +4 -0
  16. package/static/build/api/log.js +1 -1
  17. package/static/build/api/script.js +2 -3
  18. package/static/build/api/system.js +1 -0
  19. package/static/build/api/update.js +47 -0
  20. package/static/build/api/user.js +2 -2
  21. package/static/build/app.js +70 -21
  22. package/static/build/config/const.js +2 -1
  23. package/static/build/config/index.js +32 -25
  24. package/static/build/config/util.js +72 -89
  25. package/static/build/data/dependence.js +1 -13
  26. package/static/build/data/notify.js +1 -0
  27. package/static/build/loaders/app.js +7 -9
  28. package/static/build/loaders/db.js +1 -3
  29. package/static/build/loaders/express.js +1 -9
  30. package/static/build/loaders/initData.js +7 -8
  31. package/static/build/loaders/initFile.js +0 -1
  32. package/static/build/loaders/logger.js +34 -15
  33. package/static/build/middlewares/monitoring.js +56 -0
  34. package/static/build/schedule/api.js +47 -8
  35. package/static/build/schedule/client.js +1 -1
  36. package/static/build/services/cron.js +12 -6
  37. package/static/build/services/dependence.js +10 -9
  38. package/static/build/services/grpc.js +97 -0
  39. package/static/build/services/health.js +74 -0
  40. package/static/build/services/http.js +68 -0
  41. package/static/build/services/metrics.js +82 -0
  42. package/static/build/services/notify.js +3 -3
  43. package/static/build/services/system.js +8 -1
  44. package/static/build/services/user.js +21 -5
  45. package/static/build/shared/pLimit.js +13 -1
  46. package/static/dist/{2208.03c2cf4a.async.js → 2208.98ccac5f.async.js} +1 -1
  47. package/static/dist/8826.faecf076.async.js +1 -0
  48. package/static/dist/8851.cf7e0ebc.async.js +1 -0
  49. package/static/dist/index.html +2 -2
  50. package/static/dist/layouts__index.6e23431c.async.js +1 -0
  51. package/static/dist/{preload_helper.1b1a7a9f.js → preload_helper.67e88ed6.js} +1 -1
  52. package/static/dist/{src__pages__crontab__index.5eb33581.async.js → src__pages__crontab__index.d6d37f6a.async.js} +1 -1
  53. package/static/dist/{src__pages__crontab__modal.b20074c2.async.js → src__pages__crontab__modal.dcd053b5.async.js} +1 -1
  54. package/static/dist/src__pages__dependence__modal.7f588c0b.async.js +1 -0
  55. package/static/dist/src__pages__env__editNameModal.411043e2.async.js +1 -0
  56. package/static/dist/{src__pages__env__modal.d923acdb.async.js → src__pages__env__modal.7d952f26.async.js} +1 -1
  57. package/static/dist/src__pages__error__index.837f4753.async.js +1 -0
  58. package/static/dist/{src__pages__initialization__index.684197ee.async.js → src__pages__initialization__index.5bd471c5.async.js} +1 -1
  59. package/static/dist/src__pages__script__editNameModal.32bb2f80.async.js +1 -0
  60. package/static/dist/src__pages__script__index.53f99bee.async.js +1 -0
  61. package/static/dist/{src__pages__script__renameModal.09dfb133.async.js → src__pages__script__renameModal.8232c924.async.js} +1 -1
  62. package/static/dist/{src__pages__script__saveModal.21b81bcc.async.js → src__pages__script__saveModal.8e358e84.async.js} +1 -1
  63. package/static/dist/{src__pages__script__setting.c6503aaf.async.js → src__pages__script__setting.dcdd7253.async.js} +1 -1
  64. package/static/dist/{src__pages__setting__appModal.b115baf8.async.js → src__pages__setting__appModal.25adf30e.async.js} +1 -1
  65. package/static/dist/src__pages__setting__dependence.95dd01e7.async.js +1 -0
  66. package/static/dist/src__pages__setting__index.3b426f9f.async.js +1 -0
  67. package/static/dist/src__pages__setting__notification.989e57d6.async.js +1 -0
  68. package/static/dist/src__pages__setting__security.7623a492.async.js +1 -0
  69. package/static/dist/src__pages__setting__systemLog.2e8cc7a0.async.js +1 -0
  70. package/static/dist/src__pages__subscription__modal.46a69195.async.js +1 -0
  71. package/static/dist/{umi.32588872.js → umi.b7656bb3.js} +1 -1
  72. package/version.yaml +12 -6
  73. package/back.d.ts +0 -9
  74. package/other.config.js +0 -13
  75. package/static/build/loaders/update.js +0 -79
  76. package/static/build/public.js +0 -34
  77. package/static/build/schedule/index.js +0 -52
  78. package/static/build/update.js +0 -29
  79. package/static/dist/8826.b3f9fa78.async.js +0 -1
  80. package/static/dist/8851.a57942be.async.js +0 -1
  81. package/static/dist/layouts__index.623b87d2.async.js +0 -1
  82. package/static/dist/src__pages__dependence__modal.1bb8572d.async.js +0 -1
  83. package/static/dist/src__pages__env__editNameModal.115bb8ea.async.js +0 -1
  84. package/static/dist/src__pages__error__index.a17578c5.async.js +0 -1
  85. package/static/dist/src__pages__script__editNameModal.7d1cc6b4.async.js +0 -1
  86. package/static/dist/src__pages__script__index.0cd08dcd.async.js +0 -1
  87. package/static/dist/src__pages__setting__dependence.f3afc194.async.js +0 -1
  88. package/static/dist/src__pages__setting__index.34ed674c.async.js +0 -1
  89. package/static/dist/src__pages__setting__notification.b7722a0b.async.js +0 -1
  90. package/static/dist/src__pages__setting__security.534a5e67.async.js +0 -1
  91. package/static/dist/src__pages__setting__systemLog.cb8a2174.async.js +0 -1
  92. package/static/dist/src__pages__subscription__modal.10cd630d.async.js +0 -1
@@ -1 +1 @@
1
- (self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[4473,4555,5812,8851,2208],{44224:function(e,t,n){"use strict";var a=(0,n(19919).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_lc939gab1iq.js"]});t.Z=a},72439:function(e,t,n){"use strict";var a=n(48305),i=n.n(a),r=n(75271),o=n(30502),s=n(48916);t.Z=function(e,t){var n=(0,r.useState)(0),a=i()(n,2),c=a[0],l=a[1];return(0,o.Z)(e,(function(e){var n=e.target;n.classList.contains("ant-table-wrapper")||(n=e.target.querySelector(".ant-table-wrapper")),l((0,s.W9)({extraHeight:t,target:n}))})),c}},41860:function(e,t,n){"use strict";n.r(t),n.d(t,{getScheduleType:function(){return s},scheduleTypeMap:function(){return o}});var a=n(82092),i=n.n(a),r=n(44860),o=i()(i()(i()({},r.ScheduleType.Normal,""),r.ScheduleType.Once,"@once"),r.ScheduleType.Boot,"@boot"),s=function(e){return null!=e&&e.startsWith("@once")?r.ScheduleType.Once:null!=e&&e.startsWith("@boot")?r.ScheduleType.Boot:r.ScheduleType.Normal}},94526:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return L}});var a=n(26068),i=n.n(a),r=n(48305),o=n.n(r),s=n(72317),c=n(75271),l=n(50691),u=n(19293),d=n(45520),m=n(61508),g=n(48758),p=n(47667),f=n(59816),h=n(93481),Z=n(66633),P=n(70175),x=n(33886),v=n(9798),b=n(15631),y=n(56958),A=n(89709),k=n(86935),j=n(72523),w=n(44860),S=n(62348),C=n(16314),E=n(3475),B=n(63549),T=n(83383),M=n(44224),_=n(48916),q=n(17355),N=n(30502),I=n(16483),R=n.n(I),D=n(52676),O=l.Z.Text,G=[{key:"log",tab:s.ZP.get("日志")},{key:"script",tab:s.ZP.get("脚本")}],L=function(e){var t,n,a,r,I=e.cron,L=void 0===I?{}:I,W=e.handleCancel,K=e.visible,F=e.theme,z=e.isPhone,V=(0,c.useState)("log"),H=o()(V,2),Y=H[0],U=H[1],Q=(0,c.useState)(!0),J=o()(Q,2),X=(J[0],J[1]),$=(0,c.useState)([]),ee=o()($,2),te=ee[0],ne=ee[1],ae=(0,c.useState)(""),ie=o()(ae,2),re=ie[0],oe=ie[1],se=(0,c.useState)(""),ce=o()(se,2),le=ce[0],ue=ce[1],de=(0,c.useState)(!1),me=o()(de,2),ge=me[0],pe=me[1],fe=(0,c.useRef)(null),he=(0,c.useState)({}),Ze=o()(he,2),Pe=Ze[0],xe=Ze[1],ve=(0,c.useState)(""),be=o()(ve,2),ye=be[0],Ae=be[1],ke=(0,c.useState)(G),je=o()(ke,2),we=je[0],Se=je[1],Ce=(0,c.useState)({}),Ee=o()(Ce,2),Be=Ee[0],Te=Ee[1],Me=(0,c.useRef)(null),_e=function(e){var t=(0,c.useState)(0),n=o()(t,2),a=n[0],i=n[1];return(0,N.Z)(e,(function(e){var t=e.target.clientHeight;a!==t&&i(t)})),a}(Me),qe={log:(0,D.jsx)("div",{ref:Me,children:(0,D.jsx)(u.ZP,{children:(0,D.jsx)(q.Z,{data:te,height:_e,itemHeight:47,itemKey:"filename",children:function(e){return(0,D.jsxs)(u.ZP.Item,{className:"log-item",onClick:function(){return Ne(e)},children:[(0,D.jsx)(P.Z,{style:{marginRight:10}}),e.directory,"/",e.filename]})}})})}),script:Pe.filename&&(0,D.jsx)(T.ZP,{language:(0,_.H$)(Pe.filename),theme:F,value:le,options:{fontSize:12,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1,accessibilitySupport:"off"},onMount:function(e,t){fe.current=e}})},Ne=function(e){var t="".concat(E.Z.apiPrefix,"logs/detail?file=").concat(e.filename,"&path=").concat(e.directory||"");localStorage.setItem("logCron",t),Ae(t),C.W.get(t).then((function(e){var t=e.code,n=e.data;200===t&&(oe(n),pe(!0))}))},Ie=function(){X(!0),C.W.get("".concat(E.Z.apiPrefix,"crons/").concat(L.id,"/logs")).then((function(e){var t=e.code,n=e.data;200===t&&ne(n)})).finally((function(){return X(!1)}))};return(0,c.useEffect)((function(){L&&L.id&&(Te(L),Ie(),function(){var e=(0,_.FA)(L.command);if(Array.isArray(e)){Se(we);var t=o()(e,2),n=t[0],a=t[1];xe({parent:a,filename:n}),C.W.get("".concat(E.Z.apiPrefix,"scripts/detail?file=").concat(n,"&path=").concat(a||"")).then((function(e){var t=e.code,n=e.data;200===t&&ue(n)}))}else Se([we[0]]),U("log")}())}),[L]),(0,D.jsxs)(d.Z,{title:(0,D.jsxs)("div",{className:"crontab-title-wrapper",children:[(0,D.jsxs)("div",{style:{minWidth:0,display:"flex",alignItems:"center"},children:[(0,D.jsx)(l.Z.Text,{style:{width:200,boxSizing:"content-box"},ellipsis:{onEllipsis:function(e){return e},tooltip:Be.name},children:Be.name}),(null===(t=Be.labels)||void 0===t?void 0:t.length)>0&&""!==Be.labels[0]&&(0,D.jsx)(g.Z,{type:"vertical"}),(null===(n=Be.labels)||void 0===n?void 0:n.length)>0&&""!==Be.labels[0]&&(null===(a=Be.labels)||void 0===a?void 0:a.map((function(e,t){return(0,D.jsx)(p.Z,{color:"blue",style:{marginRight:5},children:e},e)})))]}),(0,D.jsxs)("div",{className:"operations",children:[(0,D.jsx)(f.Z,{title:Be.status===w.CrontabStatus.idle?s.ZP.get("运行"):s.ZP.get("停止"),children:(0,D.jsx)(h.Z,{type:"link",icon:Be.status===w.CrontabStatus.idle?(0,D.jsx)(x.Z,{}):(0,D.jsx)(v.Z,{}),size:"small",onClick:Be.status===w.CrontabStatus.idle?function(){d.Z.confirm({title:s.ZP.get("确认运行"),content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认运行定时任务")," ",(0,D.jsx)(O,{style:{wordBreak:"break-all"},type:"warning",children:Be.name})," ",s.ZP.get("吗")]}),onOk:function(){C.W.put("".concat(E.Z.apiPrefix,"crons/run"),[Be.id]).then((function(e){var t=e.code;e.data;200===t&&(Te(i()(i()({},Be),{},{status:w.CrontabStatus.running})),setTimeout((function(){Ie()}),1e3))}))}})}:function(){d.Z.confirm({title:s.ZP.get("确认停止"),content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认停止定时任务")," ",(0,D.jsx)(O,{style:{wordBreak:"break-all"},type:"warning",children:Be.name})," ",s.ZP.get("吗")]}),onOk:function(){C.W.put("".concat(E.Z.apiPrefix,"crons/stop"),[Be.id]).then((function(e){var t=e.code;e.data;200===t&&Te(i()(i()({},Be),{},{status:w.CrontabStatus.idle}))}))}})}})}),(0,D.jsx)(f.Z,{title:1===Be.isDisabled?s.ZP.get("启用"):s.ZP.get("禁用"),children:(0,D.jsx)(h.Z,{type:"link",icon:(0,D.jsx)(M.Z,{type:1===Be.isDisabled?"ql-icon-enable":"ql-icon-disable"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Be.isDisabled?s.ZP.get("启用"):s.ZP.get("禁用")),content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认"),1===Be.isDisabled?s.ZP.get("启用"):s.ZP.get("禁用"),s.ZP.get("定时任务")," ",(0,D.jsx)(O,{style:{wordBreak:"break-all"},type:"warning",children:Be.name})," ",s.ZP.get("吗")]}),onOk:function(){C.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Be.isDisabled?"enable":"disable"),[Be.id]).then((function(e){var t=e.code;e.data;200===t&&Te(i()(i()({},Be),{},{isDisabled:1===Be.isDisabled?0:1}))}))}})}})}),(0,D.jsx)(f.Z,{title:1===Be.isPinned?s.ZP.get("取消置顶"):s.ZP.get("置顶"),children:(0,D.jsx)(h.Z,{type:"link",icon:(0,D.jsx)(M.Z,{type:1===Be.isPinned?"ql-icon-untop":"ql-icon-top"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Be.isPinned?s.ZP.get("取消置顶"):s.ZP.get("置顶")),content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认"),1===Be.isPinned?s.ZP.get("取消置顶"):s.ZP.get("置顶"),s.ZP.get("定时任务")," ",(0,D.jsx)(O,{style:{wordBreak:"break-all"},type:"warning",children:Be.name})," ",s.ZP.get("吗")]}),onOk:function(){C.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Be.isPinned?"unpin":"pin"),[Be.id]).then((function(e){var t=e.code;e.data;200===t&&Te(i()(i()({},Be),{},{isPinned:1===Be.isPinned?0:1}))}))}})}})})]})]}),centered:!0,open:K,forceRender:!0,footer:!1,onCancel:function(){return W()},wrapClassName:"crontab-detail",width:z?"":"80vw",children:[(0,D.jsxs)("div",{className:"card-wrapper",children:[(0,D.jsx)(Z.Z,{children:(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("任务")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Be.command})]})}),(0,D.jsxs)(Z.Z,{style:{marginTop:10},children:[(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("状态")}),(0,D.jsxs)("div",{className:"cron-detail-info-value",children:[(!Be.isDisabled||Be.status!==w.CrontabStatus.idle)&&(0,D.jsxs)(D.Fragment,{children:[Be.status===w.CrontabStatus.idle&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(b.Z,{}),color:"default",children:s.ZP.get("空闲中")}),Be.status===w.CrontabStatus.running&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(y.Z,{spin:!0}),color:"processing",children:s.ZP.get("运行中")}),Be.status===w.CrontabStatus.queued&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(A.Z,{}),color:"default",children:s.ZP.get("队列中")})]}),1===Be.isDisabled&&Be.status===w.CrontabStatus.idle&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(k.Z,{}),color:"error",children:s.ZP.get("已禁用")})]})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("定时")}),(0,D.jsxs)("div",{className:"cron-detail-info-value",children:[(0,D.jsx)("div",{children:Be.schedule}),null===(r=Be.extra_schedules)||void 0===r?void 0:r.map((function(e){return(0,D.jsx)("div",{children:e.schedule},e.schedule)}))]})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("最后运行时间")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Be.last_execution_time?R()(1e3*Be.last_execution_time).format("YYYY-MM-DD HH:mm:ss"):"-"})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("最后运行时长")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Be.last_running_time?(0,S.E)(Be.last_running_time):"-"})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("下次运行时间")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Be.nextRunTime&&R()(Be.nextRunTime).format("YYYY-MM-DD HH:mm:ss")})]})]}),(0,D.jsx)(Z.Z,{style:{marginTop:10},tabList:we,activeTabKey:Y,onTabChange:function(e){!function(e){U(e)}(e)},tabBarExtraContent:"script"===Y&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(h.Z,{type:"primary",style:{marginRight:8},onClick:function(){d.Z.confirm({title:"确认保存",content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认保存文件"),(0,D.jsxs)(O,{style:{wordBreak:"break-all"},type:"warning",children:[" ",Pe.filename]}),s.ZP.get(",保存后不可恢复")]}),onOk:function(){var e=fe.current?fe.current.getValue().replace(/\r\n/g,"\n"):le;return new Promise((function(t,n){C.W.put("".concat(E.Z.apiPrefix,"scripts"),{filename:Pe.filename,path:Pe.parent||"",content:e}).then((function(n){var a=n.code;n.data;200===a&&(ue(e),m.ZP.success("保存成功")),t(null)})).catch((function(e){return n(e)}))}))}})},children:s.ZP.get("保存")}),(0,D.jsx)(h.Z,{type:"primary",icon:(0,D.jsx)(j.Z,{}),onClick:function(){var e;null===(e=fe.current._domElement.parentElement)||void 0===e||e.requestFullscreen()}})]}),children:qe[Y]})]}),(0,D.jsx)(B.default,{visible:ge,handleCancel:function(){pe(!1)},cron:L,data:re,logUrl:ye})]})}},26932:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ue}});var a=n(90228),i=n.n(a),r=n(15558),o=n.n(r),s=n(87999),c=n.n(s),l=n(48305),u=n.n(l),d=n(26068),m=n.n(d),g=n(72439),p=n(48916),f=n(3475),h=n(62348),Z=n(16314),P=n(15631),x=n(56958),v=n(89709),b=n(86935),y=n(28423),A=n(44084),k=n(1704),j=n(13868),w=n(88939),S=n(96553),C=n(97953),E=n(88629),B=n(83649),T=n(21288),M=n(76991),_=n(7802),q=n(47508),N=n(98783),I=n(50691),R=n(17082),D=n(47667),O=n(63505),G=n(45520),L=n(61508),W=n(85950),K=n(93481),F=n(46035),z=n(10948),V=n(16483),H=n.n(V),Y=n(32699),U=n(75271),Q=n(72317),J=n(19610),X=n(41860),$=n(94526),ee=n(63549),te=n(97583),ne=n(44860),ae=n(42208),ie=n(36199),re=n(52676),oe=I.Z.Text,se=I.Z.Paragraph,ce=I.Z.Link,le=R.Z.Search,ue=function(){var e=(0,N.useOutletContext)(),t=e.headerStyle,n=e.isPhone,a=e.theme,r=[{title:Q.ZP.get("名称"),dataIndex:"name",key:"name",fixed:"left",width:120,render:function(e,t){return(0,re.jsx)(se,{style:{wordBreak:"break-all",marginBottom:0,color:"#1890ff",cursor:"pointer"},ellipsis:{tooltip:e,rows:2},onClick:function(){tt(t),Je(!0)},children:(0,re.jsx)(ce,{children:t.name||"-"})})},sorter:{compare:function(e,t){var n;return null==e||null===(n=e.name)||void 0===n?void 0:n.localeCompare(null==t?void 0:t.name)}}},{title:Q.ZP.get("命令/脚本"),dataIndex:"command",key:"command",width:240,render:function(e,t){return(0,re.jsx)(se,{style:{wordBreak:"break-all",marginBottom:0},ellipsis:{tooltip:e,rows:2},children:(0,re.jsx)("a",{onClick:function(){It(t)},children:e})})},sorter:{compare:function(e,t){return e.command.localeCompare(t.command)}}},{title:Q.ZP.get("状态"),key:"status",dataIndex:"status",width:100,filters:[{text:Q.ZP.get("运行中"),value:ne.CrontabStatus.running},{text:Q.ZP.get("空闲中"),value:ne.CrontabStatus.idle},{text:Q.ZP.get("已禁用"),value:ne.CrontabStatus.disabled},{text:Q.ZP.get("队列中"),value:ne.CrontabStatus.queued}],render:function(e,t){return(0,re.jsxs)(re.Fragment,{children:[(!t.isDisabled||t.status!==ne.CrontabStatus.idle)&&(0,re.jsxs)(re.Fragment,{children:[t.status===ne.CrontabStatus.idle&&(0,re.jsx)(D.Z,{icon:(0,re.jsx)(P.Z,{}),color:"default",children:Q.ZP.get("空闲中")}),t.status===ne.CrontabStatus.running&&(0,re.jsx)(D.Z,{icon:(0,re.jsx)(x.Z,{spin:!0}),color:"processing",children:Q.ZP.get("运行中")}),t.status===ne.CrontabStatus.queued&&(0,re.jsx)(D.Z,{icon:(0,re.jsx)(v.Z,{}),color:"default",children:Q.ZP.get("队列中")})]}),1===t.isDisabled&&t.status===ne.CrontabStatus.idle&&(0,re.jsx)(D.Z,{icon:(0,re.jsx)(b.Z,{}),color:"error",children:Q.ZP.get("已禁用")})]})}},{title:Q.ZP.get("定时规则"),dataIndex:"schedule",key:"schedule",width:150,sorter:{compare:function(e,t){return e.schedule.localeCompare(t.schedule)}},render:function(e,t){var n;return(0,re.jsx)(se,{style:{wordBreak:"break-all",marginBottom:0},ellipsis:{tooltip:{placement:"right",title:(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)("div",{children:e}),null===(n=t.extra_schedules)||void 0===n?void 0:n.map((function(e){return(0,re.jsx)("div",{children:e.schedule},e.schedule)}))]})},rows:2},children:e})}},{title:Q.ZP.get("最后运行时长"),width:167,dataIndex:"last_running_time",key:"last_running_time",sorter:{compare:function(e,t){return e.last_running_time-t.last_running_time}},render:function(e,t){return t.last_running_time?(0,h.E)(t.last_running_time):"-"}},{title:Q.ZP.get("最后运行时间"),dataIndex:"last_execution_time",key:"last_execution_time",width:141,sorter:{compare:function(e,t){return(e.last_execution_time||0)-(t.last_execution_time||0)}},render:function(e,t){return(0,re.jsx)("span",{style:{display:"block"},children:t.last_execution_time?H()(1e3*t.last_execution_time).format("YYYY-MM-DD HH:mm:ss"):"-"})}},{title:Q.ZP.get("下次运行时间"),width:144,sorter:{compare:function(e,t){return e.nextRunTime-t.nextRunTime}},render:function(e,t){return t.nextRunTime?H()(t.nextRunTime).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:Q.ZP.get("关联订阅"),width:185,render:function(e,t){var n;return(null==t||null===(n=t.subscription)||void 0===n?void 0:n.name)||"-"}},{title:Q.ZP.get("操作"),key:"action",width:140,fixed:n?void 0:"right",render:function(e,t,n){return(0,re.jsxs)(O.Z,{size:"middle",children:[t.status===ne.CrontabStatus.idle&&(0,re.jsx)("a",{onClick:function(e){e.stopPropagation(),Ot(t,n)},children:Q.ZP.get("运行")}),t.status!==ne.CrontabStatus.idle&&(0,re.jsx)("a",{onClick:function(e){e.stopPropagation(),Gt(t,n)},children:Q.ZP.get("停止")}),(0,re.jsx)("a",{onClick:function(e){e.stopPropagation(),Ne(m()(m()({},t),{},{timestamp:Date.now()}))},children:Q.ZP.get("日志")}),(0,re.jsx)(Wt,{record:t,index:n},"more")]})}}],s=(0,U.useState)([]),l=u()(s,2),d=l[0],I=l[1],R=(0,U.useState)(!0),V=u()(R,2),ue=V[0],de=V[1],me=(0,U.useState)(!1),ge=u()(me,2),pe=ge[0],fe=ge[1],he=(0,U.useState)(!1),Ze=u()(he,2),Pe=Ze[0],xe=Ze[1],ve=(0,U.useState)(),be=u()(ve,2),ye=be[0],Ae=be[1],ke=(0,U.useState)(""),je=u()(ke,2),we=je[0],Se=je[1],Ce=(0,U.useState)(!1),Ee=u()(Ce,2),Be=Ee[0],Te=Ee[1],Me=(0,U.useState)(),_e=u()(Me,2),qe=_e[0],Ne=_e[1],Ie=(0,U.useState)([]),Re=u()(Ie,2),De=Re[0],Oe=Re[1],Ge=(0,U.useState)({}),Le=u()(Ge,2),We=Le[0],Ke=Le[1],Fe=(0,U.useState)(),ze=u()(Fe,2),Ve=ze[0],He=ze[1],Ye=(0,U.useState)(!1),Ue=u()(Ye,2),Qe=Ue[0],Je=Ue[1],Xe=(0,U.useState)(),$e=u()(Xe,2),et=$e[0],tt=$e[1],nt=(0,U.useState)(""),at=u()(nt,2),it=at[0],rt=at[1],ot=(0,U.useState)(),st=u()(ot,2),ct=st[0],lt=st[1],ut=(0,U.useState)(!1),dt=u()(ut,2),mt=dt[0],gt=dt[1],pt=(0,U.useState)(!1),ft=u()(pt,2),ht=ft[0],Zt=ft[1],Pt=(0,U.useState)([]),xt=u()(Pt,2),vt=xt[0],bt=xt[1],yt=(0,U.useState)([]),At=u()(yt,2),kt=At[0],jt=At[1],wt=(0,U.useState)(!1),St=u()(wt,2),Ct=St[0],Et=St[1],Bt=(0,U.useRef)(null),Tt=(0,g.Z)(Bt),Mt=(0,U.useState)(""),_t=u()(Mt,2),qt=_t[0],Nt=_t[1],It=function(e){var t=(0,p.FA)(e.command);if(Array.isArray(t)){var n=u()(t,2),a=n[0],i=n[1];N.history.push("/script?p=".concat(i,"&s=").concat(a))}else t&&(location.href=t)},Rt=function(){de(!0);var e=We.page,t=We.size,n=We.sorter,a=We.filters,r="".concat(f.Z.apiPrefix,"crons?searchValue=").concat(we,"&page=").concat(e,"&size=").concat(t,"&filters=").concat(JSON.stringify(a));n&&n.column&&n.order&&(r+="&sorter=".concat(JSON.stringify({field:n.column.key,type:"ascend"===n.order?"ASC":"DESC"}))),Ve&&(r+="&queryString=".concat(JSON.stringify({filters:Ve.filters,sorts:Ve.sorts,filterRelation:Ve.filterRelation||"and"}))),Z.W.get(r).then(function(){var e=c()(i()().mark((function e(t){var n,a,r,s,c,l,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.code,a=t.data,200!==n){e.next=9;break}return s=a.data,c=a.total,e.next=5,Z.W.get("".concat(f.Z.apiPrefix,"subscriptions?ids=").concat(JSON.stringify(o()(new Set(s.map((function(e){return e.sub_id})).filter(Boolean))))),{onError:Y.noop});case 5:l=e.sent,u=Object.fromEntries(null==l||null===(r=l.data)||void 0===r?void 0:r.map((function(e){return[e.id,e]}))),I(s.map((function(e){var t=(0,X.getScheduleType)(e.schedule)===ne.ScheduleType.Normal?(0,p.rS)(e.schedule,e.extra_schedules):null;return m()(m()({},e),{},{nextRunTime:t,subscription:null==u?void 0:u[e.sub_id]})}))),lt(c);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).finally((function(){return de(!1)}))},Dt=function(e,t){Ae(e),fe(!0)},Ot=function(e,t){G.Z.confirm({title:Q.ZP.get("确认运行"),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认运行定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/run"),[e.id]).then((function(t){var n=t.code;t.data;if(200===n){var a=o()(d),i=a.findIndex((function(t){return t.id===e.id}));-1!==i&&(a.splice(i,1,m()(m()({},e),{},{status:ne.CrontabStatus.running})),I(a))}}))}})},Gt=function(e,t){G.Z.confirm({title:Q.ZP.get("确认停止"),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认停止定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/stop"),[e.id]).then((function(t){var n=t.code;t.data;if(200===n){var a=o()(d),i=a.findIndex((function(t){return t.id===e.id}));-1!==i&&(a.splice(i,1,m()(m()({},e),{},{pid:null,status:ne.CrontabStatus.idle})),I(a))}}))}})},Lt=function(e){return[{label:Q.ZP.get("编辑"),key:"edit",icon:(0,re.jsx)(y.Z,{})},{label:1===e.isDisabled?Q.ZP.get("启用"):Q.ZP.get("禁用"),key:"enableOrDisable",icon:1===e.isDisabled?(0,re.jsx)(A.Z,{}):(0,re.jsx)(k.Z,{})},{label:Q.ZP.get("复制"),key:"copy",icon:(0,re.jsx)(j.Z,{})},{label:Q.ZP.get("删除"),key:"delete",icon:(0,re.jsx)(w.Z,{})},{label:1===e.isPinned?Q.ZP.get("取消置顶"):Q.ZP.get("置顶"),key:"pinOrUnPin",icon:1===e.isPinned?(0,re.jsx)(k.Z,{}):(0,re.jsx)(S.Z,{})}]},Wt=function(e){var t=e.record,n=e.index;return(0,re.jsx)(W.Z,{placement:"bottomRight",trigger:["click"],menu:{items:Lt(t),onClick:function(e){var a=e.key;e.domEvent.stopPropagation(),Kt(a,t,n)}},children:(0,re.jsx)("a",{onClick:function(e){return e.stopPropagation()},children:(0,re.jsx)(C.Z,{})})})},Kt=function(e,t,n){switch(e){case"edit":Dt(t);break;case"copy":Dt((0,Y.omit)(t,"id"));break;case"enableOrDisable":!function(e,t){G.Z.confirm({title:"确认".concat(1===e.isDisabled?Q.ZP.get("启用"):Q.ZP.get("禁用")),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认"),1===e.isDisabled?Q.ZP.get("启用"):Q.ZP.get("禁用"),Q.ZP.get("定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/").concat(1===e.isDisabled?"enable":"disable"),[e.id]).then((function(t){var n=t.code;if(t.data,200===n){var a=1===e.isDisabled?0:1,i=o()(d),r=i.findIndex((function(t){return t.id===e.id}));-1!==r&&(i.splice(r,1,m()(m()({},e),{},{isDisabled:a})),I(i))}}))}})}(t);break;case"delete":!function(e,t){G.Z.confirm({title:Q.ZP.get("确认删除"),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认删除定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.delete("".concat(f.Z.apiPrefix,"crons"),{data:[e.id]}).then((function(t){var n=t.code;if(t.data,200===n){L.ZP.success(Q.ZP.get("删除成功"));var a=o()(d),i=a.findIndex((function(t){return t.id===e.id}));-1!==i&&(a.splice(i,1),I(a))}}))}})}(t);break;case"pinOrUnPin":!function(e,t){G.Z.confirm({title:"确认".concat(1===e.isPinned?Q.ZP.get("取消置顶"):Q.ZP.get("置顶")),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认"),1===e.isPinned?Q.ZP.get("取消置顶"):Q.ZP.get("置顶"),Q.ZP.get("定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/").concat(1===e.isPinned?"unpin":"pin"),[e.id]).then((function(t){var n=t.code;if(t.data,200===n){var a=1===e.isPinned?0:1,i=o()(d),r=i.findIndex((function(t){return t.id===e.id}));-1!==r&&(i.splice(r,1,m()(m()({},e),{},{isPinned:a})),I(i))}}))}})}(t)}},Ft={selectedRowKeys:De,onChange:function(e){Oe(e)}},zt=function(e){G.Z.confirm({title:"确认".concat(ne.OperationName[e]),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认"),ne.OperationName[e],Q.ZP.get("选中的定时任务吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/").concat(ne.OperationPath[e]),De).then((function(e){var t=e.code;e.data;200===t&&Rt()}))}})};(0,U.useEffect)((function(){qe&&(localStorage.setItem("logCron",qe.id),Te(!0))}),[qe]),(0,U.useEffect)((function(){Ke(m()(m()({},We),{},{page:1}))}),[we]),(0,U.useEffect)((function(){We.page&&We.size&&Rt(),Ve&&Ve.id&&Nt(Ve.id)}),[We,Ve]),(0,U.useEffect)((function(){if(Ve&&kt&&kt.length>0){var e=kt.slice(10).find((function(e){return e.id===Ve.id}));Et(!!e)}}),[Ve,kt]),(0,U.useEffect)((function(){Ht()}),[]);var Vt={onClick:function(e){var t=e.key;e.domEvent.stopPropagation(),function(e){switch(e){case"new":gt(!0);break;case"manage":Zt(!0);break;default:Yt(e)}}(t)},items:[].concat(o()(o()(kt).slice(10).map((function(e){return{label:(0,re.jsxs)(O.Z,{style:{display:"flex",justifyContent:"space-between"},children:[(0,re.jsx)("span",{children:e.name}),(null==Ve?void 0:Ve.id)===e.id&&(0,re.jsx)(E.Z,{style:{color:"#1890ff"}})]}),key:e.id,icon:(0,re.jsx)(B.Z,{})}}))),[{type:"divider"},{label:Q.ZP.get("创建视图"),key:"new",icon:(0,re.jsx)(T.Z,{})},{label:Q.ZP.get("视图管理"),key:"manage",icon:(0,re.jsx)(M.Z,{})}]),style:{maxHeight:350,overflowY:"auto"}},Ht=function(){de(!0),Z.W.get("".concat(f.Z.apiPrefix,"crons/views")).then((function(e){var t=e.code,n=e.data;if(200===t){bt(n);var a=n.filter((function(e){return!e.isDisabled})).map((function(e){return m()(m()({},e),{},{name:"全部任务"===e.name?Q.ZP.get("全部任务"):e.name})}));jt(a),Ke({page:1,size:parseInt(localStorage.getItem("pageSize")||"20"),sorter:{},filters:{}}),He(m()({},a[0]))}})).finally((function(){de(!1)}))},Yt=function(e){var t=kt.find((function(t){return t.id==e}));Oe([]),Ke(m()(m()({},We),{},{page:1})),He(t||null)},Ut=(0,J.u)((function(){return{scroll:{y:Tt}}}),[Tt]),Qt=u()(Ut,1)[0];return(0,re.jsxs)(q.ZP,{className:"ql-container-wrapper crontab-wrapper ql-container-wrapper-has-tab",title:Q.ZP.get("定时任务"),extra:[(0,re.jsx)(le,{placeholder:Q.ZP.get("请输入名称或者关键词"),style:{width:"auto"},enterButton:!0,allowClear:!0,loading:ue,value:it,onChange:function(e){return rt(e.target.value)},onSearch:function(e){Se(e.trim())}}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return Ae(null),void fe(!0)},children:Q.ZP.get("创建任务")},"2")],header:{style:t},children:[(0,re.jsx)(F.Z,{defaultActiveKey:"all",size:"small",activeKey:qt,tabPosition:"top",className:"crontab-view ".concat(Ct?"more-active":""),tabBarExtraContent:(0,re.jsx)(W.Z,{menu:Vt,trigger:["click"],overlayStyle:{minWidth:200},children:(0,re.jsxs)("div",{className:"view-more ".concat(Ct?"active":""),children:[(0,re.jsxs)(O.Z,{children:[Q.ZP.get("更多"),(0,re.jsx)(_.Z,{})]}),(0,re.jsx)("div",{className:"ant-tabs-ink-bar ant-tabs-ink-bar-animated"})]})}),onTabClick:Yt,items:o()(o()(kt).slice(0,10).map((function(e){return{key:e.id,label:e.name}})))}),(0,re.jsxs)("div",{ref:Bt,children:[De.length>0&&(0,re.jsxs)("div",{style:{marginBottom:16},children:[(0,re.jsx)(K.Z,{type:"primary",style:{marginBottom:5},onClick:function(){G.Z.confirm({title:Q.ZP.get("确认删除"),content:(0,re.jsx)(re.Fragment,{children:Q.ZP.get("确认删除选中的定时任务吗")}),onOk:function(){Z.W.delete("".concat(f.Z.apiPrefix,"crons"),{data:De}).then((function(e){var t=e.code;e.data;200===t&&(L.ZP.success(Q.ZP.get("批量删除成功")),Oe([]),Rt())}))}})},children:Q.ZP.get("批量删除")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(0)},style:{marginLeft:8,marginBottom:5},children:Q.ZP.get("批量启用")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(1)},style:{marginLeft:8,marginRight:8},children:Q.ZP.get("批量禁用")}),(0,re.jsx)(K.Z,{type:"primary",style:{marginRight:8},onClick:function(){return zt(2)},children:Q.ZP.get("批量运行")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(3)},children:Q.ZP.get("批量停止")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(4)},style:{marginLeft:8,marginRight:8},children:Q.ZP.get("批量置顶")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(5)},style:{marginLeft:8,marginRight:8},children:Q.ZP.get("批量取消置顶")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return xe(!0)},style:{marginLeft:8,marginRight:8},children:Q.ZP.get("批量修改标签")}),(0,re.jsxs)("span",{style:{marginLeft:8},children:[Q.ZP.get("已选择"),(0,re.jsx)("a",{children:null==De?void 0:De.length}),Q.ZP.get("项")]})]}),(0,re.jsx)(z.Z,{columns:r,pagination:{current:We.page,pageSize:We.size,showSizeChanger:!0,simple:n,total:ct,showTotal:function(e,t){return"第 ".concat(t[0],"-").concat(t[1]," 条/总共 ").concat(e," 条")},pageSizeOptions:[10,20,50,100,200,500,ct||1e4].sort((function(e,t){return e-t}))},dataSource:d,rowKey:"id",size:"middle",scroll:{x:1200,y:Tt},loading:ue,rowSelection:Ft,rowClassName:function(e,t){return e.isPinned?"pinned-cron cron":"cron"},onChange:function(e,t,n){var a=e.current,i=e.pageSize;Ke({page:a,size:i,sorter:n,filters:t}),localStorage.setItem("pageSize",String(i))},components:n||We.size<50?void 0:Qt})]}),(0,re.jsx)(ee.default,{visible:Be,handleCancel:function(){var e;e=qe,Z.W.get("".concat(f.Z.apiPrefix,"crons/").concat(e.id)).then((function(t){var n=t.code,a=t.data;if(200===n){var i=d.findIndex((function(t){return t.id===e.id})),r=o()(d);a.nextRunTime=(0,p.rS)(a.schedule,a.extra_schedules),-1!==i&&(r.splice(i,1,m()(m()({},e),a)),I(r))}})).finally((function(){return de(!1)})),Te(!1)},cron:qe}),(0,re.jsx)(te.default,{visible:pe,handleCancel:function(){fe(!1),Rt()},cron:ye}),(0,re.jsx)(te.CronLabelModal,{visible:Pe,handleCancel:function(e){xe(!1),e&&Rt()},ids:De}),(0,re.jsx)($.default,{visible:Qe,handleCancel:function(){Je(!1)},cron:et,theme:a,isPhone:n}),(0,re.jsx)(ae.default,{visible:mt,handleCancel:function(e){gt(!1),Ht()}}),(0,re.jsx)(ie.default,{cronViews:vt,visible:ht,handleCancel:function(){Zt(!1)},cronViewChange:function(e){Ht()}})]})}},63549:function(e,t,n){"use strict";n.r(t);var a=n(48305),i=n.n(a),r=n(72317),o=n(75271),s=n(32890),c=n(50691),l=n(45520),u=n(93481),d=n(16314),m=n(3475),g=n(56958),p=n(44084),f=n(34014),h=n(48916),Z=n(78060),P=n.n(Z),x=n(52676);s.Z.Countdown;t.default=function(e){var t=e.cron,n=e.handleCancel,a=e.visible,s=e.data,Z=e.logUrl,v=(0,o.useState)(r.ZP.get("启动中...")),b=i()(v,2),y=b[0],A=b[1],k=(0,o.useState)(!0),j=i()(k,2),w=j[0],S=j[1],C=(0,o.useState)(!0),E=i()(C,2),B=E[0],T=E[1],M=(0,o.useState)(!1),_=i()(M,2),q=_[0],N=_[1],I=(0,o.useRef)({value:0,down:!0}),R=Z||String(null==t?void 0:t.id),D=function e(n){n&&S(!0),d.W.get(Z||"".concat(m.Z.apiPrefix,"crons/").concat(t.id,"/log")).then((function(t){var n=t.code,a=t.data;if(200===n&&localStorage.getItem("logCron")===R&&a!==y){var i=a;A(i||r.ZP.get("暂无日志"));var o=Boolean(i&&!(0,h.x$)(i)&&!i.includes("任务未运行"));o||(0,h.x$)(y)||y===r.ZP.get("启动中...")||setTimeout((function(){O()})),T(o),o&&setTimeout((function(){O(),e()}),2e3)}})).finally((function(){n&&S(!1)}))},O=function(){I.current.down&&setTimeout((function(){document.querySelector("#log-flag").scrollIntoView({behavior:"smooth"})}),600)},G=function(){localStorage.removeItem("logCron"),n()};return(0,o.useEffect)((function(){t&&t.id&&a&&(D(!0),I.current.down=!0)}),[t,a]),(0,o.useEffect)((function(){s&&A(s)}),[s]),(0,o.useEffect)((function(){N(document.body.clientWidth<768)}),[]),(0,x.jsx)(l.Z,{title:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(B||w)&&(0,x.jsx)(g.Z,{spin:!0}),!B&&!w&&(0,x.jsx)(p.Z,{}),(0,x.jsx)(c.Z.Text,{ellipsis:!0,style:{marginLeft:5},children:t&&t.name})]}),open:a,centered:!0,className:"log-modal",forceRender:!0,onOk:function(){return G()},onCancel:function(){return G()},footer:[(0,x.jsx)(u.Z,{type:"primary",onClick:function(){return G()},children:r.ZP.get("知道了")})],children:(0,x.jsxs)("div",{onScroll:function(e){var t=e.target.scrollTop;I.current.down&&(I.current={value:t,down:t-I.current.value>-5||!t})},className:"log-container",children:[w?(0,x.jsx)(f.Z,{}):(0,x.jsx)("pre",{style:q?{fontFamily:"Source Code Pro",zoom:.83}:{},children:(0,x.jsx)(P(),{children:y})}),(0,x.jsx)("div",{id:"log-flag"})]})})}},97583:function(e,t,n){"use strict";n.r(t),n.d(t,{CronLabelModal:function(){return D},default:function(){return R}});var a=n(67825),i=n.n(a),r=n(90228),o=n.n(r),s=n(26068),c=n.n(s),l=n(87999),u=n.n(l),d=n(48305),m=n.n(d),g=n(15558),p=n.n(g),f=n(72317),h=n(47667),Z=n(17082),P=n(78646),x=n(21288),v=n(75271),b=n(52676),y=function(e){var t=e.value,n=e.onChange,a=(0,v.useState)(""),i=m()(a,2),r=i[0],o=i[1],s=(0,v.useState)(!1),c=m()(s,2),l=c[0],u=c[1],d=(0,v.useState)([]),g=m()(d,2),y=g[0],A=g[1],k=(0,v.useRef)(),j=function(){r&&!y.includes(r)&&(A([].concat(p()(y),[r])),null==n||n([].concat(p()(y),[r]))),u(!1),o("")},w=y.map((function(e){var t=(0,b.jsx)(h.Z,{closable:!0,onClose:function(t){var a,i;t.preventDefault(),a=e,i=y.filter((function(e){return e!==a})),A(i),null==n||n(i)},children:e});return(0,b.jsx)("span",{style:{display:"inline-block",marginBottom:8},children:t},e)}));return(0,v.useEffect)((function(){l&&k&&k.current.focus()}),[l]),(0,v.useEffect)((function(){t&&A(t)}),[t]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P.Z,{enter:{scale:.8,opacity:0,type:"from",duration:100},leave:{opacity:0,width:0,scale:0,duration:200},appear:!1,children:w}),l&&(0,b.jsx)(Z.Z,{ref:k,type:"text",size:"small",style:{width:78},value:r,onChange:function(e){o(e.target.value)},onBlur:j,onPressEnter:j}),!l&&(0,b.jsxs)(h.Z,{onClick:function(){u(!0)},style:{borderStyle:"dashed",cursor:"pointer"},children:[(0,b.jsx)(x.Z,{})," ",f.ZP.get("新建")]})]})},A=n(3475),k=n(16314),j=n(37559),w=n(72338),S=n(61508),C=n(35181),E=n(63505),B=n(45520),T=n(93481),M=n(94046),_=n.n(M),q=n(41860),N=n(44860),I=["key","name"],R=function(e){var t=e.cron,n=e.handleCancel,a=e.visible,r=w.Z.useForm(),s=m()(r,1)[0],l=(0,v.useState)(!1),d=m()(l,2),g=d[0],p=d[1],h=(0,v.useState)(t?(0,q.getScheduleType)(t.schedule):N.ScheduleType.Normal),P=m()(h,2),T=P[0],M=P[1],R=function(){var e=u()(o()().mark((function e(a){var i,r,s,l,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p(!0),e.prev=1,i=null!=t&&t.id?"put":"post",r=c()(c()({},a),{},{schedule:T!==N.ScheduleType.Normal?q.scheduleTypeMap[T]:a.schedule}),null!=t&&t.id&&(r.id=t.id),e.next=7,k.W[i]("".concat(A.Z.apiPrefix,"crons"),r);case 7:s=e.sent,l=s.code,u=s.data,200===l&&(S.ZP.success(null!=t&&t.id?f.ZP.get("更新任务成功"):f.ZP.get("创建任务成功")),n(u)),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),console.error(e.t0);case 16:return e.prev=16,p(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(t){return e.apply(this,arguments)}}();(0,v.useEffect)((function(){s.resetFields(),M((0,q.getScheduleType)(null==t?void 0:t.schedule))}),[t,a]);var D=function(e){M(e),s.setFieldValue("schedule","")};return(0,b.jsx)(B.Z,{title:null!=t&&t.id?f.ZP.get("编辑任务"):f.ZP.get("创建任务"),open:a,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){return s.validateFields().then(R)},onCancel:function(){return n()},confirmLoading:g,children:(0,b.jsxs)(w.Z,{form:s,layout:"vertical",name:"form_in_modal",initialValues:t,children:[(0,b.jsx)(w.Z.Item,{name:"name",label:f.ZP.get("名称"),rules:[{required:!0,whitespace:!0}],children:(0,b.jsx)(Z.Z,{placeholder:f.ZP.get("请输入任务名称")})}),(0,b.jsx)(w.Z.Item,{name:"command",label:f.ZP.get("命令/脚本"),rules:[{required:!0,whitespace:!0}],children:(0,b.jsx)(Z.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("支持输入脚本路径/任意系统可执行命令/task 脚本路径")})}),(0,b.jsx)(w.Z.Item,{label:f.ZP.get("定时类型"),required:!0,children:(0,b.jsxs)(C.Z,{defaultValue:T,value:T,onChange:D,children:[(0,b.jsx)(C.Z.Option,{value:N.ScheduleType.Normal,children:f.ZP.get("常规定时")}),(0,b.jsx)(C.Z.Option,{value:N.ScheduleType.Once,children:f.ZP.get("手动运行")}),(0,b.jsx)(C.Z.Option,{value:N.ScheduleType.Boot,children:f.ZP.get("开机运行")})]})}),T!==N.ScheduleType.Normal?null:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.Z.Item,{name:"schedule",label:f.ZP.get("定时规则"),rules:[{required:!0},{validator:function(e,t){return!t||_().parseExpression(t).hasNext()?Promise.resolve():Promise.reject(f.ZP.get("Cron表达式格式有误"))}}],children:(0,b.jsx)(Z.Z,{placeholder:f.ZP.get("秒(可选) 分 时 天 月 周")})}),(0,b.jsx)(w.Z.List,{name:"extra_schedules",children:function(e,t,n){var a=t.add,r=t.remove,o=n.errors;return(0,b.jsxs)(b.Fragment,{children:[e.map((function(e){var t=e.key,n=e.name,a=i()(e,I);return(0,b.jsx)(w.Z.Item,{noStyle:!0,children:(0,b.jsxs)(E.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,b.jsx)(w.Z.Item,c()(c()({},a),{},{name:[n,"schedule"],rules:[{required:!0}],children:(0,b.jsx)(Z.Z,{placeholder:f.ZP.get("秒(可选) 分 时 天 月 周")})})),(0,b.jsx)(j.Z,{className:"dynamic-delete-button",onClick:function(){return r(n)}})]})},t)})),(0,b.jsx)(w.Z.Item,{children:(0,b.jsxs)("a",{onClick:function(){return a({schedule:""})},children:[(0,b.jsx)(x.Z,{})," ",f.ZP.get("新增定时规则")]})}),(0,b.jsx)(w.Z.ErrorList,{errors:o})]})}})]}),(0,b.jsx)(w.Z.Item,{name:"labels",label:f.ZP.get("标签"),children:(0,b.jsx)(y,{})}),(0,b.jsx)(w.Z.Item,{name:"task_before",label:f.ZP.get("执行前"),tooltip:f.ZP.get("运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js"),rules:[{validator:function(e,t){return t&&(t.includes(" task ")||t.startsWith("task "))?Promise.reject(f.ZP.get("不能包含 task 命令")):Promise.resolve()}}],children:(0,b.jsx)(Z.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("请输入运行任务前要执行的命令,不能包含 task 命令")})}),(0,b.jsx)(w.Z.Item,{name:"task_after",label:f.ZP.get("执行后"),tooltip:f.ZP.get("运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js"),rules:[{validator:function(e,t){return t&&(t.includes(" task ")||t.startsWith("task "))?Promise.reject(f.ZP.get("不能包含 task 命令")):Promise.resolve()}}],children:(0,b.jsx)(Z.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("请输入运行任务后要执行的命令,不能包含 task 命令")})})]})})},D=function(e){var t=e.ids,n=e.handleCancel,a=e.visible,i=w.Z.useForm(),r=m()(i,1)[0],s=(0,v.useState)(!1),c=m()(s,2),l=c[0],d=c[1],g=function(){var e=u()(o()().mark((function e(a){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.validateFields().then(function(){var e=u()(o()().mark((function e(i){var r,s,c;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),r={ids:t,labels:i.labels},e.prev=2,e.next=5,k.W[a]("".concat(A.Z.apiPrefix,"crons/labels"),r);case 5:s=e.sent,c=s.code,s.data,200===c&&(S.ZP.success("post"===a?f.ZP.get("添加Labels成功"):f.ZP.get("删除Labels成功")),n(!0)),d(!1),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),d(!1);case 15:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){console.log("Validate Failed:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(0,v.useEffect)((function(){r.resetFields()}),[t,a]);var p=[(0,b.jsx)(T.Z,{onClick:function(){return n(!1)},children:f.ZP.get("取消")}),(0,b.jsx)(T.Z,{type:"primary",danger:!0,onClick:function(){return g("delete")},children:f.ZP.get("删除")}),(0,b.jsx)(T.Z,{type:"primary",onClick:function(){return g("post")},children:f.ZP.get("添加")})];return(0,b.jsx)(B.Z,{title:f.ZP.get("批量修改标签"),open:a,footer:p,centered:!0,maskClosable:!1,forceRender:!0,onCancel:function(){return n(!1)},confirmLoading:l,children:(0,b.jsx)(w.Z,{form:r,layout:"vertical",name:"form_in_label_modal",children:(0,b.jsx)(w.Z.Item,{name:"labels",label:f.ZP.get("标签"),children:(0,b.jsx)(y,{})})})})}},44860:function(e,t,n){"use strict";n.r(t),n.d(t,{CrontabStatus:function(){return a},OperationName:function(){return i},OperationPath:function(){return r},ScheduleType:function(){return o}});var a=function(e){return e[e.running=0]="running",e[e.queued=.5]="queued",e[e.idle=1]="idle",e[e.disabled=2]="disabled",e}({}),i=function(e){return e[e["启用"]=0]="启用",e[e["禁用"]=1]="禁用",e[e["运行"]=2]="运行",e[e["停止"]=3]="停止",e[e["置顶"]=4]="置顶",e[e["取消置顶"]=5]="取消置顶",e}({}),r=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}({}),o=function(e){return e.Normal="normal",e.Once="once",e.Boot="boot",e}({})},42208:function(e,t,n){"use strict";n.r(t);var a=n(67825),i=n.n(a),r=n(90228),o=n.n(r),s=n(26068),c=n.n(s),l=n(87999),u=n.n(l),d=n(48305),m=n.n(d),g=n(72317),p=n(75271),f=n(72338),h=n(35181),Z=n(45520),P=n(17082),x=n(93481),v=n(63505),b=n(16314),y=n(3475),A=n(37559),k=n(21288),j=n(44224),w=n(44860),S=n(31352),C=n(52676),E=["name"],B=["key","name"],T=["key","name"],M=[{name:g.ZP.get("命令"),value:"command"},{name:g.ZP.get("名称"),value:"name"},{name:g.ZP.get("定时规则"),value:"schedule"},{name:g.ZP.get("状态"),value:"status",onlySelect:!0},{name:g.ZP.get("标签"),value:"labels"},{name:g.ZP.get("订阅"),value:"sub_id",onlySelect:!0}],_={Reg:"",NotReg:"",In:"select",Nin:"select"},q=[{name:g.ZP.get("包含"),value:"Reg"},{name:g.ZP.get("不包含"),value:"NotReg"},{name:g.ZP.get("属于"),value:"In",type:"select"},{name:g.ZP.get("不属于"),value:"Nin",type:"select"}],N=[{name:g.ZP.get("顺序"),value:"ASC"},{name:g.ZP.get("倒序"),value:"DESC"}],I=function(e){return e.and="且",e.or="或",e}(I||{});t.default=function(e){var t=e.view,n=e.handleCancel,a=e.visible,r=f.Z.useForm(),s=m()(r,1)[0],l=(0,p.useState)(!1),d=m()(l,2),R=d[0],D=d[1],O=(0,p.useState)("and"),G=m()(O,2),L=G[0],W=G[1],K=f.Z.useWatch("filters",s),F=(0,S.Z)((function(){return b.W.get("".concat(y.Z.apiPrefix,"subscriptions"))}),{cacheKey:"subscriptions"}).data,z={status:[{name:g.ZP.get("运行中"),value:w.CrontabStatus.running},{name:g.ZP.get("空闲中"),value:w.CrontabStatus.idle},{name:g.ZP.get("已禁用"),value:w.CrontabStatus.disabled}],sub_id:null==F?void 0:F.data.map((function(e){return{name:e.name,value:e.id}}))},V=function(){var e=u()(o()().mark((function e(a){var i,r,s,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(!0),a.filterRelation=L,i=t?"put":"post",e.prev=3,e.next=6,b.W[i]("".concat(y.Z.apiPrefix,"crons/views"),t?c()(c()({},a),{},{id:t.id}):a);case 6:r=e.sent,s=r.code,l=r.data,200===s&&n(l),D(!1),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),D(!1);case 16:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(t){return e.apply(this,arguments)}}();(0,p.useEffect)((function(){t||s.resetFields(),s.setFieldsValue(t||{filters:[{property:"command"}]})}),[t,a]);var H=function(e){var t=e.name,n=i()(e,E),a=s.getFieldValue(["filters",t,"property"]);return(0,C.jsx)(h.Z,c()(c()({style:{width:120},placeholder:g.ZP.get("请选择操作符")},n),{},{children:q.filter((function(e){return z[a]?"select"===e.type:e})).map((function(e){return(0,C.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))}))},Y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,C.jsx)(h.Z,{style:t,children:e.map((function(e){return(0,C.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))})},U=(0,C.jsx)(h.Z,{style:{width:80},children:N.map((function(e){return(0,C.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))});return(0,C.jsx)(Z.Z,{title:t?g.ZP.get("编辑视图"):g.ZP.get("创建视图"),open:a,forceRender:!0,width:580,centered:!0,maskClosable:!1,onOk:function(){s.validateFields().then((function(e){V(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:R,children:(0,C.jsxs)(f.Z,{form:s,layout:"vertical",name:"env_modal",children:[(0,C.jsx)(f.Z.Item,{name:"name",label:g.ZP.get("视图名称"),rules:[{required:!0,message:g.ZP.get("请输入视图名称")}],children:(0,C.jsx)(P.Z,{placeholder:g.ZP.get("请输入视图名称")})}),(0,C.jsx)(f.Z.List,{name:"filters",children:function(e,t,n){var a=t.add,r=t.remove,o=n.errors;return(0,C.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,C.jsx)("div",{style:{position:"absolute",width:50,borderRadius:10,border:"1px solid rgb(190, 220, 255)",borderRight:"none",height:56*(e.length-1),top:46,left:15},children:(0,C.jsx)(x.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},onClick:function(){W("and"===L?"or":"and")},children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{children:I[L]}),(0,C.jsx)(j.Z,{type:"ql-icon-d-caret"})]})})}),(0,C.jsxs)("div",{children:[e.map((function(e){var t,n,a=e.key,o=e.name,s=i()(e,B);return(0,C.jsx)(f.Z.Item,{label:0===o?g.ZP.get("筛选条件"):"",style:{marginBottom:0},required:!0,className:"filter-item",children:(0,C.jsxs)(v.Z,{className:"view-create-modal-filters",align:"baseline",children:[(0,C.jsx)(f.Z.Item,c()(c()({},s),{},{name:[o,"property"],rules:[{required:!0}],children:Y(M,{width:120})})),(0,C.jsx)(f.Z.Item,c()(c()({},s),{},{name:[o,"operation"],rules:[{required:!0,message:g.ZP.get("请选择操作符")}],children:(0,C.jsx)(H,{name:o})})),(0,C.jsx)(f.Z.Item,c()(c()({},s),{},{name:[o,"value"],rules:[{required:!0,message:g.ZP.get("请输入内容")}],children:"select"===_[null==K?void 0:K[o].operation]?(t=null==K?void 0:K[o].property,(0,C.jsx)(h.Z,{mode:"tags",allowClear:!0,placeholder:g.ZP.get("输入后回车增加自定义选项"),children:null===(n=z[t])||void 0===n?void 0:n.map((function(e){return(0,C.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))})):(0,C.jsx)(P.Z,{placeholder:g.ZP.get("请输入内容")})})),0!==o&&(0,C.jsx)(A.Z,{onClick:function(){return r(o)}})]})},a)})),(0,C.jsx)(f.Z.Item,{children:(0,C.jsxs)("a",{onClick:function(){return a({property:"command",operation:"Reg"})},children:[(0,C.jsx)(k.Z,{}),g.ZP.get("新增筛选条件")]})}),(0,C.jsx)(f.Z.ErrorList,{errors:o})]})]})}}),(0,C.jsx)(f.Z.List,{name:"sorts",children:function(e,t,n){var a=t.add,r=t.remove,o=n.errors;return(0,C.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,C.jsx)("div",{style:{position:"absolute",width:50,borderRadius:10,border:"1px solid rgb(190, 220, 255)",borderRight:"none",height:56*(e.length-1),top:46,left:15},children:(0,C.jsx)(x.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},children:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("span",{children:I[L]})})})}),(0,C.jsxs)("div",{children:[e.map((function(e){var t=e.key,n=e.name,a=i()(e,T);return(0,C.jsx)(f.Z.Item,{label:0===n?g.ZP.get("排序方式"):"",style:{marginBottom:0},className:"filter-item",children:(0,C.jsxs)(v.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,C.jsx)(f.Z.Item,c()(c()({},a),{},{name:[n,"property"],rules:[{required:!0}],children:Y(M)})),(0,C.jsx)(f.Z.Item,c()(c()({},a),{},{name:[n,"type"],rules:[{required:!0}],children:U})),(0,C.jsx)(A.Z,{onClick:function(){return r(n)}})]})},t)})),(0,C.jsx)(f.Z.Item,{children:(0,C.jsxs)("a",{onClick:function(){return a({property:"command",type:"ASC"})},children:[(0,C.jsx)(k.Z,{}),g.ZP.get("新增排序方式")]})}),(0,C.jsx)(f.Z.ErrorList,{errors:o})]})]})}})]})})}},36199:function(e,t,n){"use strict";n.r(t);var a=n(15558),i=n.n(a),r=n(26068),o=n.n(r),s=n(48305),c=n.n(s),l=n(67825),u=n.n(l),d=n(72317),m=n(75271),g=n(50691),p=n(9171),f=n(63505),h=n(45520),Z=n(61508),P=n(93481),x=n(10948),v=n(16314),b=n(3475),y=n(28423),A=n(88939),k=n(12363),j=n(18708),w=n(78637),S=n(4690),C=n(42208),E=n(52676),B=["index","moveRow","className","style"],T=g.Z.Text,M="DragableBodyRow",_=function(e){var t=e.index,n=e.moveRow,a=e.className,i=e.style,r=u()(e,B),s=(0,m.useRef)(),l=(0,k.L)({accept:M,collect:function(e){var n=(e.getItem()||{}).index;return n===t?{}:{isOver:e.isOver(),dropClassName:n<t?" drop-over-downward":" drop-over-upward"}},drop:function(e){n(e.index,t)}}),d=c()(l,2),g=d[0],p=g.isOver,f=g.dropClassName,h=d[1],Z=(0,j.c)({type:M,item:{index:t},collect:function(e){return{isDragging:e.isDragging()}}});return h((0,c()(Z,2)[1])(s)),(0,E.jsx)("tr",o()({ref:s,className:"".concat(a).concat(p?f:""),style:o()({cursor:"move"},i)},r))};t.default=function(e){var t=e.cronViews,n=e.handleCancel,a=e.visible,r=e.cronViewChange,s=function(e){return k.filter((function(e){return!e.isDisabled})).length<=1&&!e.isDisabled},l=[{title:d.ZP.get("名称"),dataIndex:"name",key:"name",render:function(e){return"全部任务"===e?d.ZP.get("全部任务"):e}},{title:d.ZP.get("类型"),dataIndex:"type",key:"type",render:function(e){return 1===e?d.ZP.get("系统"):d.ZP.get("个人")}},{title:d.ZP.get("显示"),key:"isDisabled",dataIndex:"isDisabled",width:100,render:function(e,t,n){return(0,E.jsx)(p.Z,{disabled:s(t),checked:!t.isDisabled,onChange:function(e){return W(e,t,n)}})}},{title:d.ZP.get("操作"),key:"action",width:100,render:function(e,t,n){return 1!==t.type?(0,E.jsxs)(f.Z,{size:"middle",children:[(0,E.jsx)("a",{onClick:function(){return G(t,n)},children:(0,E.jsx)(y.Z,{})}),!s(t)&&(0,E.jsx)("a",{onClick:function(){return L(t,n)},children:(0,E.jsx)(A.Z,{})})]}):"-"}}],u=(0,m.useState)([]),g=c()(u,2),k=g[0],j=g[1],B=(0,m.useState)(!1),M=c()(B,2),q=M[0],N=M[1],I=(0,m.useState)(null),R=c()(I,2),D=R[0],O=R[1],G=function(e,t){O(e),N(!0)},L=function(e,t){h.Z.confirm({title:d.ZP.get("确认删除"),content:(0,E.jsxs)(E.Fragment,{children:[d.ZP.get("确认删除视图")," ",(0,E.jsx)(T,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",d.ZP.get("吗")]}),onOk:function(){v.W.delete("".concat(b.Z.apiPrefix,"crons/views"),{data:[e.id]}).then((function(e){var t=e.code;e.data;200===t&&(Z.ZP.success(d.ZP.get("删除成功")),r())}))}})},W=function(e,t,n){v.W.put("".concat(b.Z.apiPrefix,"crons/views/").concat(e?"enable":"disable"),[t.id]).then((function(t){var a=t.code;t.data;if(200===a){var s=i()(k);s.splice(n,1,o()(o()({},k[n]),{},{isDisabled:!e})),j(s),r()}}))},K={body:{row:_}},F=(0,m.useCallback)((function(e,t){if(e!==t){var n=k[e];v.W.put("".concat(b.Z.apiPrefix,"crons/views/move"),{fromIndex:e,toIndex:t,id:n.id}).then((function(a){var s=a.code,c=a.data;if(200===s){var l=i()(k);l.splice(e,1),l.splice(t,0,o()(o()({},n),c)),j(l),r()}}))}}),[k]);return(0,m.useEffect)((function(){j(t)}),[t]),(0,E.jsxs)(h.Z,{title:d.ZP.get("视图管理"),open:a,centered:!0,width:620,onCancel:function(){return n()},className:"view-manage-modal",forceRender:!0,footer:!1,maskClosable:!1,children:[(0,E.jsx)(f.Z,{style:{display:"flex",justifyContent:"flex-end",marginBottom:10},children:(0,E.jsx)(P.Z,{type:"primary",onClick:function(){O(null),N(!0)},children:d.ZP.get("创建视图")},"2")}),(0,E.jsx)(w.W,{backend:S.PD,children:(0,E.jsx)(x.Z,{bordered:!0,columns:l,pagination:!1,dataSource:k,rowKey:"id",size:"middle",style:{marginBottom:20},components:K,onRow:function(e,t){return{index:t,moveRow:F}}})}),(0,E.jsx)(C.default,{view:D,visible:q,handleCancel:function(e){N(!1),r(e)}})]})}},3475:function(e,t,n){"use strict";var a=n(72317),i=window.__ENV__QlBaseUrl||"/";t.Z={siteName:a.ZP.get("青龙"),baseUrl:i,apiPrefix:"".concat(i,"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:a.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:a.ZP.get("定时任务"),value:"crons"},{name:a.ZP.get("环境变量"),value:"envs"},{name:a.ZP.get("订阅管理"),value:"subscriptions"},{name:a.ZP.get("配置文件"),value:"configs"},{name:a.ZP.get("脚本管理"),value:"scripts"},{name:a.ZP.get("日志管理"),value:"logs"},{name:a.ZP.get("依赖管理"),value:"dependencies"},{name:a.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:a.ZP.get("定时任务"),envs:a.ZP.get("环境变量"),subscriptions:a.ZP.get("订阅管理"),configs:a.ZP.get("配置文件"),scripts:a.ZP.get("脚本管理"),logs:a.ZP.get("日志管理"),dependencies:a.ZP.get("依赖管理"),system:a.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"ntfy",label:"Ntfy"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:a.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:a.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:a.ZP.get("钉钉机器人")},{value:"weWorkBot",label:a.ZP.get("企业微信机器人")},{value:"weWorkApp",label:a.ZP.get("企业微信应用")},{value:"aibotk",label:a.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:a.ZP.get("微加机器人")},{value:"wxPusherBot",label:"wxPusher"},{value:"chat",label:a.ZP.get("群晖chat")},{value:"email",label:a.ZP.get("邮箱")},{value:"lark",label:a.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:a.ZP.get("自定义通知")},{value:"closed",label:a.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:a.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:a.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:a.ZP.get("推送消息的优先级")}],ntfy:[{label:"ntfyUrl",tip:a.ZP.get("ntfy的url地址,例如 https://ntfy.sh"),required:!0},{label:"ntfyTopic",tip:a.ZP.get("ntfy的消息应用topic"),required:!0},{label:"ntfyPriority",tip:a.ZP.get("推送消息的优先级")}],chat:[{label:"synologyChatUrl",tip:a.ZP.get("synologyChat的url地址"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:a.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:a.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:a.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:a.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:a.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:a.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:a.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:a.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:a.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:a.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:a.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:a.ZP.get("BARK推送消息的跳转URL")},{label:"barkArchive",tip:a.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:a.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:a.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:a.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:a.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:a.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:a.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:a.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:a.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:a.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:a.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:a.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:a.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:a.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:a.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:a.ZP.get("请输入要发送的目标"),items:[{value:"room",label:a.ZP.get("群聊")},{value:"contact",label:a.ZP.get("好友")}]},{label:"aibotkName",tip:a.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:a.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:a.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:a.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")},{label:"pushplusTemplate",tip:a.ZP.get("发送模板")},{label:"pushplusChannel",tip:a.ZP.get("发送渠道")},{label:"pushplusWebhook",tip:a.ZP.get("webhook编码")},{label:"pushplusCallbackUrl",tip:a.ZP.get("发送结果回调地址")},{label:"pushplusTo",tip:a.ZP.get("好友令牌")}],wePlusBot:[{label:"wePlusBotToken",tip:a.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:a.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:a.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],wxPusherBot:[{label:"wxPusherBotAppToken",tip:a.ZP.get("wxPusherBot的appToken"),required:!0},{label:"wxPusherBotTopicIds",tip:a.ZP.get("wxPusherBot的topicIds"),required:!1},{label:"wxPusherBotUids",tip:a.ZP.get("wxPusherBot的uids"),required:!1}],lark:[{label:"larkKey",tip:a.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:a.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:a.ZP.get("邮箱地址"),required:!0},{label:"emailPass",tip:a.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0}],pushMe:[{label:"pushMeKey",tip:a.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0},{label:"pushMeUrl",tip:a.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:a.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:a.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:a.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:a.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:a.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:a.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:a.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:a.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":a.ZP.get("登录"),"/initialization":a.ZP.get("初始化"),"/crontab":a.ZP.get("定时任务"),"/env":a.ZP.get("环境变量"),"/subscription":a.ZP.get("订阅管理"),"/config":a.ZP.get("配置文件"),"/script":a.ZP.get("脚本管理"),"/diff":a.ZP.get("对比工具"),"/log":a.ZP.get("日志管理"),"/setting":a.ZP.get("系统设置"),"/error":a.ZP.get("错误日志"),"/dependence":a.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},97302:function(e,t,n){"use strict";n.d(t,{eY:function(){return a},um:function(){return i},z:function(){return r}});var a="     ",i={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript",".ini":"ini",".json":"json"},r=["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"]},62348:function(e,t,n){"use strict";n.d(t,{E:function(){return i}});var a=n(72317);function i(e){var t=1e3*e,n=Math.floor(t/864e5),i=t%864e5,r=Math.floor(i/36e5),o=i%36e5,s=Math.floor(o/6e4),c=o%6e4,l=Math.round(c/1e3),u="".concat(l," ").concat(a.ZP.get("秒"));return s>0&&(u="".concat(s," ").concat(a.ZP.get("分")," ")+u),r>0&&(u="".concat(r," ").concat(a.ZP.get("时")," ")+u),n>0&&(u="".concat(n," ").concat(a.ZP.get("天")," ")+u),u}},16314:function(e,t,n){"use strict";n.d(t,{W:function(){return Z}});var a=n(90228),i=n.n(a),r=n(87999),o=n.n(r),s=n(72317),c=n(61508),l=n(33839),u=n(3475),d=n(98783),m=n(69313),g=n(52676);c.ZP.config({duration:2});var p=Date.now(),f=m.Z.create({timeout:6e4,params:{t:p}}),h=["/api/user/login","/open/auth/token","/api/user/two-factor/login","/api/system","/api/user/init","/api/user/notification/init"];f.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})),f.interceptors.response.use(function(){var e=o()(i()().mark((function e(t){var n,a,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.status,![502,504].includes(n)){e.next=5;break}d.history.push("/error"),e.next=18;break;case 5:if(401!==n){e.next=9;break}"/login"!==d.history.location.pathname&&(localStorage.removeItem(u.Z.authKey),d.history.push("/login")),e.next=18;break;case 9:return e.prev=9,200!==(a=t.data).code&&(r=a.message||a.data)&&l.Z.error({message:r,description:null!=a&&a.errors?(0,g.jsx)(g.Fragment,{children:null==a?void 0:a.errors.map((function(e){return(0,g.jsx)("div",{children:e.message})}))}):void 0}),e.abrupt("return",a);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.statusText,n=e.response.status;if([502,504].includes(n))d.history.push("/error");else if(401===n)"/login"!==d.history.location.pathname&&(c.ZP.error(s.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(u.Z.authKey),d.history.push("/login"));else{var a,i,r,o;if("function"==typeof(null===(a=e.config)||void 0===a?void 0:a.onError))return null===(o=e.config)||void 0===o?void 0:o.onError(e.response);t&&l.Z.error({message:t,description:null!==(i=e.response)&&void 0!==i&&null!==(i=i.data)&&void 0!==i&&i.errors?(0,g.jsx)(g.Fragment,{children:null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.errors)||void 0===r?void 0:r.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 Z=f},48916:function(e,t,n){"use strict";n.d(t,{DY:function(){return g},FA:function(){return f},H$:function(){return P},I1:function(){return m},W9:function(){return u},ZP:function(){return l},o4:function(){return x},rS:function(){return Z},w7:function(){return d},x$:function(){return p}});var a=n(15558),i=n.n(a),r=n(72317),o=n(97302),s=n(94046),c=n.n(s);function l(){var e=navigator.userAgent.toLowerCase(),t=function(t){return t.test(e)},n=function(t){return(e.match(t)||[]).toString().replace(/[^0-9|_.]/g,"").replace(/_/g,".")},a="unknow";t(/windows|win32|win64|wow32|wow64/g)?a="windows":t(/macintosh|macintel/g)?a="macos":t(/x11/g)?a="linux":t(/android|adr/g)?a="android":t(/ios|iphone|ipad|ipod|iwatch/g)&&(a="ios");var i="unknow";"windows"===a?t(/windows nt 5.0|windows 2000/g)?i="2000":t(/windows nt 5.1|windows xp/g)?i="xp":t(/windows nt 5.2|windows 2003/g)?i="2003":t(/windows nt 6.0|windows vista/g)?i="vista":t(/windows nt 6.1|windows 7/g)?i="7":t(/windows nt 6.2|windows 8/g)?i="8":t(/windows nt 6.3|windows 8.1/g)?i="8.1":t(/windows nt 10.0|windows 10/g)&&(i="10"):"macos"===a?i=n(/os x [\d._]+/g):"android"===a?i=n(/android [\d._]+/g):"ios"===a&&(i=n(/os [\d._]+/g));var r="unknow";"windows"===a||"macos"===a||"linux"===a?r="desktop":("android"===a||"ios"===a||t(/mobile/g))&&(r="mobile");var o="unknow",s="unknow";t(/applewebkit/g)?(o="webkit",t(/edge/g)?s="edge":t(/opr/g)?s="opera":t(/chrome/g)?s="chrome":t(/safari/g)&&(s="safari")):t(/gecko/g)&&t(/firefox/g)?(o="gecko",s="firefox"):t(/presto/g)?(o="presto",s="opera"):t(/trident|compatible|msie/g)&&(o="trident",s="iexplore");var c="unknow";"webkit"===o?c=n(/applewebkit\/[\d._]+/g):"gecko"===o?c=n(/gecko\/[\d._]+/g):"presto"===o?c=n(/presto\/[\d._]+/g):"trident"===o&&(c=n(/trident\/[\d._]+/g));var l="unknow";"chrome"===s?l=n(/chrome\/[\d._]+/g):"safari"===s?l=n(/version\/[\d._]+/g):"firefox"===s?l=n(/firefox\/[\d._]+/g):"opera"===s?l=n(/opr\/[\d._]+/g):"iexplore"===s?l=n(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===s&&(l=n(/edge\/[\d._]+/g));var u="none",d="unknow";t(/micromessenger/g)?(u="wechat",d=n(/micromessenger\/[\d._]+/g)):t(/qqbrowser/g)?(u="qq",d=n(/qqbrowser\/[\d._]+/g)):t(/ucbrowser/g)?(u="uc",d=n(/ucbrowser\/[\d._]+/g)):t(/qihu 360se/g)?u="360":t(/2345explorer/g)?(u="2345",d=n(/2345explorer\/[\d._]+/g)):t(/metasr/g)?u="sougou":t(/lbbrowser/g)?u="liebao":t(/maxthon/g)&&(u="maxthon",d=n(/maxthon\/[\d._]+/g));var m=Object.assign({engine:o,engineVs:c,platform:r,supporter:s,supporterVs:l,system:a,systemVs:i},"none"===u?{}:{shell:u,shellVs:d});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(m.system,"/").concat(m.systemVs,"\n浏览器:").concat(m.supporter,"/").concat(m.supporterVs,"\n内核:").concat(m.engine,"/").concat(m.engineVs),"color: green;font-size: 14px;font-weight: bold;"),m}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.extraHeight,n=e.target;void 0===t&&(t=99);var a=null,i=0;(a=n||document.querySelector(".ant-table-wrapper"))&&(i=a.getBoundingClientRect().top);var r=document.body.clientHeight-i-t;return r}function d(e,t){var n,a,i=window.URL||window.webkitURL||window,r=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=i.createObjectURL(r),o.download=e,n=o,(a=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(a)}function m(e,t,n){var a=i()(e),r=[];return function e(a){if(a)for(var i=0;i<(null==a?void 0:a.length);i++){if(t(a[i]))return n?void(a[i].children?a[i].children.unshift(n):a[i].children=[n]):void a.splice(i,1);a[i].children&&(r.push(a[i].key),e(a[i].children))}}(a),a}function g(e,t){var n;return function e(a){if(a)for(var i=0;i<(null==a?void 0:a.length);i++)t(a[i])?n=a[i]:a[i].children&&e(a[i].children)}(i()(e)),n}function p(e){return[o.eY,r.ZP.get("执行结束")].some((function(t){return e.includes(t)}))}function f(e){var t=e.split(" ");if("repo"===t[1]||"raw"===t[1])return t[2];var n=t.find((function(e){return[".js",".ts",".sh",".py"].some((function(t){return e.endsWith(t)}))}));if(n){var a,i,r="".concat(window.__ENV__QL_DIR,"/data/scripts");n.startsWith(r)&&(n=n.replace(r,""));var o=n.lastIndexOf("/");return o>=0?(i=n.slice(o+1),a=n.slice(0,o)):(i=n,a=""),[i,a]}}function h(e){try{var t=c().parseExpression(e);if(t)return t.next().toDate()}catch(e){}return null}function Z(e,t){var n=h(e);return null!=t&&t.length&&t.forEach((function(e){var t=h(e.schedule);t&&(!n||t<n)&&(n=t)})),n}function P(e){var t=function(e){if(!e)return"";var t=e.split(".");return".".concat(t[t.length-1])}(e);return o.um[t]}function x(){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"}},50810:function(){}}]);
1
+ (self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[4473,4555,5812,8851,2208],{44224:function(e,t,n){"use strict";var a=(0,n(19919).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_lc939gab1iq.js"]});t.Z=a},72439:function(e,t,n){"use strict";var a=n(48305),i=n.n(a),r=n(75271),o=n(30502),s=n(48916);t.Z=function(e,t){var n=(0,r.useState)(0),a=i()(n,2),c=a[0],l=a[1];return(0,o.Z)(e,(function(e){var n=e.target;n.classList.contains("ant-table-wrapper")||(n=e.target.querySelector(".ant-table-wrapper")),l((0,s.W9)({extraHeight:t,target:n}))})),c}},41860:function(e,t,n){"use strict";n.r(t),n.d(t,{getScheduleType:function(){return s},scheduleTypeMap:function(){return o}});var a=n(82092),i=n.n(a),r=n(44860),o=i()(i()(i()({},r.ScheduleType.Normal,""),r.ScheduleType.Once,"@once"),r.ScheduleType.Boot,"@boot"),s=function(e){return null!=e&&e.startsWith("@once")?r.ScheduleType.Once:null!=e&&e.startsWith("@boot")?r.ScheduleType.Boot:r.ScheduleType.Normal}},94526:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return L}});var a=n(26068),i=n.n(a),r=n(48305),o=n.n(r),s=n(72317),c=n(75271),l=n(50691),u=n(19293),d=n(45520),m=n(61508),g=n(48758),p=n(47667),f=n(59816),h=n(93481),Z=n(66633),P=n(70175),x=n(33886),v=n(9798),b=n(15631),y=n(56958),A=n(89709),k=n(86935),j=n(72523),w=n(44860),S=n(62348),C=n(16314),E=n(3475),B=n(63549),T=n(83383),M=n(44224),_=n(48916),q=n(17355),N=n(30502),I=n(16483),R=n.n(I),D=n(52676),O=l.Z.Text,G=[{key:"log",tab:s.ZP.get("日志")},{key:"script",tab:s.ZP.get("脚本")}],L=function(e){var t,n,a,r,I=e.cron,L=void 0===I?{}:I,W=e.handleCancel,K=e.visible,F=e.theme,z=e.isPhone,V=(0,c.useState)("log"),H=o()(V,2),Y=H[0],U=H[1],Q=(0,c.useState)(!0),J=o()(Q,2),X=(J[0],J[1]),$=(0,c.useState)([]),ee=o()($,2),te=ee[0],ne=ee[1],ae=(0,c.useState)(""),ie=o()(ae,2),re=ie[0],oe=ie[1],se=(0,c.useState)(""),ce=o()(se,2),le=ce[0],ue=ce[1],de=(0,c.useState)(!1),me=o()(de,2),ge=me[0],pe=me[1],fe=(0,c.useRef)(null),he=(0,c.useState)({}),Ze=o()(he,2),Pe=Ze[0],xe=Ze[1],ve=(0,c.useState)(""),be=o()(ve,2),ye=be[0],Ae=be[1],ke=(0,c.useState)(G),je=o()(ke,2),we=je[0],Se=je[1],Ce=(0,c.useState)({}),Ee=o()(Ce,2),Be=Ee[0],Te=Ee[1],Me=(0,c.useRef)(null),_e=function(e){var t=(0,c.useState)(0),n=o()(t,2),a=n[0],i=n[1];return(0,N.Z)(e,(function(e){var t=e.target.clientHeight;a!==t&&i(t)})),a}(Me),qe={log:(0,D.jsx)("div",{ref:Me,children:(0,D.jsx)(u.ZP,{children:(0,D.jsx)(q.Z,{data:te,height:_e,itemHeight:47,itemKey:"filename",children:function(e){return(0,D.jsxs)(u.ZP.Item,{className:"log-item",onClick:function(){return Ne(e)},children:[(0,D.jsx)(P.Z,{style:{marginRight:10}}),e.directory,"/",e.filename]})}})})}),script:Pe.filename&&(0,D.jsx)(T.ZP,{language:(0,_.H$)(Pe.filename),theme:F,value:le,options:{fontSize:12,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1,accessibilitySupport:"off"},onMount:function(e,t){fe.current=e}})},Ne=function(e){var t="".concat(E.Z.apiPrefix,"logs/detail?file=").concat(e.filename,"&path=").concat(e.directory||"");localStorage.setItem("logCron",t),Ae(t),C.W.get(t).then((function(e){var t=e.code,n=e.data;200===t&&(oe(n),pe(!0))}))},Ie=function(){X(!0),C.W.get("".concat(E.Z.apiPrefix,"crons/").concat(L.id,"/logs")).then((function(e){var t=e.code,n=e.data;200===t&&ne(n)})).finally((function(){return X(!1)}))};return(0,c.useEffect)((function(){L&&L.id&&(Te(L),Ie(),function(){var e=(0,_.FA)(L.command);if(Array.isArray(e)){Se(we);var t=o()(e,2),n=t[0],a=t[1];xe({parent:a,filename:n}),C.W.get("".concat(E.Z.apiPrefix,"scripts/detail?file=").concat(n,"&path=").concat(a||"")).then((function(e){var t=e.code,n=e.data;200===t&&ue(n)}))}else Se([we[0]]),U("log")}())}),[L]),(0,D.jsxs)(d.Z,{title:(0,D.jsxs)("div",{className:"crontab-title-wrapper",children:[(0,D.jsxs)("div",{style:{minWidth:0,display:"flex",alignItems:"center"},children:[(0,D.jsx)(l.Z.Text,{style:{width:200,boxSizing:"content-box"},ellipsis:{onEllipsis:function(e){return e},tooltip:Be.name},children:Be.name}),(null===(t=Be.labels)||void 0===t?void 0:t.length)>0&&""!==Be.labels[0]&&(0,D.jsx)(g.Z,{type:"vertical"}),(null===(n=Be.labels)||void 0===n?void 0:n.length)>0&&""!==Be.labels[0]&&(null===(a=Be.labels)||void 0===a?void 0:a.map((function(e,t){return(0,D.jsx)(p.Z,{color:"blue",style:{marginRight:5},children:e},e)})))]}),(0,D.jsxs)("div",{className:"operations",children:[(0,D.jsx)(f.Z,{title:Be.status===w.CrontabStatus.idle?s.ZP.get("运行"):s.ZP.get("停止"),children:(0,D.jsx)(h.Z,{type:"link",icon:Be.status===w.CrontabStatus.idle?(0,D.jsx)(x.Z,{}):(0,D.jsx)(v.Z,{}),size:"small",onClick:Be.status===w.CrontabStatus.idle?function(){d.Z.confirm({title:s.ZP.get("确认运行"),content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认运行定时任务")," ",(0,D.jsx)(O,{style:{wordBreak:"break-all"},type:"warning",children:Be.name})," ",s.ZP.get("吗")]}),onOk:function(){C.W.put("".concat(E.Z.apiPrefix,"crons/run"),[Be.id]).then((function(e){var t=e.code;e.data;200===t&&(Te(i()(i()({},Be),{},{status:w.CrontabStatus.running})),setTimeout((function(){Ie()}),1e3))}))}})}:function(){d.Z.confirm({title:s.ZP.get("确认停止"),content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认停止定时任务")," ",(0,D.jsx)(O,{style:{wordBreak:"break-all"},type:"warning",children:Be.name})," ",s.ZP.get("吗")]}),onOk:function(){C.W.put("".concat(E.Z.apiPrefix,"crons/stop"),[Be.id]).then((function(e){var t=e.code;e.data;200===t&&Te(i()(i()({},Be),{},{status:w.CrontabStatus.idle}))}))}})}})}),(0,D.jsx)(f.Z,{title:1===Be.isDisabled?s.ZP.get("启用"):s.ZP.get("禁用"),children:(0,D.jsx)(h.Z,{type:"link",icon:(0,D.jsx)(M.Z,{type:1===Be.isDisabled?"ql-icon-enable":"ql-icon-disable"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Be.isDisabled?s.ZP.get("启用"):s.ZP.get("禁用")),content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认"),1===Be.isDisabled?s.ZP.get("启用"):s.ZP.get("禁用"),s.ZP.get("定时任务")," ",(0,D.jsx)(O,{style:{wordBreak:"break-all"},type:"warning",children:Be.name})," ",s.ZP.get("吗")]}),onOk:function(){C.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Be.isDisabled?"enable":"disable"),[Be.id]).then((function(e){var t=e.code;e.data;200===t&&Te(i()(i()({},Be),{},{isDisabled:1===Be.isDisabled?0:1}))}))}})}})}),(0,D.jsx)(f.Z,{title:1===Be.isPinned?s.ZP.get("取消置顶"):s.ZP.get("置顶"),children:(0,D.jsx)(h.Z,{type:"link",icon:(0,D.jsx)(M.Z,{type:1===Be.isPinned?"ql-icon-untop":"ql-icon-top"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Be.isPinned?s.ZP.get("取消置顶"):s.ZP.get("置顶")),content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认"),1===Be.isPinned?s.ZP.get("取消置顶"):s.ZP.get("置顶"),s.ZP.get("定时任务")," ",(0,D.jsx)(O,{style:{wordBreak:"break-all"},type:"warning",children:Be.name})," ",s.ZP.get("吗")]}),onOk:function(){C.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Be.isPinned?"unpin":"pin"),[Be.id]).then((function(e){var t=e.code;e.data;200===t&&Te(i()(i()({},Be),{},{isPinned:1===Be.isPinned?0:1}))}))}})}})})]})]}),centered:!0,open:K,forceRender:!0,footer:!1,onCancel:function(){return W()},wrapClassName:"crontab-detail",width:z?"":"80vw",children:[(0,D.jsxs)("div",{className:"card-wrapper",children:[(0,D.jsx)(Z.Z,{children:(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("任务")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Be.command})]})}),(0,D.jsxs)(Z.Z,{style:{marginTop:10},children:[(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("状态")}),(0,D.jsxs)("div",{className:"cron-detail-info-value",children:[(!Be.isDisabled||Be.status!==w.CrontabStatus.idle)&&(0,D.jsxs)(D.Fragment,{children:[Be.status===w.CrontabStatus.idle&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(b.Z,{}),color:"default",children:s.ZP.get("空闲中")}),Be.status===w.CrontabStatus.running&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(y.Z,{spin:!0}),color:"processing",children:s.ZP.get("运行中")}),Be.status===w.CrontabStatus.queued&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(A.Z,{}),color:"default",children:s.ZP.get("队列中")})]}),1===Be.isDisabled&&Be.status===w.CrontabStatus.idle&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(k.Z,{}),color:"error",children:s.ZP.get("已禁用")})]})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("定时")}),(0,D.jsxs)("div",{className:"cron-detail-info-value",children:[(0,D.jsx)("div",{children:Be.schedule}),null===(r=Be.extra_schedules)||void 0===r?void 0:r.map((function(e){return(0,D.jsx)("div",{children:e.schedule},e.schedule)}))]})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("最后运行时间")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Be.last_execution_time?R()(1e3*Be.last_execution_time).format("YYYY-MM-DD HH:mm:ss"):"-"})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("最后运行时长")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Be.last_running_time?(0,S.E)(Be.last_running_time):"-"})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:s.ZP.get("下次运行时间")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Be.nextRunTime&&R()(Be.nextRunTime).format("YYYY-MM-DD HH:mm:ss")})]})]}),(0,D.jsx)(Z.Z,{style:{marginTop:10},tabList:we,activeTabKey:Y,onTabChange:function(e){!function(e){U(e)}(e)},tabBarExtraContent:"script"===Y&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(h.Z,{type:"primary",style:{marginRight:8},onClick:function(){d.Z.confirm({title:"确认保存",content:(0,D.jsxs)(D.Fragment,{children:[s.ZP.get("确认保存文件"),(0,D.jsxs)(O,{style:{wordBreak:"break-all"},type:"warning",children:[" ",Pe.filename]}),s.ZP.get(",保存后不可恢复")]}),onOk:function(){var e=fe.current?fe.current.getValue().replace(/\r\n/g,"\n"):le;return new Promise((function(t,n){C.W.put("".concat(E.Z.apiPrefix,"scripts"),{filename:Pe.filename,path:Pe.parent||"",content:e}).then((function(n){var a=n.code;n.data;200===a&&(ue(e),m.ZP.success("保存成功")),t(null)})).catch((function(e){return n(e)}))}))}})},children:s.ZP.get("保存")}),(0,D.jsx)(h.Z,{type:"primary",icon:(0,D.jsx)(j.Z,{}),onClick:function(){var e;null===(e=fe.current._domElement.parentElement)||void 0===e||e.requestFullscreen()}})]}),children:qe[Y]})]}),(0,D.jsx)(B.default,{visible:ge,handleCancel:function(){pe(!1)},cron:L,data:re,logUrl:ye})]})}},26932:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ue}});var a=n(90228),i=n.n(a),r=n(15558),o=n.n(r),s=n(87999),c=n.n(s),l=n(48305),u=n.n(l),d=n(26068),m=n.n(d),g=n(72439),p=n(48916),f=n(3475),h=n(62348),Z=n(16314),P=n(15631),x=n(56958),v=n(89709),b=n(86935),y=n(28423),A=n(44084),k=n(1704),j=n(13868),w=n(88939),S=n(96553),C=n(97953),E=n(88629),B=n(83649),T=n(21288),M=n(76991),_=n(7802),q=n(47508),N=n(98783),I=n(50691),R=n(17082),D=n(47667),O=n(63505),G=n(45520),L=n(61508),W=n(85950),K=n(93481),F=n(46035),z=n(10948),V=n(16483),H=n.n(V),Y=n(32699),U=n(75271),Q=n(72317),J=n(19610),X=n(41860),$=n(94526),ee=n(63549),te=n(97583),ne=n(44860),ae=n(42208),ie=n(36199),re=n(52676),oe=I.Z.Text,se=I.Z.Paragraph,ce=I.Z.Link,le=R.Z.Search,ue=function(){var e=(0,N.useOutletContext)(),t=e.headerStyle,n=e.isPhone,a=e.theme,r=[{title:Q.ZP.get("名称"),dataIndex:"name",key:"name",fixed:"left",width:120,render:function(e,t){return(0,re.jsx)(se,{style:{wordBreak:"break-all",marginBottom:0,color:"#1890ff",cursor:"pointer"},ellipsis:{tooltip:e,rows:2},onClick:function(){tt(t),Je(!0)},children:(0,re.jsx)(ce,{children:t.name||"-"})})},sorter:{compare:function(e,t){var n;return null==e||null===(n=e.name)||void 0===n?void 0:n.localeCompare(null==t?void 0:t.name)}}},{title:Q.ZP.get("命令/脚本"),dataIndex:"command",key:"command",width:240,render:function(e,t){return(0,re.jsx)(se,{style:{wordBreak:"break-all",marginBottom:0},ellipsis:{tooltip:e,rows:2},children:(0,re.jsx)("a",{onClick:function(){It(t)},children:e})})},sorter:{compare:function(e,t){return e.command.localeCompare(t.command)}}},{title:Q.ZP.get("状态"),key:"status",dataIndex:"status",width:100,filters:[{text:Q.ZP.get("运行中"),value:ne.CrontabStatus.running},{text:Q.ZP.get("空闲中"),value:ne.CrontabStatus.idle},{text:Q.ZP.get("已禁用"),value:ne.CrontabStatus.disabled},{text:Q.ZP.get("队列中"),value:ne.CrontabStatus.queued}],render:function(e,t){return(0,re.jsxs)(re.Fragment,{children:[(!t.isDisabled||t.status!==ne.CrontabStatus.idle)&&(0,re.jsxs)(re.Fragment,{children:[t.status===ne.CrontabStatus.idle&&(0,re.jsx)(D.Z,{icon:(0,re.jsx)(P.Z,{}),color:"default",children:Q.ZP.get("空闲中")}),t.status===ne.CrontabStatus.running&&(0,re.jsx)(D.Z,{icon:(0,re.jsx)(x.Z,{spin:!0}),color:"processing",children:Q.ZP.get("运行中")}),t.status===ne.CrontabStatus.queued&&(0,re.jsx)(D.Z,{icon:(0,re.jsx)(v.Z,{}),color:"default",children:Q.ZP.get("队列中")})]}),1===t.isDisabled&&t.status===ne.CrontabStatus.idle&&(0,re.jsx)(D.Z,{icon:(0,re.jsx)(b.Z,{}),color:"error",children:Q.ZP.get("已禁用")})]})}},{title:Q.ZP.get("定时规则"),dataIndex:"schedule",key:"schedule",width:150,sorter:{compare:function(e,t){return e.schedule.localeCompare(t.schedule)}},render:function(e,t){var n;return(0,re.jsx)(se,{style:{wordBreak:"break-all",marginBottom:0},ellipsis:{tooltip:{placement:"right",title:(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)("div",{children:e}),null===(n=t.extra_schedules)||void 0===n?void 0:n.map((function(e){return(0,re.jsx)("div",{children:e.schedule},e.schedule)}))]})},rows:2},children:e})}},{title:Q.ZP.get("最后运行时长"),width:167,dataIndex:"last_running_time",key:"last_running_time",sorter:{compare:function(e,t){return e.last_running_time-t.last_running_time}},render:function(e,t){return t.last_running_time?(0,h.E)(t.last_running_time):"-"}},{title:Q.ZP.get("最后运行时间"),dataIndex:"last_execution_time",key:"last_execution_time",width:141,sorter:{compare:function(e,t){return(e.last_execution_time||0)-(t.last_execution_time||0)}},render:function(e,t){return(0,re.jsx)("span",{style:{display:"block"},children:t.last_execution_time?H()(1e3*t.last_execution_time).format("YYYY-MM-DD HH:mm:ss"):"-"})}},{title:Q.ZP.get("下次运行时间"),width:144,sorter:{compare:function(e,t){return e.nextRunTime-t.nextRunTime}},render:function(e,t){return t.nextRunTime?H()(t.nextRunTime).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:Q.ZP.get("关联订阅"),width:185,render:function(e,t){var n;return(null==t||null===(n=t.subscription)||void 0===n?void 0:n.name)||"-"}},{title:Q.ZP.get("操作"),key:"action",width:140,fixed:n?void 0:"right",render:function(e,t,n){return(0,re.jsxs)(O.Z,{size:"middle",children:[t.status===ne.CrontabStatus.idle&&(0,re.jsx)("a",{onClick:function(e){e.stopPropagation(),Ot(t,n)},children:Q.ZP.get("运行")}),t.status!==ne.CrontabStatus.idle&&(0,re.jsx)("a",{onClick:function(e){e.stopPropagation(),Gt(t,n)},children:Q.ZP.get("停止")}),(0,re.jsx)("a",{onClick:function(e){e.stopPropagation(),Ne(m()(m()({},t),{},{timestamp:Date.now()}))},children:Q.ZP.get("日志")}),(0,re.jsx)(Wt,{record:t,index:n},"more")]})}}],s=(0,U.useState)([]),l=u()(s,2),d=l[0],I=l[1],R=(0,U.useState)(!0),V=u()(R,2),ue=V[0],de=V[1],me=(0,U.useState)(!1),ge=u()(me,2),pe=ge[0],fe=ge[1],he=(0,U.useState)(!1),Ze=u()(he,2),Pe=Ze[0],xe=Ze[1],ve=(0,U.useState)(),be=u()(ve,2),ye=be[0],Ae=be[1],ke=(0,U.useState)(""),je=u()(ke,2),we=je[0],Se=je[1],Ce=(0,U.useState)(!1),Ee=u()(Ce,2),Be=Ee[0],Te=Ee[1],Me=(0,U.useState)(),_e=u()(Me,2),qe=_e[0],Ne=_e[1],Ie=(0,U.useState)([]),Re=u()(Ie,2),De=Re[0],Oe=Re[1],Ge=(0,U.useState)({}),Le=u()(Ge,2),We=Le[0],Ke=Le[1],Fe=(0,U.useState)(),ze=u()(Fe,2),Ve=ze[0],He=ze[1],Ye=(0,U.useState)(!1),Ue=u()(Ye,2),Qe=Ue[0],Je=Ue[1],Xe=(0,U.useState)(),$e=u()(Xe,2),et=$e[0],tt=$e[1],nt=(0,U.useState)(""),at=u()(nt,2),it=at[0],rt=at[1],ot=(0,U.useState)(),st=u()(ot,2),ct=st[0],lt=st[1],ut=(0,U.useState)(!1),dt=u()(ut,2),mt=dt[0],gt=dt[1],pt=(0,U.useState)(!1),ft=u()(pt,2),ht=ft[0],Zt=ft[1],Pt=(0,U.useState)([]),xt=u()(Pt,2),vt=xt[0],bt=xt[1],yt=(0,U.useState)([]),At=u()(yt,2),kt=At[0],jt=At[1],wt=(0,U.useState)(!1),St=u()(wt,2),Ct=St[0],Et=St[1],Bt=(0,U.useRef)(null),Tt=(0,g.Z)(Bt),Mt=(0,U.useState)(""),_t=u()(Mt,2),qt=_t[0],Nt=_t[1],It=function(e){var t=(0,p.FA)(e.command);if(Array.isArray(t)){var n=u()(t,2),a=n[0],i=n[1];N.history.push("/script?p=".concat(i,"&s=").concat(a))}else t&&(location.href=t)},Rt=function(){de(!0);var e=We.page,t=We.size,n=We.sorter,a=We.filters,r="".concat(f.Z.apiPrefix,"crons?searchValue=").concat(we,"&page=").concat(e,"&size=").concat(t,"&filters=").concat(JSON.stringify(a));n&&n.column&&n.order&&(r+="&sorter=".concat(JSON.stringify({field:n.column.key,type:"ascend"===n.order?"ASC":"DESC"}))),Ve&&(r+="&queryString=".concat(JSON.stringify({filters:Ve.filters,sorts:Ve.sorts,filterRelation:Ve.filterRelation||"and"}))),Z.W.get(r).then(function(){var e=c()(i()().mark((function e(t){var n,a,r,s,c,l,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.code,a=t.data,200!==n){e.next=9;break}return s=a.data,c=a.total,e.next=5,Z.W.get("".concat(f.Z.apiPrefix,"subscriptions?ids=").concat(JSON.stringify(o()(new Set(s.map((function(e){return e.sub_id})).filter(Boolean))))),{onError:Y.noop});case 5:l=e.sent,u=Object.fromEntries(null==l||null===(r=l.data)||void 0===r?void 0:r.map((function(e){return[e.id,e]}))),I(s.map((function(e){var t=(0,X.getScheduleType)(e.schedule)===ne.ScheduleType.Normal?(0,p.rS)(e.schedule,e.extra_schedules):null;return m()(m()({},e),{},{nextRunTime:t,subscription:null==u?void 0:u[e.sub_id]})}))),lt(c);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).finally((function(){return de(!1)}))},Dt=function(e,t){Ae(e),fe(!0)},Ot=function(e,t){G.Z.confirm({title:Q.ZP.get("确认运行"),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认运行定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/run"),[e.id]).then((function(t){var n=t.code;t.data;if(200===n){var a=o()(d),i=a.findIndex((function(t){return t.id===e.id}));-1!==i&&(a.splice(i,1,m()(m()({},e),{},{status:ne.CrontabStatus.running})),I(a))}}))}})},Gt=function(e,t){G.Z.confirm({title:Q.ZP.get("确认停止"),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认停止定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/stop"),[e.id]).then((function(t){var n=t.code;t.data;if(200===n){var a=o()(d),i=a.findIndex((function(t){return t.id===e.id}));-1!==i&&(a.splice(i,1,m()(m()({},e),{},{pid:null,status:ne.CrontabStatus.idle})),I(a))}}))}})},Lt=function(e){return[{label:Q.ZP.get("编辑"),key:"edit",icon:(0,re.jsx)(y.Z,{})},{label:1===e.isDisabled?Q.ZP.get("启用"):Q.ZP.get("禁用"),key:"enableOrDisable",icon:1===e.isDisabled?(0,re.jsx)(A.Z,{}):(0,re.jsx)(k.Z,{})},{label:Q.ZP.get("复制"),key:"copy",icon:(0,re.jsx)(j.Z,{})},{label:Q.ZP.get("删除"),key:"delete",icon:(0,re.jsx)(w.Z,{})},{label:1===e.isPinned?Q.ZP.get("取消置顶"):Q.ZP.get("置顶"),key:"pinOrUnPin",icon:1===e.isPinned?(0,re.jsx)(k.Z,{}):(0,re.jsx)(S.Z,{})}]},Wt=function(e){var t=e.record,n=e.index;return(0,re.jsx)(W.Z,{placement:"bottomRight",trigger:["click"],menu:{items:Lt(t),onClick:function(e){var a=e.key;e.domEvent.stopPropagation(),Kt(a,t,n)}},children:(0,re.jsx)("a",{onClick:function(e){return e.stopPropagation()},children:(0,re.jsx)(C.Z,{})})})},Kt=function(e,t,n){switch(e){case"edit":Dt(t);break;case"copy":Dt((0,Y.omit)(t,"id"));break;case"enableOrDisable":!function(e,t){G.Z.confirm({title:"确认".concat(1===e.isDisabled?Q.ZP.get("启用"):Q.ZP.get("禁用")),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认"),1===e.isDisabled?Q.ZP.get("启用"):Q.ZP.get("禁用"),Q.ZP.get("定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/").concat(1===e.isDisabled?"enable":"disable"),[e.id]).then((function(t){var n=t.code;if(t.data,200===n){var a=1===e.isDisabled?0:1,i=o()(d),r=i.findIndex((function(t){return t.id===e.id}));-1!==r&&(i.splice(r,1,m()(m()({},e),{},{isDisabled:a})),I(i))}}))}})}(t);break;case"delete":!function(e,t){G.Z.confirm({title:Q.ZP.get("确认删除"),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认删除定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.delete("".concat(f.Z.apiPrefix,"crons"),{data:[e.id]}).then((function(t){var n=t.code;if(t.data,200===n){L.ZP.success(Q.ZP.get("删除成功"));var a=o()(d),i=a.findIndex((function(t){return t.id===e.id}));-1!==i&&(a.splice(i,1),I(a))}}))}})}(t);break;case"pinOrUnPin":!function(e,t){G.Z.confirm({title:"确认".concat(1===e.isPinned?Q.ZP.get("取消置顶"):Q.ZP.get("置顶")),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认"),1===e.isPinned?Q.ZP.get("取消置顶"):Q.ZP.get("置顶"),Q.ZP.get("定时任务")," ",(0,re.jsx)(oe,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",Q.ZP.get("吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/").concat(1===e.isPinned?"unpin":"pin"),[e.id]).then((function(t){var n=t.code;if(t.data,200===n){var a=1===e.isPinned?0:1,i=o()(d),r=i.findIndex((function(t){return t.id===e.id}));-1!==r&&(i.splice(r,1,m()(m()({},e),{},{isPinned:a})),I(i))}}))}})}(t)}},Ft={selectedRowKeys:De,onChange:function(e){Oe(e)}},zt=function(e){G.Z.confirm({title:"确认".concat(ne.OperationName[e]),content:(0,re.jsxs)(re.Fragment,{children:[Q.ZP.get("确认"),ne.OperationName[e],Q.ZP.get("选中的定时任务吗")]}),onOk:function(){Z.W.put("".concat(f.Z.apiPrefix,"crons/").concat(ne.OperationPath[e]),De).then((function(e){var t=e.code;e.data;200===t&&Rt()}))}})};(0,U.useEffect)((function(){qe&&(localStorage.setItem("logCron",qe.id),Te(!0))}),[qe]),(0,U.useEffect)((function(){Ke(m()(m()({},We),{},{page:1}))}),[we]),(0,U.useEffect)((function(){We.page&&We.size&&Rt(),Ve&&Ve.id&&Nt(Ve.id)}),[We,Ve]),(0,U.useEffect)((function(){if(Ve&&kt&&kt.length>0){var e=kt.slice(10).find((function(e){return e.id===Ve.id}));Et(!!e)}}),[Ve,kt]),(0,U.useEffect)((function(){Ht()}),[]);var Vt={onClick:function(e){var t=e.key;e.domEvent.stopPropagation(),function(e){switch(e){case"new":gt(!0);break;case"manage":Zt(!0);break;default:Yt(e)}}(t)},items:[].concat(o()(o()(kt).slice(10).map((function(e){return{label:(0,re.jsxs)(O.Z,{style:{display:"flex",justifyContent:"space-between"},children:[(0,re.jsx)("span",{children:e.name}),(null==Ve?void 0:Ve.id)===e.id&&(0,re.jsx)(E.Z,{style:{color:"#1890ff"}})]}),key:e.id,icon:(0,re.jsx)(B.Z,{})}}))),[{type:"divider"},{label:Q.ZP.get("创建视图"),key:"new",icon:(0,re.jsx)(T.Z,{})},{label:Q.ZP.get("视图管理"),key:"manage",icon:(0,re.jsx)(M.Z,{})}]),style:{maxHeight:350,overflowY:"auto"}},Ht=function(){de(!0),Z.W.get("".concat(f.Z.apiPrefix,"crons/views")).then((function(e){var t=e.code,n=e.data;if(200===t){bt(n);var a=n.filter((function(e){return!e.isDisabled})).map((function(e){return m()(m()({},e),{},{name:"全部任务"===e.name?Q.ZP.get("全部任务"):e.name})}));jt(a),Ke({page:1,size:parseInt(localStorage.getItem("pageSize")||"20"),sorter:{},filters:{}}),He(m()({},a[0]))}})).finally((function(){de(!1)}))},Yt=function(e){var t=kt.find((function(t){return t.id==e}));Oe([]),Ke(m()(m()({},We),{},{page:1})),He(t||null)},Ut=(0,J.u)((function(){return{scroll:{y:Tt}}}),[Tt]),Qt=u()(Ut,1)[0];return(0,re.jsxs)(q.ZP,{className:"ql-container-wrapper crontab-wrapper ql-container-wrapper-has-tab",title:Q.ZP.get("定时任务"),extra:[(0,re.jsx)(le,{placeholder:Q.ZP.get("请输入名称或者关键词"),style:{width:"auto"},enterButton:!0,allowClear:!0,loading:ue,value:it,onChange:function(e){return rt(e.target.value)},onSearch:function(e){Se(e.trim())}}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return Ae(null),void fe(!0)},children:Q.ZP.get("创建任务")},"2")],header:{style:t},children:[(0,re.jsx)(F.Z,{defaultActiveKey:"all",size:"small",activeKey:qt,tabPosition:"top",className:"crontab-view ".concat(Ct?"more-active":""),tabBarExtraContent:(0,re.jsx)(W.Z,{menu:Vt,trigger:["click"],overlayStyle:{minWidth:200},children:(0,re.jsxs)("div",{className:"view-more ".concat(Ct?"active":""),children:[(0,re.jsxs)(O.Z,{children:[Q.ZP.get("更多"),(0,re.jsx)(_.Z,{})]}),(0,re.jsx)("div",{className:"ant-tabs-ink-bar ant-tabs-ink-bar-animated"})]})}),onTabClick:Yt,items:o()(o()(kt).slice(0,10).map((function(e){return{key:e.id,label:e.name}})))}),(0,re.jsxs)("div",{ref:Bt,children:[De.length>0&&(0,re.jsxs)("div",{style:{marginBottom:16},children:[(0,re.jsx)(K.Z,{type:"primary",style:{marginBottom:5},onClick:function(){G.Z.confirm({title:Q.ZP.get("确认删除"),content:(0,re.jsx)(re.Fragment,{children:Q.ZP.get("确认删除选中的定时任务吗")}),onOk:function(){Z.W.delete("".concat(f.Z.apiPrefix,"crons"),{data:De}).then((function(e){var t=e.code;e.data;200===t&&(L.ZP.success(Q.ZP.get("批量删除成功")),Oe([]),Rt())}))}})},children:Q.ZP.get("批量删除")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(0)},style:{marginLeft:8,marginBottom:5},children:Q.ZP.get("批量启用")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(1)},style:{marginLeft:8,marginRight:8},children:Q.ZP.get("批量禁用")}),(0,re.jsx)(K.Z,{type:"primary",style:{marginRight:8},onClick:function(){return zt(2)},children:Q.ZP.get("批量运行")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(3)},children:Q.ZP.get("批量停止")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(4)},style:{marginLeft:8,marginRight:8},children:Q.ZP.get("批量置顶")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return zt(5)},style:{marginLeft:8,marginRight:8},children:Q.ZP.get("批量取消置顶")}),(0,re.jsx)(K.Z,{type:"primary",onClick:function(){return xe(!0)},style:{marginLeft:8,marginRight:8},children:Q.ZP.get("批量修改标签")}),(0,re.jsxs)("span",{style:{marginLeft:8},children:[Q.ZP.get("已选择"),(0,re.jsx)("a",{children:null==De?void 0:De.length}),Q.ZP.get("项")]})]}),(0,re.jsx)(z.Z,{columns:r,pagination:{current:We.page,pageSize:We.size,showSizeChanger:!0,simple:n,total:ct,showTotal:function(e,t){return"第 ".concat(t[0],"-").concat(t[1]," 条/总共 ").concat(e," 条")},pageSizeOptions:[10,20,50,100,200,500,ct||1e4].sort((function(e,t){return e-t}))},dataSource:d,rowKey:"id",size:"middle",scroll:{x:1200,y:Tt},loading:ue,rowSelection:Ft,rowClassName:function(e,t){return e.isPinned?"pinned-cron cron":"cron"},onChange:function(e,t,n){var a=e.current,i=e.pageSize;Ke({page:a,size:i,sorter:n,filters:t}),localStorage.setItem("pageSize",String(i))},components:n||We.size<50?void 0:Qt})]}),(0,re.jsx)(ee.default,{visible:Be,handleCancel:function(){var e;e=qe,Z.W.get("".concat(f.Z.apiPrefix,"crons/").concat(e.id)).then((function(t){var n=t.code,a=t.data;if(200===n){var i=d.findIndex((function(t){return t.id===e.id})),r=o()(d);a.nextRunTime=(0,p.rS)(a.schedule,a.extra_schedules),-1!==i&&(r.splice(i,1,m()(m()({},e),a)),I(r))}})).finally((function(){return de(!1)})),Te(!1)},cron:qe}),(0,re.jsx)(te.default,{visible:pe,handleCancel:function(){fe(!1),Rt()},cron:ye}),(0,re.jsx)(te.CronLabelModal,{visible:Pe,handleCancel:function(e){xe(!1),e&&Rt()},ids:De}),(0,re.jsx)($.default,{visible:Qe,handleCancel:function(){Je(!1)},cron:et,theme:a,isPhone:n}),(0,re.jsx)(ae.default,{visible:mt,handleCancel:function(e){gt(!1),Ht()}}),(0,re.jsx)(ie.default,{cronViews:vt,visible:ht,handleCancel:function(){Zt(!1)},cronViewChange:function(e){Ht()}})]})}},63549:function(e,t,n){"use strict";n.r(t);var a=n(48305),i=n.n(a),r=n(72317),o=n(75271),s=n(32890),c=n(50691),l=n(45520),u=n(93481),d=n(16314),m=n(3475),g=n(56958),p=n(44084),f=n(34014),h=n(48916),Z=n(78060),P=n.n(Z),x=n(52676);s.Z.Countdown;t.default=function(e){var t=e.cron,n=e.handleCancel,a=e.visible,s=e.data,Z=e.logUrl,v=(0,o.useState)(r.ZP.get("启动中...")),b=i()(v,2),y=b[0],A=b[1],k=(0,o.useState)(!0),j=i()(k,2),w=j[0],S=j[1],C=(0,o.useState)(!0),E=i()(C,2),B=E[0],T=E[1],M=(0,o.useState)(!1),_=i()(M,2),q=_[0],N=_[1],I=(0,o.useRef)({value:0,down:!0}),R=Z||String(null==t?void 0:t.id),D=function e(n){n&&S(!0),d.W.get(Z||"".concat(m.Z.apiPrefix,"crons/").concat(t.id,"/log")).then((function(t){var n=t.code,a=t.data;if(200===n&&localStorage.getItem("logCron")===R&&a!==y){var i=a;A(i||r.ZP.get("暂无日志"));var o=Boolean(i&&!(0,h.x$)(i)&&!i.includes("任务未运行"));o||(0,h.x$)(y)||y===r.ZP.get("启动中...")||setTimeout((function(){O()})),T(o),o&&setTimeout((function(){O(),e()}),2e3)}})).finally((function(){n&&S(!1)}))},O=function(){I.current.down&&setTimeout((function(){document.querySelector("#log-flag").scrollIntoView({behavior:"smooth"})}),600)},G=function(){localStorage.removeItem("logCron"),n()};return(0,o.useEffect)((function(){t&&t.id&&a&&(D(!0),I.current.down=!0)}),[t,a]),(0,o.useEffect)((function(){s&&A(s)}),[s]),(0,o.useEffect)((function(){N(document.body.clientWidth<768)}),[]),(0,x.jsx)(l.Z,{title:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(B||w)&&(0,x.jsx)(g.Z,{spin:!0}),!B&&!w&&(0,x.jsx)(p.Z,{}),(0,x.jsx)(c.Z.Text,{ellipsis:!0,style:{marginLeft:5},children:t&&t.name})]}),open:a,centered:!0,className:"log-modal",forceRender:!0,onOk:function(){return G()},onCancel:function(){return G()},footer:[(0,x.jsx)(u.Z,{type:"primary",onClick:function(){return G()},children:r.ZP.get("知道了")})],children:(0,x.jsxs)("div",{onScroll:function(e){var t=e.target.scrollTop;I.current.down&&(I.current={value:t,down:t-I.current.value>-5||!t})},className:"log-container",children:[w?(0,x.jsx)(f.Z,{}):(0,x.jsx)("pre",{style:q?{fontFamily:"Source Code Pro",zoom:.83}:{},children:(0,x.jsx)(P(),{children:y})}),(0,x.jsx)("div",{id:"log-flag"})]})})}},97583:function(e,t,n){"use strict";n.r(t),n.d(t,{CronLabelModal:function(){return D},default:function(){return R}});var a=n(67825),i=n.n(a),r=n(90228),o=n.n(r),s=n(26068),c=n.n(s),l=n(87999),u=n.n(l),d=n(48305),m=n.n(d),g=n(15558),p=n.n(g),f=n(72317),h=n(47667),Z=n(17082),P=n(78646),x=n(21288),v=n(75271),b=n(52676),y=function(e){var t=e.value,n=e.onChange,a=(0,v.useState)(""),i=m()(a,2),r=i[0],o=i[1],s=(0,v.useState)(!1),c=m()(s,2),l=c[0],u=c[1],d=(0,v.useState)([]),g=m()(d,2),y=g[0],A=g[1],k=(0,v.useRef)(),j=function(){r&&!y.includes(r)&&(A([].concat(p()(y),[r])),null==n||n([].concat(p()(y),[r]))),u(!1),o("")},w=y.map((function(e){var t=(0,b.jsx)(h.Z,{closable:!0,onClose:function(t){var a,i;t.preventDefault(),a=e,i=y.filter((function(e){return e!==a})),A(i),null==n||n(i)},children:e});return(0,b.jsx)("span",{style:{display:"inline-block",marginBottom:8},children:t},e)}));return(0,v.useEffect)((function(){l&&k&&k.current.focus()}),[l]),(0,v.useEffect)((function(){t&&A(t)}),[t]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P.Z,{enter:{scale:.8,opacity:0,type:"from",duration:100},leave:{opacity:0,width:0,scale:0,duration:200},appear:!1,children:w}),l&&(0,b.jsx)(Z.Z,{ref:k,type:"text",size:"small",style:{width:78},value:r,onChange:function(e){o(e.target.value)},onBlur:j,onPressEnter:j}),!l&&(0,b.jsxs)(h.Z,{onClick:function(){u(!0)},style:{borderStyle:"dashed",cursor:"pointer"},children:[(0,b.jsx)(x.Z,{})," ",f.ZP.get("新建")]})]})},A=n(3475),k=n(16314),j=n(37559),w=n(72338),S=n(61508),C=n(35181),E=n(63505),B=n(45520),T=n(93481),M=n(94046),_=n.n(M),q=n(41860),N=n(44860),I=["key","name"],R=function(e){var t=e.cron,n=e.handleCancel,a=e.visible,r=w.Z.useForm(),s=m()(r,1)[0],l=(0,v.useState)(!1),d=m()(l,2),g=d[0],p=d[1],h=(0,v.useState)(t?(0,q.getScheduleType)(t.schedule):N.ScheduleType.Normal),P=m()(h,2),T=P[0],M=P[1],R=function(){var e=u()(o()().mark((function e(a){var i,r,s,l,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p(!0),e.prev=1,i=null!=t&&t.id?"put":"post",r=c()(c()({},a),{},{schedule:T!==N.ScheduleType.Normal?q.scheduleTypeMap[T]:a.schedule}),null!=t&&t.id&&(r.id=t.id),e.next=7,k.W[i]("".concat(A.Z.apiPrefix,"crons"),r);case 7:s=e.sent,l=s.code,u=s.data,200===l&&(S.ZP.success(null!=t&&t.id?f.ZP.get("更新任务成功"):f.ZP.get("创建任务成功")),n(u)),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),console.error(e.t0);case 16:return e.prev=16,p(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(t){return e.apply(this,arguments)}}();(0,v.useEffect)((function(){s.resetFields(),M((0,q.getScheduleType)(null==t?void 0:t.schedule))}),[t,a]);var D=function(e){M(e),s.setFieldValue("schedule","")};return(0,b.jsx)(B.Z,{title:null!=t&&t.id?f.ZP.get("编辑任务"):f.ZP.get("创建任务"),open:a,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){return s.validateFields().then(R)},onCancel:function(){return n()},confirmLoading:g,children:(0,b.jsxs)(w.Z,{form:s,layout:"vertical",name:"form_in_modal",initialValues:t,children:[(0,b.jsx)(w.Z.Item,{name:"name",label:f.ZP.get("名称"),rules:[{required:!0,whitespace:!0}],children:(0,b.jsx)(Z.Z,{placeholder:f.ZP.get("请输入任务名称")})}),(0,b.jsx)(w.Z.Item,{name:"command",label:f.ZP.get("命令/脚本"),rules:[{required:!0,whitespace:!0}],children:(0,b.jsx)(Z.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("支持输入脚本路径/任意系统可执行命令/task 脚本路径")})}),(0,b.jsx)(w.Z.Item,{label:f.ZP.get("定时类型"),required:!0,children:(0,b.jsxs)(C.Z,{defaultValue:T,value:T,onChange:D,children:[(0,b.jsx)(C.Z.Option,{value:N.ScheduleType.Normal,children:f.ZP.get("常规定时")}),(0,b.jsx)(C.Z.Option,{value:N.ScheduleType.Once,children:f.ZP.get("手动运行")}),(0,b.jsx)(C.Z.Option,{value:N.ScheduleType.Boot,children:f.ZP.get("开机运行")})]})}),T!==N.ScheduleType.Normal?null:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.Z.Item,{name:"schedule",label:f.ZP.get("定时规则"),rules:[{required:!0},{validator:function(e,t){return!t||_().parseExpression(t).hasNext()?Promise.resolve():Promise.reject(f.ZP.get("Cron表达式格式有误"))}}],children:(0,b.jsx)(Z.Z,{placeholder:f.ZP.get("秒(可选) 分 时 天 月 周")})}),(0,b.jsx)(w.Z.List,{name:"extra_schedules",children:function(e,t,n){var a=t.add,r=t.remove,o=n.errors;return(0,b.jsxs)(b.Fragment,{children:[e.map((function(e){var t=e.key,n=e.name,a=i()(e,I);return(0,b.jsx)(w.Z.Item,{noStyle:!0,children:(0,b.jsxs)(E.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,b.jsx)(w.Z.Item,c()(c()({},a),{},{name:[n,"schedule"],rules:[{required:!0}],children:(0,b.jsx)(Z.Z,{placeholder:f.ZP.get("秒(可选) 分 时 天 月 周")})})),(0,b.jsx)(j.Z,{className:"dynamic-delete-button",onClick:function(){return r(n)}})]})},t)})),(0,b.jsx)(w.Z.Item,{children:(0,b.jsxs)("a",{onClick:function(){return a({schedule:""})},children:[(0,b.jsx)(x.Z,{})," ",f.ZP.get("新增定时规则")]})}),(0,b.jsx)(w.Z.ErrorList,{errors:o})]})}})]}),(0,b.jsx)(w.Z.Item,{name:"labels",label:f.ZP.get("标签"),children:(0,b.jsx)(y,{})}),(0,b.jsx)(w.Z.Item,{name:"task_before",label:f.ZP.get("执行前"),tooltip:f.ZP.get("运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js"),rules:[{validator:function(e,t){return t&&(t.includes(" task ")||t.startsWith("task "))?Promise.reject(f.ZP.get("不能包含 task 命令")):Promise.resolve()}}],children:(0,b.jsx)(Z.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("请输入运行任务前要执行的命令,不能包含 task 命令")})}),(0,b.jsx)(w.Z.Item,{name:"task_after",label:f.ZP.get("执行后"),tooltip:f.ZP.get("运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js"),rules:[{validator:function(e,t){return t&&(t.includes(" task ")||t.startsWith("task "))?Promise.reject(f.ZP.get("不能包含 task 命令")):Promise.resolve()}}],children:(0,b.jsx)(Z.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("请输入运行任务后要执行的命令,不能包含 task 命令")})})]})})},D=function(e){var t=e.ids,n=e.handleCancel,a=e.visible,i=w.Z.useForm(),r=m()(i,1)[0],s=(0,v.useState)(!1),c=m()(s,2),l=c[0],d=c[1],g=function(){var e=u()(o()().mark((function e(a){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.validateFields().then(function(){var e=u()(o()().mark((function e(i){var r,s,c;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),r={ids:t,labels:i.labels},e.prev=2,e.next=5,k.W[a]("".concat(A.Z.apiPrefix,"crons/labels"),r);case 5:s=e.sent,c=s.code,s.data,200===c&&(S.ZP.success("post"===a?f.ZP.get("添加Labels成功"):f.ZP.get("删除Labels成功")),n(!0)),d(!1),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),d(!1);case 15:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){console.log("Validate Failed:",e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(0,v.useEffect)((function(){r.resetFields()}),[t,a]);var p=[(0,b.jsx)(T.Z,{onClick:function(){return n(!1)},children:f.ZP.get("取消")}),(0,b.jsx)(T.Z,{type:"primary",danger:!0,onClick:function(){return g("delete")},children:f.ZP.get("删除")}),(0,b.jsx)(T.Z,{type:"primary",onClick:function(){return g("post")},children:f.ZP.get("添加")})];return(0,b.jsx)(B.Z,{title:f.ZP.get("批量修改标签"),open:a,footer:p,centered:!0,maskClosable:!1,forceRender:!0,onCancel:function(){return n(!1)},confirmLoading:l,children:(0,b.jsx)(w.Z,{form:r,layout:"vertical",name:"form_in_label_modal",children:(0,b.jsx)(w.Z.Item,{name:"labels",label:f.ZP.get("标签"),children:(0,b.jsx)(y,{})})})})}},44860:function(e,t,n){"use strict";n.r(t),n.d(t,{CrontabStatus:function(){return a},OperationName:function(){return i},OperationPath:function(){return r},ScheduleType:function(){return o}});var a=function(e){return e[e.running=0]="running",e[e.queued=.5]="queued",e[e.idle=1]="idle",e[e.disabled=2]="disabled",e}({}),i=function(e){return e[e["启用"]=0]="启用",e[e["禁用"]=1]="禁用",e[e["运行"]=2]="运行",e[e["停止"]=3]="停止",e[e["置顶"]=4]="置顶",e[e["取消置顶"]=5]="取消置顶",e}({}),r=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}({}),o=function(e){return e.Normal="normal",e.Once="once",e.Boot="boot",e}({})},42208:function(e,t,n){"use strict";n.r(t);var a=n(67825),i=n.n(a),r=n(90228),o=n.n(r),s=n(26068),c=n.n(s),l=n(87999),u=n.n(l),d=n(48305),m=n.n(d),g=n(72317),p=n(75271),f=n(72338),h=n(35181),Z=n(45520),P=n(17082),x=n(93481),v=n(63505),b=n(16314),y=n(3475),A=n(37559),k=n(21288),j=n(44224),w=n(44860),S=n(31352),C=n(52676),E=["name"],B=["key","name"],T=["key","name"],M=[{name:g.ZP.get("命令"),value:"command"},{name:g.ZP.get("名称"),value:"name"},{name:g.ZP.get("定时规则"),value:"schedule"},{name:g.ZP.get("状态"),value:"status",onlySelect:!0},{name:g.ZP.get("标签"),value:"labels"},{name:g.ZP.get("订阅"),value:"sub_id",onlySelect:!0}],_={Reg:"",NotReg:"",In:"select",Nin:"select"},q=[{name:g.ZP.get("包含"),value:"Reg"},{name:g.ZP.get("不包含"),value:"NotReg"},{name:g.ZP.get("属于"),value:"In",type:"select"},{name:g.ZP.get("不属于"),value:"Nin",type:"select"}],N=[{name:g.ZP.get("顺序"),value:"ASC"},{name:g.ZP.get("倒序"),value:"DESC"}],I=function(e){return e.and="且",e.or="或",e}(I||{});t.default=function(e){var t=e.view,n=e.handleCancel,a=e.visible,r=f.Z.useForm(),s=m()(r,1)[0],l=(0,p.useState)(!1),d=m()(l,2),R=d[0],D=d[1],O=(0,p.useState)("and"),G=m()(O,2),L=G[0],W=G[1],K=f.Z.useWatch("filters",s),F=(0,S.Z)((function(){return b.W.get("".concat(y.Z.apiPrefix,"subscriptions"))}),{cacheKey:"subscriptions"}).data,z={status:[{name:g.ZP.get("运行中"),value:w.CrontabStatus.running},{name:g.ZP.get("空闲中"),value:w.CrontabStatus.idle},{name:g.ZP.get("已禁用"),value:w.CrontabStatus.disabled}],sub_id:null==F?void 0:F.data.map((function(e){return{name:e.name,value:e.id}}))},V=function(){var e=u()(o()().mark((function e(a){var i,r,s,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(!0),a.filterRelation=L,i=t?"put":"post",e.prev=3,e.next=6,b.W[i]("".concat(y.Z.apiPrefix,"crons/views"),t?c()(c()({},a),{},{id:t.id}):a);case 6:r=e.sent,s=r.code,l=r.data,200===s&&n(l),D(!1),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),D(!1);case 16:case"end":return e.stop()}}),e,null,[[3,13]])})));return function(t){return e.apply(this,arguments)}}();(0,p.useEffect)((function(){t||s.resetFields(),s.setFieldsValue(t||{filters:[{property:"command"}]})}),[t,a]);var H=function(e){var t=e.name,n=i()(e,E),a=s.getFieldValue(["filters",t,"property"]);return(0,C.jsx)(h.Z,c()(c()({style:{width:120},placeholder:g.ZP.get("请选择操作符")},n),{},{children:q.filter((function(e){return z[a]?"select"===e.type:e})).map((function(e){return(0,C.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))}))},Y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,C.jsx)(h.Z,{style:t,children:e.map((function(e){return(0,C.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))})},U=(0,C.jsx)(h.Z,{style:{width:80},children:N.map((function(e){return(0,C.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))});return(0,C.jsx)(Z.Z,{title:t?g.ZP.get("编辑视图"):g.ZP.get("创建视图"),open:a,forceRender:!0,width:580,centered:!0,maskClosable:!1,onOk:function(){s.validateFields().then((function(e){V(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:R,children:(0,C.jsxs)(f.Z,{form:s,layout:"vertical",name:"env_modal",children:[(0,C.jsx)(f.Z.Item,{name:"name",label:g.ZP.get("视图名称"),rules:[{required:!0,message:g.ZP.get("请输入视图名称")}],children:(0,C.jsx)(P.Z,{placeholder:g.ZP.get("请输入视图名称")})}),(0,C.jsx)(f.Z.List,{name:"filters",children:function(e,t,n){var a=t.add,r=t.remove,o=n.errors;return(0,C.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,C.jsx)("div",{style:{position:"absolute",width:50,borderRadius:10,border:"1px solid rgb(190, 220, 255)",borderRight:"none",height:56*(e.length-1),top:46,left:15},children:(0,C.jsx)(x.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},onClick:function(){W("and"===L?"or":"and")},children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{children:I[L]}),(0,C.jsx)(j.Z,{type:"ql-icon-d-caret"})]})})}),(0,C.jsxs)("div",{children:[e.map((function(e){var t,n,a=e.key,o=e.name,s=i()(e,B);return(0,C.jsx)(f.Z.Item,{label:0===o?g.ZP.get("筛选条件"):"",style:{marginBottom:0},required:!0,className:"filter-item",children:(0,C.jsxs)(v.Z,{className:"view-create-modal-filters",align:"baseline",children:[(0,C.jsx)(f.Z.Item,c()(c()({},s),{},{name:[o,"property"],rules:[{required:!0}],children:Y(M,{width:120})})),(0,C.jsx)(f.Z.Item,c()(c()({},s),{},{name:[o,"operation"],rules:[{required:!0,message:g.ZP.get("请选择操作符")}],children:(0,C.jsx)(H,{name:o})})),(0,C.jsx)(f.Z.Item,c()(c()({},s),{},{name:[o,"value"],rules:[{required:!0,message:g.ZP.get("请输入内容")}],children:"select"===_[null==K?void 0:K[o].operation]?(t=null==K?void 0:K[o].property,(0,C.jsx)(h.Z,{mode:"tags",allowClear:!0,placeholder:g.ZP.get("输入后回车增加自定义选项"),children:null===(n=z[t])||void 0===n?void 0:n.map((function(e){return(0,C.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))})):(0,C.jsx)(P.Z,{placeholder:g.ZP.get("请输入内容")})})),0!==o&&(0,C.jsx)(A.Z,{onClick:function(){return r(o)}})]})},a)})),(0,C.jsx)(f.Z.Item,{children:(0,C.jsxs)("a",{onClick:function(){return a({property:"command",operation:"Reg"})},children:[(0,C.jsx)(k.Z,{}),g.ZP.get("新增筛选条件")]})}),(0,C.jsx)(f.Z.ErrorList,{errors:o})]})]})}}),(0,C.jsx)(f.Z.List,{name:"sorts",children:function(e,t,n){var a=t.add,r=t.remove,o=n.errors;return(0,C.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,C.jsx)("div",{style:{position:"absolute",width:50,borderRadius:10,border:"1px solid rgb(190, 220, 255)",borderRight:"none",height:56*(e.length-1),top:46,left:15},children:(0,C.jsx)(x.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},children:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("span",{children:I[L]})})})}),(0,C.jsxs)("div",{children:[e.map((function(e){var t=e.key,n=e.name,a=i()(e,T);return(0,C.jsx)(f.Z.Item,{label:0===n?g.ZP.get("排序方式"):"",style:{marginBottom:0},className:"filter-item",children:(0,C.jsxs)(v.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,C.jsx)(f.Z.Item,c()(c()({},a),{},{name:[n,"property"],rules:[{required:!0}],children:Y(M)})),(0,C.jsx)(f.Z.Item,c()(c()({},a),{},{name:[n,"type"],rules:[{required:!0}],children:U})),(0,C.jsx)(A.Z,{onClick:function(){return r(n)}})]})},t)})),(0,C.jsx)(f.Z.Item,{children:(0,C.jsxs)("a",{onClick:function(){return a({property:"command",type:"ASC"})},children:[(0,C.jsx)(k.Z,{}),g.ZP.get("新增排序方式")]})}),(0,C.jsx)(f.Z.ErrorList,{errors:o})]})]})}})]})})}},36199:function(e,t,n){"use strict";n.r(t);var a=n(15558),i=n.n(a),r=n(26068),o=n.n(r),s=n(48305),c=n.n(s),l=n(67825),u=n.n(l),d=n(72317),m=n(75271),g=n(50691),p=n(9171),f=n(63505),h=n(45520),Z=n(61508),P=n(93481),x=n(10948),v=n(16314),b=n(3475),y=n(28423),A=n(88939),k=n(12363),j=n(18708),w=n(78637),S=n(4690),C=n(42208),E=n(52676),B=["index","moveRow","className","style"],T=g.Z.Text,M="DragableBodyRow",_=function(e){var t=e.index,n=e.moveRow,a=e.className,i=e.style,r=u()(e,B),s=(0,m.useRef)(),l=(0,k.L)({accept:M,collect:function(e){var n=(e.getItem()||{}).index;return n===t?{}:{isOver:e.isOver(),dropClassName:n<t?" drop-over-downward":" drop-over-upward"}},drop:function(e){n(e.index,t)}}),d=c()(l,2),g=d[0],p=g.isOver,f=g.dropClassName,h=d[1],Z=(0,j.c)({type:M,item:{index:t},collect:function(e){return{isDragging:e.isDragging()}}});return h((0,c()(Z,2)[1])(s)),(0,E.jsx)("tr",o()({ref:s,className:"".concat(a).concat(p?f:""),style:o()({cursor:"move"},i)},r))};t.default=function(e){var t=e.cronViews,n=e.handleCancel,a=e.visible,r=e.cronViewChange,s=function(e){return k.filter((function(e){return!e.isDisabled})).length<=1&&!e.isDisabled},l=[{title:d.ZP.get("名称"),dataIndex:"name",key:"name",render:function(e){return"全部任务"===e?d.ZP.get("全部任务"):e}},{title:d.ZP.get("类型"),dataIndex:"type",key:"type",render:function(e){return 1===e?d.ZP.get("系统"):d.ZP.get("个人")}},{title:d.ZP.get("显示"),key:"isDisabled",dataIndex:"isDisabled",width:100,render:function(e,t,n){return(0,E.jsx)(p.Z,{disabled:s(t),checked:!t.isDisabled,onChange:function(e){return W(e,t,n)}})}},{title:d.ZP.get("操作"),key:"action",width:100,render:function(e,t,n){return 1!==t.type?(0,E.jsxs)(f.Z,{size:"middle",children:[(0,E.jsx)("a",{onClick:function(){return G(t,n)},children:(0,E.jsx)(y.Z,{})}),!s(t)&&(0,E.jsx)("a",{onClick:function(){return L(t,n)},children:(0,E.jsx)(A.Z,{})})]}):"-"}}],u=(0,m.useState)([]),g=c()(u,2),k=g[0],j=g[1],B=(0,m.useState)(!1),M=c()(B,2),q=M[0],N=M[1],I=(0,m.useState)(null),R=c()(I,2),D=R[0],O=R[1],G=function(e,t){O(e),N(!0)},L=function(e,t){h.Z.confirm({title:d.ZP.get("确认删除"),content:(0,E.jsxs)(E.Fragment,{children:[d.ZP.get("确认删除视图")," ",(0,E.jsx)(T,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",d.ZP.get("吗")]}),onOk:function(){v.W.delete("".concat(b.Z.apiPrefix,"crons/views"),{data:[e.id]}).then((function(e){var t=e.code;e.data;200===t&&(Z.ZP.success(d.ZP.get("删除成功")),r())}))}})},W=function(e,t,n){v.W.put("".concat(b.Z.apiPrefix,"crons/views/").concat(e?"enable":"disable"),[t.id]).then((function(t){var a=t.code;t.data;if(200===a){var s=i()(k);s.splice(n,1,o()(o()({},k[n]),{},{isDisabled:!e})),j(s),r()}}))},K={body:{row:_}},F=(0,m.useCallback)((function(e,t){if(e!==t){var n=k[e];v.W.put("".concat(b.Z.apiPrefix,"crons/views/move"),{fromIndex:e,toIndex:t,id:n.id}).then((function(a){var s=a.code,c=a.data;if(200===s){var l=i()(k);l.splice(e,1),l.splice(t,0,o()(o()({},n),c)),j(l),r()}}))}}),[k]);return(0,m.useEffect)((function(){j(t)}),[t]),(0,E.jsxs)(h.Z,{title:d.ZP.get("视图管理"),open:a,centered:!0,width:620,onCancel:function(){return n()},className:"view-manage-modal",forceRender:!0,footer:!1,maskClosable:!1,children:[(0,E.jsx)(f.Z,{style:{display:"flex",justifyContent:"flex-end",marginBottom:10},children:(0,E.jsx)(P.Z,{type:"primary",onClick:function(){O(null),N(!0)},children:d.ZP.get("创建视图")},"2")}),(0,E.jsx)(w.W,{backend:S.PD,children:(0,E.jsx)(x.Z,{bordered:!0,columns:l,pagination:!1,dataSource:k,rowKey:"id",size:"middle",style:{marginBottom:20},components:K,onRow:function(e,t){return{index:t,moveRow:F}}})}),(0,E.jsx)(C.default,{view:D,visible:q,handleCancel:function(e){N(!1),r(e)}})]})}},3475:function(e,t,n){"use strict";var a=n(72317),i=window.__ENV__QlBaseUrl||"/";t.Z={siteName:a.ZP.get("青龙"),baseUrl:i,apiPrefix:"".concat(i,"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:a.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:a.ZP.get("定时任务"),value:"crons"},{name:a.ZP.get("环境变量"),value:"envs"},{name:a.ZP.get("订阅管理"),value:"subscriptions"},{name:a.ZP.get("配置文件"),value:"configs"},{name:a.ZP.get("脚本管理"),value:"scripts"},{name:a.ZP.get("日志管理"),value:"logs"},{name:a.ZP.get("依赖管理"),value:"dependencies"},{name:a.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:a.ZP.get("定时任务"),envs:a.ZP.get("环境变量"),subscriptions:a.ZP.get("订阅管理"),configs:a.ZP.get("配置文件"),scripts:a.ZP.get("脚本管理"),logs:a.ZP.get("日志管理"),dependencies:a.ZP.get("依赖管理"),system:a.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"ntfy",label:"Ntfy"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:a.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:a.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:a.ZP.get("钉钉机器人")},{value:"weWorkBot",label:a.ZP.get("企业微信机器人")},{value:"weWorkApp",label:a.ZP.get("企业微信应用")},{value:"aibotk",label:a.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:a.ZP.get("微加机器人")},{value:"wxPusherBot",label:"wxPusher"},{value:"chat",label:a.ZP.get("群晖chat")},{value:"email",label:a.ZP.get("邮箱")},{value:"lark",label:a.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:a.ZP.get("自定义通知")},{value:"closed",label:a.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:a.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:a.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:a.ZP.get("推送消息的优先级")}],ntfy:[{label:"ntfyUrl",tip:a.ZP.get("ntfy的url地址,例如 https://ntfy.sh"),required:!0},{label:"ntfyTopic",tip:a.ZP.get("ntfy的消息应用topic"),required:!0},{label:"ntfyPriority",tip:a.ZP.get("推送消息的优先级")}],chat:[{label:"synologyChatUrl",tip:a.ZP.get("synologyChat的url地址"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:a.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:a.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:a.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:a.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:a.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:a.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:a.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:a.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:a.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:a.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:a.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:a.ZP.get("BARK推送消息的跳转URL")},{label:"barkArchive",tip:a.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:a.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:a.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:a.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:a.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:a.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:a.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:a.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:a.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:a.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:a.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:a.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:a.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:a.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:a.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:a.ZP.get("请输入要发送的目标"),items:[{value:"room",label:a.ZP.get("群聊")},{value:"contact",label:a.ZP.get("好友")}]},{label:"aibotkName",tip:a.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:a.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:a.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:a.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")},{label:"pushplusTemplate",tip:a.ZP.get("发送模板")},{label:"pushplusChannel",tip:a.ZP.get("发送渠道")},{label:"pushplusWebhook",tip:a.ZP.get("webhook编码")},{label:"pushplusCallbackUrl",tip:a.ZP.get("发送结果回调地址")},{label:"pushplusTo",tip:a.ZP.get("好友令牌")}],wePlusBot:[{label:"wePlusBotToken",tip:a.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:a.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:a.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],wxPusherBot:[{label:"wxPusherBotAppToken",tip:a.ZP.get("wxPusherBot的appToken"),required:!0},{label:"wxPusherBotTopicIds",tip:a.ZP.get("wxPusherBot的topicIds"),required:!1},{label:"wxPusherBotUids",tip:a.ZP.get("wxPusherBot的uids"),required:!1}],lark:[{label:"larkKey",tip:a.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:a.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:a.ZP.get("邮箱认证地址"),required:!0},{label:"emailPass",tip:a.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0},{label:"emailTo",tip:a.ZP.get("收件邮箱地址,多个分号分隔,默认发送给发件邮箱地址")}],pushMe:[{label:"pushMeKey",tip:a.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0},{label:"pushMeUrl",tip:a.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:a.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:a.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:a.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:a.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:a.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:a.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:a.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:a.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":a.ZP.get("登录"),"/initialization":a.ZP.get("初始化"),"/crontab":a.ZP.get("定时任务"),"/env":a.ZP.get("环境变量"),"/subscription":a.ZP.get("订阅管理"),"/config":a.ZP.get("配置文件"),"/script":a.ZP.get("脚本管理"),"/diff":a.ZP.get("对比工具"),"/log":a.ZP.get("日志管理"),"/setting":a.ZP.get("系统设置"),"/error":a.ZP.get("错误日志"),"/dependence":a.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},97302:function(e,t,n){"use strict";n.d(t,{eY:function(){return a},um:function(){return i},z:function(){return r}});var a="     ",i={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript",".ini":"ini",".json":"json"},r=["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"]},62348:function(e,t,n){"use strict";n.d(t,{E:function(){return i}});var a=n(72317);function i(e){var t=1e3*e,n=Math.floor(t/864e5),i=t%864e5,r=Math.floor(i/36e5),o=i%36e5,s=Math.floor(o/6e4),c=o%6e4,l=Math.round(c/1e3),u="".concat(l," ").concat(a.ZP.get("秒"));return s>0&&(u="".concat(s," ").concat(a.ZP.get("分")," ")+u),r>0&&(u="".concat(r," ").concat(a.ZP.get("时")," ")+u),n>0&&(u="".concat(n," ").concat(a.ZP.get("天")," ")+u),u}},16314:function(e,t,n){"use strict";n.d(t,{W:function(){return Z}});var a=n(90228),i=n.n(a),r=n(87999),o=n.n(r),s=n(72317),c=n(61508),l=n(33839),u=n(3475),d=n(98783),m=n(69313),g=n(52676);c.ZP.config({duration:2});var p=Date.now(),f=m.Z.create({timeout:6e4,params:{t:p}}),h=["/api/user/login","/open/auth/token","/api/user/two-factor/login","/api/system","/api/user/init","/api/user/notification/init"];f.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})),f.interceptors.response.use(function(){var e=o()(i()().mark((function e(t){var n,a,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.status,![502,504].includes(n)){e.next=5;break}d.history.push("/error"),e.next=18;break;case 5:if(401!==n){e.next=9;break}"/login"!==d.history.location.pathname&&(localStorage.removeItem(u.Z.authKey),d.history.push("/login")),e.next=18;break;case 9:return e.prev=9,200!==(a=t.data).code&&(r=a.message||a.data)&&l.Z.error({message:r,description:null!=a&&a.errors?(0,g.jsx)(g.Fragment,{children:null==a?void 0:a.errors.map((function(e){return(0,g.jsx)("div",{children:e.message})}))}):void 0}),e.abrupt("return",a);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.statusText,n=e.response.status;if([502,504].includes(n))d.history.push("/error");else if(401===n)"/login"!==d.history.location.pathname&&(c.ZP.error(s.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(u.Z.authKey),d.history.push("/login"));else{var a,i,r,o;if("function"==typeof(null===(a=e.config)||void 0===a?void 0:a.onError))return null===(o=e.config)||void 0===o?void 0:o.onError(e.response);t&&l.Z.error({message:t,description:null!==(i=e.response)&&void 0!==i&&null!==(i=i.data)&&void 0!==i&&i.errors?(0,g.jsx)(g.Fragment,{children:null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.errors)||void 0===r?void 0:r.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 Z=f},48916:function(e,t,n){"use strict";n.d(t,{DY:function(){return g},FA:function(){return f},H$:function(){return P},I1:function(){return m},W9:function(){return u},ZP:function(){return l},o4:function(){return x},rS:function(){return Z},w7:function(){return d},x$:function(){return p}});var a=n(15558),i=n.n(a),r=n(72317),o=n(97302),s=n(94046),c=n.n(s);function l(){var e=navigator.userAgent.toLowerCase(),t=function(t){return t.test(e)},n=function(t){return(e.match(t)||[]).toString().replace(/[^0-9|_.]/g,"").replace(/_/g,".")},a="unknow";t(/windows|win32|win64|wow32|wow64/g)?a="windows":t(/macintosh|macintel/g)?a="macos":t(/x11/g)?a="linux":t(/android|adr/g)?a="android":t(/ios|iphone|ipad|ipod|iwatch/g)&&(a="ios");var i="unknow";"windows"===a?t(/windows nt 5.0|windows 2000/g)?i="2000":t(/windows nt 5.1|windows xp/g)?i="xp":t(/windows nt 5.2|windows 2003/g)?i="2003":t(/windows nt 6.0|windows vista/g)?i="vista":t(/windows nt 6.1|windows 7/g)?i="7":t(/windows nt 6.2|windows 8/g)?i="8":t(/windows nt 6.3|windows 8.1/g)?i="8.1":t(/windows nt 10.0|windows 10/g)&&(i="10"):"macos"===a?i=n(/os x [\d._]+/g):"android"===a?i=n(/android [\d._]+/g):"ios"===a&&(i=n(/os [\d._]+/g));var r="unknow";"windows"===a||"macos"===a||"linux"===a?r="desktop":("android"===a||"ios"===a||t(/mobile/g))&&(r="mobile");var o="unknow",s="unknow";t(/applewebkit/g)?(o="webkit",t(/edge/g)?s="edge":t(/opr/g)?s="opera":t(/chrome/g)?s="chrome":t(/safari/g)&&(s="safari")):t(/gecko/g)&&t(/firefox/g)?(o="gecko",s="firefox"):t(/presto/g)?(o="presto",s="opera"):t(/trident|compatible|msie/g)&&(o="trident",s="iexplore");var c="unknow";"webkit"===o?c=n(/applewebkit\/[\d._]+/g):"gecko"===o?c=n(/gecko\/[\d._]+/g):"presto"===o?c=n(/presto\/[\d._]+/g):"trident"===o&&(c=n(/trident\/[\d._]+/g));var l="unknow";"chrome"===s?l=n(/chrome\/[\d._]+/g):"safari"===s?l=n(/version\/[\d._]+/g):"firefox"===s?l=n(/firefox\/[\d._]+/g):"opera"===s?l=n(/opr\/[\d._]+/g):"iexplore"===s?l=n(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===s&&(l=n(/edge\/[\d._]+/g));var u="none",d="unknow";t(/micromessenger/g)?(u="wechat",d=n(/micromessenger\/[\d._]+/g)):t(/qqbrowser/g)?(u="qq",d=n(/qqbrowser\/[\d._]+/g)):t(/ucbrowser/g)?(u="uc",d=n(/ucbrowser\/[\d._]+/g)):t(/qihu 360se/g)?u="360":t(/2345explorer/g)?(u="2345",d=n(/2345explorer\/[\d._]+/g)):t(/metasr/g)?u="sougou":t(/lbbrowser/g)?u="liebao":t(/maxthon/g)&&(u="maxthon",d=n(/maxthon\/[\d._]+/g));var m=Object.assign({engine:o,engineVs:c,platform:r,supporter:s,supporterVs:l,system:a,systemVs:i},"none"===u?{}:{shell:u,shellVs:d});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(m.system,"/").concat(m.systemVs,"\n浏览器:").concat(m.supporter,"/").concat(m.supporterVs,"\n内核:").concat(m.engine,"/").concat(m.engineVs),"color: green;font-size: 14px;font-weight: bold;"),m}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.extraHeight,n=e.target;void 0===t&&(t=99);var a=null,i=0;(a=n||document.querySelector(".ant-table-wrapper"))&&(i=a.getBoundingClientRect().top);var r=document.body.clientHeight-i-t;return r}function d(e,t){var n,a,i=window.URL||window.webkitURL||window,r=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=i.createObjectURL(r),o.download=e,n=o,(a=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(a)}function m(e,t,n){var a=i()(e),r=[];return function e(a){if(a)for(var i=0;i<(null==a?void 0:a.length);i++){if(t(a[i]))return n?void(a[i].children?a[i].children.unshift(n):a[i].children=[n]):void a.splice(i,1);a[i].children&&(r.push(a[i].key),e(a[i].children))}}(a),a}function g(e,t){var n;return function e(a){if(a)for(var i=0;i<(null==a?void 0:a.length);i++)t(a[i])?n=a[i]:a[i].children&&e(a[i].children)}(i()(e)),n}function p(e){return[o.eY,r.ZP.get("执行结束")].some((function(t){return e.includes(t)}))}function f(e){var t=e.split(" ");if("repo"===t[1]||"raw"===t[1])return t[2];var n=t.find((function(e){return[".js",".ts",".sh",".py"].some((function(t){return e.endsWith(t)}))}));if(n){var a,i,r="".concat(window.__ENV__QL_DIR,"/data/scripts");n.startsWith(r)&&(n=n.replace(r,""));var o=n.lastIndexOf("/");return o>=0?(i=n.slice(o+1),a=n.slice(0,o)):(i=n,a=""),[i,a]}}function h(e){try{var t=c().parseExpression(e);if(t)return t.next().toDate()}catch(e){}return null}function Z(e,t){var n=h(e);return null!=t&&t.length&&t.forEach((function(e){var t=h(e.schedule);t&&(!n||t<n)&&(n=t)})),n}function P(e){var t=function(e){if(!e)return"";var t=e.split(".");return".".concat(t[t.length-1])}(e);return o.um[t]}function x(){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"}},50810:function(){}}]);