@whyour/qinglong 0.12.2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-en.md +0 -2
- package/README.md +0 -2
- package/docker/docker-entrypoint.sh +1 -0
- package/package.json +1 -1
- package/shell/env.sh +15 -0
- package/shell/share.sh +2 -2
- package/shell/update.sh +1 -0
- package/static/build/loaders/initFile.js +0 -2
- package/static/build/services/script.js +2 -2
- package/static/dist/index.html +1 -1
- package/static/dist/src__pages__crontab__detail.7bceef05.async.js +1 -0
- package/static/dist/src__pages__crontab__index.55c93601.async.js +1 -0
- package/static/dist/src__pages__crontab__index.9fb90359.chunk.css +1 -0
- package/static/dist/{umi.0397b91d.js → umi.decd4ae2.js} +1 -1
- package/version.yaml +5 -17
- package/static/dist/src__pages__crontab__detail.b91d6518.async.js +0 -1
- package/static/dist/src__pages__crontab__index.04176975.async.js +0 -1
- package/static/dist/src__pages__crontab__index.b622c4d6.chunk.css +0 -1
package/README-en.md
CHANGED
|
@@ -71,8 +71,6 @@ task <file_path> conc <env_name> <account_number>(Optional)
|
|
|
71
71
|
task <file_path> desi <env_name> <account_number>
|
|
72
72
|
# Set task timeout
|
|
73
73
|
task -m <max_time> <file_path>
|
|
74
|
-
# Print task log in real time, no need to carry this parameter when creating timed tasks
|
|
75
|
-
task -l <file_path>
|
|
76
74
|
# Use -- to split, -- followed by a parameter that is passed to the script, as in the following example, the script receives the parameter -u whyour -p password
|
|
77
75
|
task <file_path> -- -u whyour -p password
|
|
78
76
|
```
|
package/README.md
CHANGED
|
@@ -71,8 +71,6 @@ task <file_path> conc <env_name> <account_number>(可选的)
|
|
|
71
71
|
task <file_path> desi <env_name> <account_number>
|
|
72
72
|
# 设置任务超时时间
|
|
73
73
|
task -m <max_time> <file_path>
|
|
74
|
-
# 实时打印任务日志,创建定时任务时,不用携带此参数
|
|
75
|
-
task -l <file_path>
|
|
76
74
|
# 使用 -- 分割,-- 后面的参数会传给脚本,下面的例子,脚本就可接收到参数 -u whyour -p password
|
|
77
75
|
task <file_path> -- -u whyour -p password
|
|
78
76
|
```
|
package/package.json
CHANGED
package/shell/env.sh
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
store_env_vars() {
|
|
4
|
+
initial_vars=($(compgen -A variable))
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
restore_env_vars() {
|
|
8
|
+
for key in $(compgen -A variable); do
|
|
9
|
+
if ! [[ " ${initial_vars[@]} " =~ " $key " ]]; then
|
|
10
|
+
unset "$key"
|
|
11
|
+
fi
|
|
12
|
+
done
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
store_env_vars
|
package/shell/share.sh
CHANGED
|
@@ -24,7 +24,6 @@ dir_update_log=$dir_log/update
|
|
|
24
24
|
ql_static_repo=$dir_repo/static
|
|
25
25
|
|
|
26
26
|
## 文件
|
|
27
|
-
file_ecosystem_js=$dir_root/ecosystem.config.js
|
|
28
27
|
file_config_sample=$dir_sample/config.sample.sh
|
|
29
28
|
file_env=$dir_config/env.sh
|
|
30
29
|
file_sharecode=$dir_config/sharecode.sh
|
|
@@ -313,8 +312,9 @@ random_range() {
|
|
|
313
312
|
|
|
314
313
|
reload_pm2() {
|
|
315
314
|
cd $dir_root
|
|
315
|
+
restore_env_vars
|
|
316
316
|
pm2 flush &>/dev/null
|
|
317
|
-
|
|
317
|
+
pm2 startOrGracefulReload ecosystem.config.js
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
diff_time() {
|
package/shell/update.sh
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const fs_1 = __importDefault(require("fs"));
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const os_1 = __importDefault(require("os"));
|
|
9
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
10
9
|
const logger_1 = __importDefault(require("./logger"));
|
|
11
10
|
const util_1 = require("../config/util");
|
|
12
11
|
const rootPath = process.env.QL_DIR;
|
|
@@ -98,7 +97,6 @@ exports.default = async () => {
|
|
|
98
97
|
if (!TaskAfterFileExist) {
|
|
99
98
|
fs_1.default.writeFileSync(TaskAfterFile, fs_1.default.readFileSync(sampleTaskShellFile));
|
|
100
99
|
}
|
|
101
|
-
dotenv_1.default.config({ path: confFile });
|
|
102
100
|
logger_1.default.info('✌️ Init file down');
|
|
103
101
|
console.log('✌️ Init file down');
|
|
104
102
|
};
|
|
@@ -56,14 +56,14 @@ let ScriptService = class ScriptService {
|
|
|
56
56
|
}
|
|
57
57
|
async runScript(filePath) {
|
|
58
58
|
const relativePath = path_1.default.relative(config_1.default.scriptPath, filePath);
|
|
59
|
-
const command = `${const_1.TASK_COMMAND}
|
|
59
|
+
const command = `${const_1.TASK_COMMAND} ${relativePath} now`;
|
|
60
60
|
const pid = await this.scheduleService.runTask(command, this.taskCallbacks(filePath), { command }, 'start');
|
|
61
61
|
return { code: 200, data: pid };
|
|
62
62
|
}
|
|
63
63
|
async stopScript(filePath, pid) {
|
|
64
64
|
if (!pid) {
|
|
65
65
|
const relativePath = path_1.default.relative(config_1.default.scriptPath, filePath);
|
|
66
|
-
pid = await (0, util_1.getPid)(`${const_1.TASK_COMMAND}
|
|
66
|
+
pid = await (0, util_1.getPid)(`${const_1.TASK_COMMAND} ${relativePath} now`);
|
|
67
67
|
}
|
|
68
68
|
try {
|
|
69
69
|
await (0, util_1.killTask)(pid);
|
package/static/dist/index.html
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[9558,5812],{75909:function(e,n,t){var i=t(14797),r=t(87807),a=t(16803),o=t(63313),c=t(84875),l=t.n(c),s=t(12888),u=t(15152),d=["className","component","viewBox","spin","rotate","tabIndex","onClick","children"],f=o.forwardRef((function(e,n){var t=e.className,c=e.component,f=e.viewBox,m=e.spin,p=e.rotate,h=e.tabIndex,g=e.onClick,Z=e.children,v=(0,a.Z)(e,d);(0,u.Kp)(Boolean(c||Z),"Should have `component` prop or `children`."),(0,u.C3)();var x=o.useContext(s.Z),y=x.prefixCls,b=void 0===y?"anticon":y,j=x.rootClassName,P=l()(j,b,t),C=l()((0,r.Z)({},"".concat(b,"-spin"),!!m)),w=p?{msTransform:"rotate(".concat(p,"deg)"),transform:"rotate(".concat(p,"deg)")}:void 0,S=(0,i.Z)((0,i.Z)({},u.vD),{},{className:C,style:w,viewBox:f});f||delete S.viewBox;var N=h;return void 0===N&&g&&(N=-1),o.createElement("span",(0,i.Z)((0,i.Z)({role:"img"},v),{},{ref:n,tabIndex:N,onClick:g,className:P}),c?o.createElement(c,(0,i.Z)({},S),Z):Z?((0,u.Kp)(Boolean(f)||1===o.Children.count(Z)&&o.isValidElement(Z)&&"use"===o.Children.only(Z).type,"Make sure that you provide correct `viewBox` prop (default `0 0 1024 1024`) to the icon."),o.createElement("svg",(0,i.Z)((0,i.Z)({},S),{},{viewBox:f}),Z)):null)}));f.displayName="AntdIcon",n.Z=f},55258:function(e,n,t){t.d(n,{Z:function(){return d}});var i=t(14797),r=t(16803),a=t(63313),o=t(75909),c=["type","children"],l=new Set;function s(e){return Boolean("string"==typeof e&&e.length&&!l.has(e))}function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=e[n];if(s(t)){var i=document.createElement("script");i.setAttribute("src",t),i.setAttribute("data-namespace",t),e.length>n+1&&(i.onload=function(){u(e,n+1)},i.onerror=function(){u(e,n+1)}),l.add(t),document.body.appendChild(i)}}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.scriptUrl,t=e.extraCommonProps,l=void 0===t?{}:t;n&&"undefined"!=typeof document&&"undefined"!=typeof window&&"function"==typeof document.createElement&&(Array.isArray(n)?u(n.reverse()):u([n]));var s=a.forwardRef((function(e,n){var t=e.type,s=e.children,u=(0,r.Z)(e,c),d=null;return e.type&&(d=a.createElement("use",{xlinkHref:"#".concat(t)})),s&&(d=s),a.createElement(o.Z,(0,i.Z)((0,i.Z)((0,i.Z)({},l),u),{},{ref:n}),d)}));return s.displayName="Iconfont",s}},25265:function(e,n,t){t.d(n,{Z:function(){return l}});var i=t(14797),r=t(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},o=t(46420),c=function(e,n){return r.createElement(o.Z,(0,i.Z)((0,i.Z)({},e),{},{ref:n,icon:a}))};c.displayName="FileOutlined";var l=r.forwardRef(c)},37126:function(e,n,t){t.d(n,{Z:function(){return l}});var i=t(14797),r=t(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},o=t(46420),c=function(e,n){return r.createElement(o.Z,(0,i.Z)((0,i.Z)({},e),{},{ref:n,icon:a}))};c.displayName="SearchOutlined";var l=r.forwardRef(c)},38582:function(e,n,t){var i=(0,t(55258).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_ob5y15ewlyq.js"]});n.Z=i},74385:function(e,n,t){t.r(n),t.d(n,{default:function(){return W}});var i=t(57213),r=t.n(i),a=t(54306),o=t.n(a),c=t(88265),l=t(63313),s=t(92260),u=t(64865),d=t(84163),f=t(9835),m=t(394),p=t(51704),h=t(15367),g=t(24378),Z=t(1953),v=t(25265),x=t(44968),y=t(69685),b=t(20209),j=t(65601),P=t(7688),C=t(76657),w=t(3563),S=t(91350),N=t(87423),k=t(57229),E=t(15207),O=t(33680),B=t(82755),M=t(38582),R=t(40141),_=t(29030),T=t(61761),q=t(52053),A=t.n(q),D=t(11527),F=s.Z.Text,H=[{key:"log",tab:c.ZP.get("日志")},{key:"script",tab:c.ZP.get("脚本")}],W=function(e){var n,t,i,a,q=e.cron,W=void 0===q?{}:q,z=e.handleCancel,I=e.visible,L=e.theme,Y=e.isPhone,V=(0,l.useState)("log"),K=o()(V,2),U=K[0],$=K[1],G=(0,l.useState)(!0),J=o()(G,2),Q=(J[0],J[1]),X=(0,l.useState)([]),ee=o()(X,2),ne=ee[0],te=ee[1],ie=(0,l.useState)(""),re=o()(ie,2),ae=re[0],oe=re[1],ce=(0,l.useState)(""),le=o()(ce,2),se=le[0],ue=le[1],de=(0,l.useState)(!1),fe=o()(de,2),me=fe[0],pe=fe[1],he=(0,l.useRef)(null),ge=(0,l.useState)({}),Ze=o()(ge,2),ve=Ze[0],xe=Ze[1],ye=(0,l.useState)(""),be=o()(ye,2),je=be[0],Pe=be[1],Ce=(0,l.useState)(H),we=o()(Ce,2),Se=we[0],Ne=we[1],ke=(0,l.useState)({}),Ee=o()(ke,2),Oe=Ee[0],Be=Ee[1],Me=(0,l.useRef)(null),Re=function(e){var n=(0,l.useState)(0),t=o()(n,2),i=t[0],r=t[1];return(0,T.Z)(e,(function(e){var n=e.target.clientHeight;i!==n&&r(n)})),i}(Me),_e={log:(0,D.jsx)("div",{ref:Me,children:(0,D.jsx)(u.ZP,{children:(0,D.jsx)(_.Z,{data:ne,height:Re,itemHeight:47,itemKey:"filename",children:function(e){return(0,D.jsxs)(u.ZP.Item,{className:"log-item",onClick:function(){return Te(e)},children:[(0,D.jsx)(v.Z,{style:{marginRight:10}}),e.directory,"/",e.filename]})}})})}),script:ve.filename&&(0,D.jsx)(B.ZP,{language:(0,R.H$)(ve.filename),theme:L,value:se,options:{fontSize:12,lineNumbersMinChars:3,fontFamily:"Source Code Pro",glyphMargin:!1,wordWrap:"on"},onMount:function(e,n){he.current=e}})},Te=function(e){var n="".concat(E.Z.apiPrefix,"logs/").concat(e.filename,"?path=").concat(e.directory||"");localStorage.setItem("logCron",n),Pe(n),k.W.get("".concat(E.Z.apiPrefix,"logs/").concat(e.filename,"?path=").concat(e.directory||"")).then((function(e){var n=e.code,t=e.data;200===n&&(oe(t),pe(!0))}))},qe=function(){Q(!0),k.W.get("".concat(E.Z.apiPrefix,"crons/").concat(W.id,"/logs")).then((function(e){var n=e.code,t=e.data;200===n&&te(t)})).finally((function(){return Q(!1)}))};return(0,l.useEffect)((function(){W&&W.id&&(Be(W),qe(),function(){var e=(0,R.FA)(W.command);if(Array.isArray(e)){Ne(Se);var n=o()(e,2),t=n[0],i=n[1];xe({parent:i,filename:t}),k.W.get("".concat(E.Z.apiPrefix,"scripts/").concat(t,"?path=").concat(i||"")).then((function(e){var n=e.code,t=e.data;200===n&&ue(t)}))}else e&&Ne([Se[0]])}())}),[W]),(0,D.jsxs)(d.Z,{title:(0,D.jsxs)("div",{className:"crontab-title-wrapper",children:[(0,D.jsxs)("div",{style:{minWidth:0},children:[(0,D.jsx)(s.Z.Text,{style:{width:"100%"},ellipsis:{tooltip:Oe.name},children:Oe.name}),(null===(n=Oe.labels)||void 0===n?void 0:n.length)>0&&""!==Oe.labels[0]&&(0,D.jsx)(m.Z,{type:"vertical"}),(null===(t=Oe.labels)||void 0===t?void 0:t.length)>0&&""!==Oe.labels[0]&&(null===(i=Oe.labels)||void 0===i?void 0:i.map((function(e,n){return(0,D.jsx)(p.Z,{color:"blue",style:{marginRight:5},children:e},e)})))]}),(0,D.jsxs)("div",{className:"operations",children:[(0,D.jsx)(h.Z,{title:Oe.status===S.CrontabStatus.idle?c.ZP.get("运行"):c.ZP.get("停止"),children:(0,D.jsx)(g.Z,{type:"link",icon:Oe.status===S.CrontabStatus.idle?(0,D.jsx)(x.Z,{}):(0,D.jsx)(y.Z,{}),size:"small",onClick:Oe.status===S.CrontabStatus.idle?function(){d.Z.confirm({title:c.ZP.get("确认运行"),content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认运行定时任务")," ",(0,D.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/run"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&(Be(r()(r()({},Oe),{},{status:S.CrontabStatus.running})),setTimeout((function(){qe()}),1e3))}))},onCancel:function(){console.log("Cancel")}})}:function(){d.Z.confirm({title:c.ZP.get("确认停止"),content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认停止定时任务")," ",(0,D.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/stop"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&Be(r()(r()({},Oe),{},{status:S.CrontabStatus.idle}))}))},onCancel:function(){console.log("Cancel")}})}})}),(0,D.jsx)(h.Z,{title:1===Oe.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用"),children:(0,D.jsx)(g.Z,{type:"link",icon:(0,D.jsx)(M.Z,{type:1===Oe.isDisabled?"ql-icon-enable":"ql-icon-disable"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Oe.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用")),content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认"),1===Oe.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用"),c.ZP.get("定时任务")," ",(0,D.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Oe.isDisabled?"enable":"disable"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&Be(r()(r()({},Oe),{},{isDisabled:1===Oe.isDisabled?0:1}))}))},onCancel:function(){console.log("Cancel")}})}})}),(0,D.jsx)(h.Z,{title:1===Oe.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶"),children:(0,D.jsx)(g.Z,{type:"link",icon:(0,D.jsx)(M.Z,{type:1===Oe.isPinned?"ql-icon-untop":"ql-icon-top"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Oe.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶")),content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认"),1===Oe.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶"),c.ZP.get("定时任务")," ",(0,D.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Oe.isPinned?"unpin":"pin"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&Be(r()(r()({},Oe),{},{isPinned:1===Oe.isPinned?0:1}))}))},onCancel:function(){console.log("Cancel")}})}})})]})]}),centered:!0,open:I,forceRender:!0,footer:!1,onCancel:function(){return z()},wrapClassName:"crontab-detail",width:Y?"":"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:c.ZP.get("任务")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Oe.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:c.ZP.get("状态")}),(0,D.jsxs)("div",{className:"cron-detail-info-value",children:[(!Oe.isDisabled||Oe.status!==S.CrontabStatus.idle)&&(0,D.jsxs)(D.Fragment,{children:[Oe.status===S.CrontabStatus.idle&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(b.Z,{}),color:"default",children:c.ZP.get("空闲中")}),Oe.status===S.CrontabStatus.running&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(j.Z,{spin:!0}),color:"processing",children:c.ZP.get("运行中")}),Oe.status===S.CrontabStatus.queued&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(P.Z,{}),color:"default",children:c.ZP.get("队列中")})]}),1===Oe.isDisabled&&Oe.status===S.CrontabStatus.idle&&(0,D.jsx)(p.Z,{icon:(0,D.jsx)(C.Z,{}),color:"error",children:c.ZP.get("已禁用")})]})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:c.ZP.get("定时")}),(0,D.jsxs)("div",{className:"cron-detail-info-value",children:[(0,D.jsx)("div",{children:Oe.schedule}),null===(a=Oe.extra_schedules)||void 0===a?void 0:a.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:c.ZP.get("最后运行时间")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Oe.last_execution_time?A()(1e3*Oe.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:c.ZP.get("最后运行时长")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Oe.last_running_time?(0,N.E)(Oe.last_running_time):"-"})]}),(0,D.jsxs)("div",{className:"cron-detail-info-item",children:[(0,D.jsx)("div",{className:"cron-detail-info-title",children:c.ZP.get("下次运行时间")}),(0,D.jsx)("div",{className:"cron-detail-info-value",children:Oe.nextRunTime&&A()(Oe.nextRunTime).format("YYYY-MM-DD HH:mm:ss")})]})]}),(0,D.jsx)(Z.Z,{style:{marginTop:10},tabList:Se,activeTabKey:U,onTabChange:function(e){!function(e){$(e)}(e)},tabBarExtraContent:"script"===U&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(g.Z,{type:"primary",style:{marginRight:8},onClick:function(){d.Z.confirm({title:"确认保存",content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认保存文件"),(0,D.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:ve.filename})," ",c.ZP.get(",保存后不可恢复")]}),onOk:function(){var e=he.current?he.current.getValue().replace(/\r\n/g,"\n"):se;return new Promise((function(n,t){k.W.put("".concat(E.Z.apiPrefix,"scripts"),{filename:ve.filename,path:ve.parent||"",content:e}).then((function(t){var i=t.code;t.data;200===i&&(ue(e),f.ZP.success("保存成功")),n(null)})).catch((function(e){return t(e)}))}))},onCancel:function(){console.log("Cancel")}})},children:c.ZP.get("保存")}),(0,D.jsx)(g.Z,{type:"primary",icon:(0,D.jsx)(w.Z,{}),onClick:function(){var e;null===(e=he.current._domElement.parentElement)||void 0===e||e.requestFullscreen()}})]}),children:_e[U]})]}),(0,D.jsx)(O.default,{visible:me,handleCancel:function(){pe(!1)},cron:W,data:ae,logUrl:je})]})}},33680:function(e,n,t){t.r(n);var i=t(54306),r=t.n(i),a=t(88265),o=t(63313),c=t(89065),l=t(92260),s=t(84163),u=t(24378),d=t(57229),f=t(15207),m=t(65601),p=t(38101),h=t(4574),g=t(40141),Z=t(99120),v=t.n(Z),x=t(11527);c.Z.Countdown;n.default=function(e){var n=e.cron,t=e.handleCancel,i=e.visible,c=e.data,Z=e.logUrl,y=(0,o.useState)(a.ZP.get("启动中...")),b=r()(y,2),j=b[0],P=b[1],C=(0,o.useState)(!0),w=r()(C,2),S=w[0],N=w[1],k=(0,o.useState)(!0),E=r()(k,2),O=E[0],B=E[1],M=(0,o.useState)(!1),R=r()(M,2),_=R[0],T=R[1],q=(0,o.useRef)({value:0,down:!0}),A=Z||String(null==n?void 0:n.id),D=function e(t){t&&N(!0),d.W.get(Z||"".concat(f.Z.apiPrefix,"crons/").concat(n.id,"/log")).then((function(n){var t=n.code,i=n.data;if(200===t&&localStorage.getItem("logCron")===A&&i!==j){var r=i;P(r||a.ZP.get("暂无日志"));var o=Boolean(r&&!(0,g.x$)(r)&&!r.includes("任务未运行"));o||(0,g.x$)(j)||j===a.ZP.get("启动中...")||setTimeout((function(){F()})),B(o),o&&setTimeout((function(){F(),e()}),2e3)}})).finally((function(){t&&N(!1)}))},F=function(){q.current.down&&setTimeout((function(){document.querySelector("#log-flag").scrollIntoView({behavior:"smooth"})}),600)},H=function(){localStorage.removeItem("logCron"),t()};return(0,o.useEffect)((function(){n&&n.id&&i&&(D(!0),q.current.down=!0)}),[n,i]),(0,o.useEffect)((function(){c&&P(c)}),[c]),(0,o.useEffect)((function(){T(document.body.clientWidth<768)}),[]),(0,x.jsx)(s.Z,{title:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(O||S)&&(0,x.jsx)(m.Z,{spin:!0}),!O&&!S&&(0,x.jsx)(p.Z,{}),(0,x.jsx)(l.Z.Text,{ellipsis:!0,style:{marginLeft:5},children:n&&n.name})]}),open:i,centered:!0,className:"log-modal",forceRender:!0,onOk:function(){return H()},onCancel:function(){return H()},footer:[(0,x.jsx)(u.Z,{type:"primary",onClick:function(){return H()},children:a.ZP.get("知道了")})],children:(0,x.jsxs)("div",{onScroll:function(e){var n=e.target.scrollTop;q.current.down&&(q.current={value:n,down:n-q.current.value>-5||!n})},className:"log-container",children:[S?(0,x.jsx)(h.Z,{}):(0,x.jsx)("pre",{style:_?{fontFamily:"Source Code Pro",zoom:.83}:{},children:(0,x.jsx)(v(),{children:j})}),(0,x.jsx)("div",{id:"log-flag"})]})})}},91350:function(e,n,t){t.r(n),t.d(n,{CrontabStatus:function(){return i},OperationName:function(){return r},OperationPath:function(){return a}});var i=function(e){return e[e.running=0]="running",e[e.queued=.5]="queued",e[e.idle=1]="idle",e[e.disabled=2]="disabled",e}({}),r=function(e){return e[e["启用"]=0]="启用",e[e["禁用"]=1]="禁用",e[e["运行"]=2]="运行",e[e["停止"]=3]="停止",e[e["置顶"]=4]="置顶",e[e["取消置顶"]=5]="取消置顶",e}({}),a=function(e){return e[e.enable=0]="enable",e[e.disable=1]="disable",e[e.run=2]="run",e[e.stop=3]="stop",e[e.pin=4]="pin",e[e.unpin=5]="unpin",e}({})},87423:function(e,n,t){function i(e){var n=1e3*e,t=Math.floor(n/864e5),i=n%864e5,r=Math.floor(i/36e5),a=i%36e5,o=Math.floor(a/6e4),c=a%6e4,l=Math.round(c/1e3)+"秒";return o>0&&(l=o+"分"+l),r>0&&(l=r+"小时"+l),t>0&&(l=t+"天"+l),l}t.d(n,{E:function(){return i}})},52105:function(e,n,t){var i=t(41171),r=t(63313),a=t(68098);n.Z=function(){var e=r.useState(!1),n=(0,i.Z)(e,2),t=n[0],o=n[1];return r.useEffect((function(){o((0,a.fk)())}),[]),t}},11847:function(e,n,t){t.d(n,{c4:function(){return a}});var i=t(22481),r=t(88028),a=["xxl","xl","lg","md","sm","xs"],o={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},c=new Map,l=-1,s={},u={matchHandlers:{},dispatch:function(e){return s=e,c.forEach((function(e){return e(s)})),c.size>=1},subscribe:function(e){return c.size||this.register(),l+=1,c.set(l,e),e(s),l},unsubscribe:function(e){c.delete(e),c.size||this.unregister()},unregister:function(){var e=this;Object.keys(o).forEach((function(n){var t=o[n],i=e.matchHandlers[t];null==i||i.mql.removeListener(null==i?void 0:i.listener)})),c.clear()},register:function(){var e=this;Object.keys(o).forEach((function(n){var t=o[n],a=function(t){var a=t.matches;e.dispatch((0,r.Z)((0,r.Z)({},s),(0,i.Z)({},n,a)))},c=window.matchMedia(t);c.addListener(a),e.matchHandlers[t]={mql:c,listener:a},a(c)}))}};n.ZP=u},66216:function(e,n,t){var i=t(63313),r=(0,i.createContext)({});n.Z=r},40630:function(e,n,t){var i=t(22481),r=t(88028),a=t(69947),o=t(84875),c=t.n(o),l=t(63313),s=t(82259),u=t(66216),d=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t};var f=["xs","sm","md","lg","xl","xxl"],m=l.forwardRef((function(e,n){var t,o=l.useContext(s.E_),m=o.getPrefixCls,p=o.direction,h=l.useContext(u.Z),g=h.gutter,Z=h.wrap,v=h.supportFlexGap,x=e.prefixCls,y=e.span,b=e.order,j=e.offset,P=e.push,C=e.pull,w=e.className,S=e.children,N=e.flex,k=e.style,E=d(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),O=m("col",x),B={};f.forEach((function(n){var t,o={},c=e[n];"number"==typeof c?o.span=c:"object"===(0,a.Z)(c)&&(o=c||{}),delete E[n],B=(0,r.Z)((0,r.Z)({},B),(t={},(0,i.Z)(t,"".concat(O,"-").concat(n,"-").concat(o.span),void 0!==o.span),(0,i.Z)(t,"".concat(O,"-").concat(n,"-order-").concat(o.order),o.order||0===o.order),(0,i.Z)(t,"".concat(O,"-").concat(n,"-offset-").concat(o.offset),o.offset||0===o.offset),(0,i.Z)(t,"".concat(O,"-").concat(n,"-push-").concat(o.push),o.push||0===o.push),(0,i.Z)(t,"".concat(O,"-").concat(n,"-pull-").concat(o.pull),o.pull||0===o.pull),(0,i.Z)(t,"".concat(O,"-rtl"),"rtl"===p),t))}));var M=c()(O,(t={},(0,i.Z)(t,"".concat(O,"-").concat(y),void 0!==y),(0,i.Z)(t,"".concat(O,"-order-").concat(b),b),(0,i.Z)(t,"".concat(O,"-offset-").concat(j),j),(0,i.Z)(t,"".concat(O,"-push-").concat(P),P),(0,i.Z)(t,"".concat(O,"-pull-").concat(C),C),t),w,B),R={};if(g&&g[0]>0){var _=g[0]/2;R.paddingLeft=_,R.paddingRight=_}if(g&&g[1]>0&&!v){var T=g[1]/2;R.paddingTop=T,R.paddingBottom=T}return N&&(R.flex=function(e){return"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(N),!1!==Z||R.minWidth||(R.minWidth=0)),l.createElement("div",(0,r.Z)({},E,{style:(0,r.Z)((0,r.Z)({},R),k),className:M,ref:n}),S)}));n.Z=m},19698:function(e,n,t){var i=t(88028),r=t(22481),a=t(69947),o=t(41171),c=t(84875),l=t.n(c),s=t(63313),u=t(82259),d=t(52105),f=t(11847),m=t(20341),p=t(66216),h=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t};(0,m.b)("top","middle","bottom","stretch"),(0,m.b)("start","end","center","space-around","space-between","space-evenly");function g(e,n){var t=s.useState("string"==typeof e?e:""),i=(0,o.Z)(t,2),r=i[0],c=i[1];return s.useEffect((function(){!function(){if("string"==typeof e&&c(e),"object"===(0,a.Z)(e))for(var t=0;t<f.c4.length;t++){var i=f.c4[t];if(n[i]){var r=e[i];if(void 0!==r)return void c(r)}}}()}),[JSON.stringify(e),n]),r}var Z=s.forwardRef((function(e,n){var t,c=e.prefixCls,m=e.justify,Z=e.align,v=e.className,x=e.style,y=e.children,b=e.gutter,j=void 0===b?0:b,P=e.wrap,C=h(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),w=s.useContext(u.E_),S=w.getPrefixCls,N=w.direction,k=s.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),E=(0,o.Z)(k,2),O=E[0],B=E[1],M=s.useState({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),R=(0,o.Z)(M,2),_=R[0],T=R[1],q=g(Z,_),A=g(m,_),D=(0,d.Z)(),F=s.useRef(j);s.useEffect((function(){var e=f.ZP.subscribe((function(e){T(e);var n=F.current||0;(!Array.isArray(n)&&"object"===(0,a.Z)(n)||Array.isArray(n)&&("object"===(0,a.Z)(n[0])||"object"===(0,a.Z)(n[1])))&&B(e)}));return function(){return f.ZP.unsubscribe(e)}}),[]);var H,W=S("row",c),z=(H=[void 0,void 0],(Array.isArray(j)?j:[j,void 0]).forEach((function(e,n){if("object"===(0,a.Z)(e))for(var t=0;t<f.c4.length;t++){var i=f.c4[t];if(O[i]&&void 0!==e[i]){H[n]=e[i];break}}else H[n]=e})),H),I=l()(W,(t={},(0,r.Z)(t,"".concat(W,"-no-wrap"),!1===P),(0,r.Z)(t,"".concat(W,"-").concat(A),A),(0,r.Z)(t,"".concat(W,"-").concat(q),q),(0,r.Z)(t,"".concat(W,"-rtl"),"rtl"===N),t),v),L={},Y=null!=z[0]&&z[0]>0?z[0]/-2:void 0,V=null!=z[1]&&z[1]>0?z[1]/-2:void 0;if(Y&&(L.marginLeft=Y,L.marginRight=Y),D){var K=(0,o.Z)(z,2);L.rowGap=K[1]}else V&&(L.marginTop=V,L.marginBottom=V);var U=(0,o.Z)(z,2),$=U[0],G=U[1],J=s.useMemo((function(){return{gutter:[$,G],wrap:P,supportFlexGap:D}}),[$,G,P,D]);return s.createElement(p.Z.Provider,{value:J},s.createElement("div",(0,i.Z)({},C,{className:I,style:(0,i.Z)((0,i.Z)({},L),x),ref:n}),y))}));n.Z=Z}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[4473,5812,833,419],{38582:function(e,t,n){"use strict";var i=(0,n(55258).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_ob5y15ewlyq.js"]});t.Z=i},9839:function(e,t,n){"use strict";var i=n(54306),r=n.n(i),a=n(63313),o=n(61761),l=n(40141);t.Z=function(e,t){var n=(0,a.useState)(0),i=r()(n,2),s=i[0],c=i[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")),c((0,l.W9)({extraHeight:t,target:n}))})),s}},74385:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return L}});var i=n(57213),r=n.n(i),a=n(54306),o=n.n(a),l=n(88265),s=n(63313),c=n(92260),u=n(64865),d=n(84163),g=n(9835),f=n(394),p=n(51704),m=n(15367),h=n(24378),Z=n(1953),x=n(25265),v=n(44968),P=n(69685),b=n(20209),y=n(65601),j=n(7688),w=n(76657),k=n(3563),C=n(91350),S=n(87423),_=n(57229),q=n(15207),R=n(33680),B=n(82755),I=n(38582),N=n(40141),D=n(29030),W=n(61761),E=n(52053),O=n.n(E),T=n(11527),F=c.Z.Text,z=[{key:"log",tab:l.ZP.get("日志")},{key:"script",tab:l.ZP.get("脚本")}],L=function(e){var t,n,i,a,E=e.cron,L=void 0===E?{}:E,M=e.handleCancel,H=e.visible,V=e.theme,A=e.isPhone,K=(0,s.useState)("log"),Y=o()(K,2),U=Y[0],Q=Y[1],X=(0,s.useState)(!0),G=o()(X,2),$=(G[0],G[1]),J=(0,s.useState)([]),ee=o()(J,2),te=ee[0],ne=ee[1],ie=(0,s.useState)(""),re=o()(ie,2),ae=re[0],oe=re[1],le=(0,s.useState)(""),se=o()(le,2),ce=se[0],ue=se[1],de=(0,s.useState)(!1),ge=o()(de,2),fe=ge[0],pe=ge[1],me=(0,s.useRef)(null),he=(0,s.useState)({}),Ze=o()(he,2),xe=Ze[0],ve=Ze[1],Pe=(0,s.useState)(""),be=o()(Pe,2),ye=be[0],je=be[1],we=(0,s.useState)(z),ke=o()(we,2),Ce=ke[0],Se=ke[1],_e=(0,s.useState)({}),qe=o()(_e,2),Re=qe[0],Be=qe[1],Ie=(0,s.useRef)(null),Ne=function(e){var t=(0,s.useState)(0),n=o()(t,2),i=n[0],r=n[1];return(0,W.Z)(e,(function(e){var t=e.target.clientHeight;i!==t&&r(t)})),i}(Ie),De={log:(0,T.jsx)("div",{ref:Ie,children:(0,T.jsx)(u.ZP,{children:(0,T.jsx)(D.Z,{data:te,height:Ne,itemHeight:47,itemKey:"filename",children:function(e){return(0,T.jsxs)(u.ZP.Item,{className:"log-item",onClick:function(){return We(e)},children:[(0,T.jsx)(x.Z,{style:{marginRight:10}}),e.directory,"/",e.filename]})}})})}),script:xe.filename&&(0,T.jsx)(B.ZP,{language:(0,N.H$)(xe.filename),theme:V,value:ce,options:{fontSize:12,lineNumbersMinChars:3,fontFamily:"Source Code Pro",glyphMargin:!1,wordWrap:"on"},onMount:function(e,t){me.current=e}})},We=function(e){var t="".concat(q.Z.apiPrefix,"logs/").concat(e.filename,"?path=").concat(e.directory||"");localStorage.setItem("logCron",t),je(t),_.W.get("".concat(q.Z.apiPrefix,"logs/").concat(e.filename,"?path=").concat(e.directory||"")).then((function(e){var t=e.code,n=e.data;200===t&&(oe(n),pe(!0))}))},Ee=function(){$(!0),_.W.get("".concat(q.Z.apiPrefix,"crons/").concat(L.id,"/logs")).then((function(e){var t=e.code,n=e.data;200===t&&ne(n)})).finally((function(){return $(!1)}))};return(0,s.useEffect)((function(){L&&L.id&&(Be(L),Ee(),function(){var e=(0,N.FA)(L.command);if(Array.isArray(e)){Se(Ce);var t=o()(e,2),n=t[0],i=t[1];ve({parent:i,filename:n}),_.W.get("".concat(q.Z.apiPrefix,"scripts/").concat(n,"?path=").concat(i||"")).then((function(e){var t=e.code,n=e.data;200===t&&ue(n)}))}else e&&Se([Ce[0]])}())}),[L]),(0,T.jsxs)(d.Z,{title:(0,T.jsxs)("div",{className:"crontab-title-wrapper",children:[(0,T.jsxs)("div",{style:{minWidth:0},children:[(0,T.jsx)(c.Z.Text,{style:{width:"100%"},ellipsis:{tooltip:Re.name},children:Re.name}),(null===(t=Re.labels)||void 0===t?void 0:t.length)>0&&""!==Re.labels[0]&&(0,T.jsx)(f.Z,{type:"vertical"}),(null===(n=Re.labels)||void 0===n?void 0:n.length)>0&&""!==Re.labels[0]&&(null===(i=Re.labels)||void 0===i?void 0:i.map((function(e,t){return(0,T.jsx)(p.Z,{color:"blue",style:{marginRight:5},children:e},e)})))]}),(0,T.jsxs)("div",{className:"operations",children:[(0,T.jsx)(m.Z,{title:Re.status===C.CrontabStatus.idle?l.ZP.get("运行"):l.ZP.get("停止"),children:(0,T.jsx)(h.Z,{type:"link",icon:Re.status===C.CrontabStatus.idle?(0,T.jsx)(v.Z,{}):(0,T.jsx)(P.Z,{}),size:"small",onClick:Re.status===C.CrontabStatus.idle?function(){d.Z.confirm({title:l.ZP.get("确认运行"),content:(0,T.jsxs)(T.Fragment,{children:[l.ZP.get("确认运行定时任务")," ",(0,T.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:Re.name})," ",l.ZP.get("吗")]}),onOk:function(){_.W.put("".concat(q.Z.apiPrefix,"crons/run"),[Re.id]).then((function(e){var t=e.code;e.data;200===t&&(Be(r()(r()({},Re),{},{status:C.CrontabStatus.running})),setTimeout((function(){Ee()}),1e3))}))},onCancel:function(){console.log("Cancel")}})}:function(){d.Z.confirm({title:l.ZP.get("确认停止"),content:(0,T.jsxs)(T.Fragment,{children:[l.ZP.get("确认停止定时任务")," ",(0,T.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:Re.name})," ",l.ZP.get("吗")]}),onOk:function(){_.W.put("".concat(q.Z.apiPrefix,"crons/stop"),[Re.id]).then((function(e){var t=e.code;e.data;200===t&&Be(r()(r()({},Re),{},{status:C.CrontabStatus.idle}))}))},onCancel:function(){console.log("Cancel")}})}})}),(0,T.jsx)(m.Z,{title:1===Re.isDisabled?l.ZP.get("启用"):l.ZP.get("禁用"),children:(0,T.jsx)(h.Z,{type:"link",icon:(0,T.jsx)(I.Z,{type:1===Re.isDisabled?"ql-icon-enable":"ql-icon-disable"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Re.isDisabled?l.ZP.get("启用"):l.ZP.get("禁用")),content:(0,T.jsxs)(T.Fragment,{children:[l.ZP.get("确认"),1===Re.isDisabled?l.ZP.get("启用"):l.ZP.get("禁用"),l.ZP.get("定时任务")," ",(0,T.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:Re.name})," ",l.ZP.get("吗")]}),onOk:function(){_.W.put("".concat(q.Z.apiPrefix,"crons/").concat(1===Re.isDisabled?"enable":"disable"),[Re.id]).then((function(e){var t=e.code;e.data;200===t&&Be(r()(r()({},Re),{},{isDisabled:1===Re.isDisabled?0:1}))}))},onCancel:function(){console.log("Cancel")}})}})}),(0,T.jsx)(m.Z,{title:1===Re.isPinned?l.ZP.get("取消置顶"):l.ZP.get("置顶"),children:(0,T.jsx)(h.Z,{type:"link",icon:(0,T.jsx)(I.Z,{type:1===Re.isPinned?"ql-icon-untop":"ql-icon-top"}),size:"small",onClick:function(){d.Z.confirm({title:"确认".concat(1===Re.isPinned?l.ZP.get("取消置顶"):l.ZP.get("置顶")),content:(0,T.jsxs)(T.Fragment,{children:[l.ZP.get("确认"),1===Re.isPinned?l.ZP.get("取消置顶"):l.ZP.get("置顶"),l.ZP.get("定时任务")," ",(0,T.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:Re.name})," ",l.ZP.get("吗")]}),onOk:function(){_.W.put("".concat(q.Z.apiPrefix,"crons/").concat(1===Re.isPinned?"unpin":"pin"),[Re.id]).then((function(e){var t=e.code;e.data;200===t&&Be(r()(r()({},Re),{},{isPinned:1===Re.isPinned?0:1}))}))},onCancel:function(){console.log("Cancel")}})}})})]})]}),centered:!0,open:H,forceRender:!0,footer:!1,onCancel:function(){return M()},wrapClassName:"crontab-detail",width:A?"":"80vw",children:[(0,T.jsxs)("div",{className:"card-wrapper",children:[(0,T.jsx)(Z.Z,{children:(0,T.jsxs)("div",{className:"cron-detail-info-item",children:[(0,T.jsx)("div",{className:"cron-detail-info-title",children:l.ZP.get("任务")}),(0,T.jsx)("div",{className:"cron-detail-info-value",children:Re.command})]})}),(0,T.jsxs)(Z.Z,{style:{marginTop:10},children:[(0,T.jsxs)("div",{className:"cron-detail-info-item",children:[(0,T.jsx)("div",{className:"cron-detail-info-title",children:l.ZP.get("状态")}),(0,T.jsxs)("div",{className:"cron-detail-info-value",children:[(!Re.isDisabled||Re.status!==C.CrontabStatus.idle)&&(0,T.jsxs)(T.Fragment,{children:[Re.status===C.CrontabStatus.idle&&(0,T.jsx)(p.Z,{icon:(0,T.jsx)(b.Z,{}),color:"default",children:l.ZP.get("空闲中")}),Re.status===C.CrontabStatus.running&&(0,T.jsx)(p.Z,{icon:(0,T.jsx)(y.Z,{spin:!0}),color:"processing",children:l.ZP.get("运行中")}),Re.status===C.CrontabStatus.queued&&(0,T.jsx)(p.Z,{icon:(0,T.jsx)(j.Z,{}),color:"default",children:l.ZP.get("队列中")})]}),1===Re.isDisabled&&Re.status===C.CrontabStatus.idle&&(0,T.jsx)(p.Z,{icon:(0,T.jsx)(w.Z,{}),color:"error",children:l.ZP.get("已禁用")})]})]}),(0,T.jsxs)("div",{className:"cron-detail-info-item",children:[(0,T.jsx)("div",{className:"cron-detail-info-title",children:l.ZP.get("定时")}),(0,T.jsxs)("div",{className:"cron-detail-info-value",children:[(0,T.jsx)("div",{children:Re.schedule}),null===(a=Re.extra_schedules)||void 0===a?void 0:a.map((function(e){return(0,T.jsx)("div",{children:e.schedule},e.schedule)}))]})]}),(0,T.jsxs)("div",{className:"cron-detail-info-item",children:[(0,T.jsx)("div",{className:"cron-detail-info-title",children:l.ZP.get("最后运行时间")}),(0,T.jsx)("div",{className:"cron-detail-info-value",children:Re.last_execution_time?O()(1e3*Re.last_execution_time).format("YYYY-MM-DD HH:mm:ss"):"-"})]}),(0,T.jsxs)("div",{className:"cron-detail-info-item",children:[(0,T.jsx)("div",{className:"cron-detail-info-title",children:l.ZP.get("最后运行时长")}),(0,T.jsx)("div",{className:"cron-detail-info-value",children:Re.last_running_time?(0,S.E)(Re.last_running_time):"-"})]}),(0,T.jsxs)("div",{className:"cron-detail-info-item",children:[(0,T.jsx)("div",{className:"cron-detail-info-title",children:l.ZP.get("下次运行时间")}),(0,T.jsx)("div",{className:"cron-detail-info-value",children:Re.nextRunTime&&O()(Re.nextRunTime).format("YYYY-MM-DD HH:mm:ss")})]})]}),(0,T.jsx)(Z.Z,{style:{marginTop:10},tabList:Ce,activeTabKey:U,onTabChange:function(e){!function(e){Q(e)}(e)},tabBarExtraContent:"script"===U&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(h.Z,{type:"primary",style:{marginRight:8},onClick:function(){d.Z.confirm({title:"确认保存",content:(0,T.jsxs)(T.Fragment,{children:[l.ZP.get("确认保存文件"),(0,T.jsx)(F,{style:{wordBreak:"break-all"},type:"warning",children:xe.filename})," ",l.ZP.get(",保存后不可恢复")]}),onOk:function(){var e=me.current?me.current.getValue().replace(/\r\n/g,"\n"):ce;return new Promise((function(t,n){_.W.put("".concat(q.Z.apiPrefix,"scripts"),{filename:xe.filename,path:xe.parent||"",content:e}).then((function(n){var i=n.code;n.data;200===i&&(ue(e),g.ZP.success("保存成功")),t(null)})).catch((function(e){return n(e)}))}))},onCancel:function(){console.log("Cancel")}})},children:l.ZP.get("保存")}),(0,T.jsx)(h.Z,{type:"primary",icon:(0,T.jsx)(k.Z,{}),onClick:function(){var e;null===(e=me.current._domElement.parentElement)||void 0===e||e.requestFullscreen()}})]}),children:De[U]})]}),(0,T.jsx)(R.default,{visible:fe,handleCancel:function(){pe(!1)},cron:L,data:ae,logUrl:ye})]})}},62520:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return oe}});var i=n(93525),r=n.n(i),a=n(54306),o=n.n(a),l=n(57213),s=n.n(l),c=n(88265),u=n(63313),d=n(92260),g=n(22159),f=n(51704),p=n(2947),m=n(84163),h=n(9835),Z=n(34133),x=n(24378),v=n(86986),P=n(94674),b=n(20209),y=n(65601),j=n(7688),w=n(76657),k=n(32132),C=n(38101),S=n(23421),_=n(13740),q=n(43114),R=n(23831),B=n(59673),I=n(61327),N=n(26839),D=n(68834),W=n(99604),E=n(15207),O=n(23435),T=n(57229),F=n(70684),z=n(33680),L=n(74385),M=n(87423),H=n(14851),V=n(10419),A=n(3038),K=n(9839),Y=n(40141),U=n(33503),Q=n(91350),X=n(19631),G=n(27705),$=n(11527);function J(e){var t,n=e.service,i=e.options,r=(0,X.Z)(n,i),a=r.loading,o=r.data;return(0,$.jsx)(G.Z,{spinning:a,children:(0,$.jsx)(d.Z.Text,{ellipsis:!0,children:null==o||null===(t=o.data)||void 0===t?void 0:t.name})})}var ee=n(52053),te=n.n(ee),ne=d.Z.Text,ie=d.Z.Paragraph,re=d.Z.Link,ae=g.Z.Search,oe=function(){var e=(0,H.useOutletContext)(),t=e.headerStyle,n=e.isPhone,i=e.theme,a=[{title:c.ZP.get("名称"),dataIndex:"name",key:"name",fixed:"left",width:120,render:function(e,t){return(0,$.jsx)(ie,{style:{wordBreak:"break-all",marginBottom:0,color:"#1890ff"},ellipsis:{tooltip:e,rows:2},children:(0,$.jsx)(re,{onClick:function(){Ge(t),Ye(!0)},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:c.ZP.get("命令/脚本"),dataIndex:"command",key:"command",width:240,render:function(e,t){return(0,$.jsx)(ie,{style:{wordBreak:"break-all",marginBottom:0},ellipsis:{tooltip:e,rows:2},children:(0,$.jsx)("a",{onClick:function(){It(t)},children:e})})},sorter:{compare:function(e,t){return e.command.localeCompare(t.command)}}},{title:c.ZP.get("状态"),key:"status",dataIndex:"status",width:100,filters:[{text:c.ZP.get("运行中"),value:Q.CrontabStatus.running},{text:c.ZP.get("空闲中"),value:Q.CrontabStatus.idle},{text:c.ZP.get("已禁用"),value:Q.CrontabStatus.disabled},{text:c.ZP.get("队列中"),value:Q.CrontabStatus.queued}],render:function(e,t){return(0,$.jsxs)($.Fragment,{children:[(!t.isDisabled||t.status!==Q.CrontabStatus.idle)&&(0,$.jsxs)($.Fragment,{children:[t.status===Q.CrontabStatus.idle&&(0,$.jsx)(f.Z,{icon:(0,$.jsx)(b.Z,{}),color:"default",children:c.ZP.get("空闲中")}),t.status===Q.CrontabStatus.running&&(0,$.jsx)(f.Z,{icon:(0,$.jsx)(y.Z,{spin:!0}),color:"processing",children:c.ZP.get("运行中")}),t.status===Q.CrontabStatus.queued&&(0,$.jsx)(f.Z,{icon:(0,$.jsx)(j.Z,{}),color:"default",children:c.ZP.get("队列中")})]}),1===t.isDisabled&&t.status===Q.CrontabStatus.idle&&(0,$.jsx)(f.Z,{icon:(0,$.jsx)(w.Z,{}),color:"error",children:c.ZP.get("已禁用")})]})}},{title:c.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,$.jsx)(ie,{style:{wordBreak:"break-all",marginBottom:0},ellipsis:{tooltip:{placement:"right",title:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("div",{children:e}),null===(n=t.extra_schedules)||void 0===n?void 0:n.map((function(e){return(0,$.jsx)("div",{children:e.schedule},e.schedule)}))]})},rows:2},children:e})}},{title:c.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,M.E)(t.last_running_time):"-"}},{title:c.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,$.jsx)("span",{style:{display:"block"},children:t.last_execution_time?te()(1e3*t.last_execution_time).format("YYYY-MM-DD HH:mm:ss"):"-"})}},{title:c.ZP.get("下次运行时间"),width:144,sorter:{compare:function(e,t){return e.nextRunTime-t.nextRunTime}},render:function(e,t){return te()(t.nextRunTime).format("YYYY-MM-DD HH:mm:ss")}},{title:c.ZP.get("关联订阅"),width:185,render:function(e,t){return t.sub_id?(0,$.jsx)(J,{service:function(){return T.W.get("".concat(E.Z.apiPrefix,"subscriptions/").concat(t.sub_id))},options:{ready:null==t?void 0:t.sub_id,cacheKey:t.sub_id}}):"-"}},{title:c.ZP.get("操作"),key:"action",width:140,fixed:n?void 0:"right",render:function(e,t,n){return(0,$.jsxs)(p.Z,{size:"middle",children:[t.status===Q.CrontabStatus.idle&&(0,$.jsx)("a",{onClick:function(e){e.stopPropagation(),Dt(t,n)},children:c.ZP.get("运行")}),t.status!==Q.CrontabStatus.idle&&(0,$.jsx)("a",{onClick:function(e){e.stopPropagation(),Wt(t,n)},children:c.ZP.get("停止")}),(0,$.jsx)("a",{onClick:function(e){e.stopPropagation(),Be(s()(s()({},t),{},{timestamp:Date.now()}))},children:c.ZP.get("日志")}),(0,$.jsx)(Ot,{record:t,index:n},"more")]})}}],l=(0,u.useState)([]),d=o()(l,2),g=d[0],X=d[1],G=(0,u.useState)(!0),ee=o()(G,2),oe=ee[0],le=ee[1],se=(0,u.useState)(!1),ce=o()(se,2),ue=ce[0],de=ce[1],ge=(0,u.useState)(!1),fe=o()(ge,2),pe=fe[0],me=fe[1],he=(0,u.useState)(),Ze=o()(he,2),xe=Ze[0],ve=Ze[1],Pe=(0,u.useState)(""),be=o()(Pe,2),ye=be[0],je=be[1],we=(0,u.useState)(!1),ke=o()(we,2),Ce=ke[0],Se=ke[1],_e=(0,u.useState)(),qe=o()(_e,2),Re=qe[0],Be=qe[1],Ie=(0,u.useState)([]),Ne=o()(Ie,2),De=Ne[0],We=Ne[1],Ee=(0,u.useState)({}),Oe=o()(Ee,2),Te=Oe[0],Fe=Oe[1],ze=(0,u.useState)(),Le=o()(ze,2),Me=Le[0],He=Le[1],Ve=(0,u.useState)(!1),Ae=o()(Ve,2),Ke=Ae[0],Ye=Ae[1],Ue=(0,u.useState)(),Qe=o()(Ue,2),Xe=Qe[0],Ge=Qe[1],$e=(0,u.useState)(""),Je=o()($e,2),et=Je[0],tt=Je[1],nt=(0,u.useState)(),it=o()(nt,2),rt=it[0],at=it[1],ot=(0,u.useState)(!1),lt=o()(ot,2),st=lt[0],ct=lt[1],ut=(0,u.useState)(!1),dt=o()(ut,2),gt=dt[0],ft=dt[1],pt=(0,u.useState)([]),mt=o()(pt,2),ht=mt[0],Zt=mt[1],xt=(0,u.useState)([]),vt=o()(xt,2),Pt=vt[0],bt=vt[1],yt=(0,u.useState)(!1),jt=o()(yt,2),wt=jt[0],kt=jt[1],Ct=(0,u.useRef)(null),St=(0,K.Z)(Ct),_t=(0,u.useState)(""),qt=o()(_t,2),Rt=qt[0],Bt=qt[1],It=function(e){var t=(0,Y.FA)(e.command);if(Array.isArray(t)){var n=o()(t,2),i=n[0],r=n[1];H.history.push("/script?p=".concat(r,"&s=").concat(i))}else t&&(location.href=t)},Nt=function(){le(!0);var e=Te.page,t=Te.size,n=Te.sorter,i=Te.filters,r="".concat(E.Z.apiPrefix,"crons?searchValue=").concat(ye,"&page=").concat(e,"&size=").concat(t,"&filters=").concat(JSON.stringify(i));n&&n.column&&n.order&&(r+="&sorter=".concat(JSON.stringify({field:n.column.key,type:"ascend"===n.order?"ASC":"DESC"}))),Me&&(r+="&queryString=".concat(JSON.stringify({filters:Me.filters,sorts:Me.sorts,filterRelation:Me.filterRelation||"and"}))),T.W.get(r).then((function(e){var t=e.code,n=e.data;if(200===t){var i=n.data,r=n.total;X(i.map((function(e){return s()(s()({},e),{},{nextRunTime:(0,Y.rS)(e.schedule,e.extra_schedules)})}))),at(r)}})).finally((function(){return le(!1)}))},Dt=function(e,t){m.Z.confirm({title:c.ZP.get("确认运行"),content:(0,$.jsxs)($.Fragment,{children:[c.ZP.get("确认运行定时任务")," ",(0,$.jsx)(ne,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("吗")]}),onOk:function(){T.W.put("".concat(E.Z.apiPrefix,"crons/run"),[e.id]).then((function(t){var n=t.code;t.data;if(200===n){var i=r()(g),a=i.findIndex((function(t){return t.id===e.id}));-1!==a&&(i.splice(a,1,s()(s()({},e),{},{status:Q.CrontabStatus.running})),X(i))}}))},onCancel:function(){console.log("Cancel")}})},Wt=function(e,t){m.Z.confirm({title:c.ZP.get("确认停止"),content:(0,$.jsxs)($.Fragment,{children:[c.ZP.get("确认停止定时任务")," ",(0,$.jsx)(ne,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("吗")]}),onOk:function(){T.W.put("".concat(E.Z.apiPrefix,"crons/stop"),[e.id]).then((function(t){var n=t.code;t.data;if(200===n){var i=r()(g),a=i.findIndex((function(t){return t.id===e.id}));-1!==a&&(i.splice(a,1,s()(s()({},e),{},{pid:null,status:Q.CrontabStatus.idle})),X(i))}}))},onCancel:function(){console.log("Cancel")}})},Et=function(e){return[{label:c.ZP.get("编辑"),key:"edit",icon:(0,$.jsx)(k.Z,{})},{label:1===e.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用"),key:"enableOrDisable",icon:1===e.isDisabled?(0,$.jsx)(C.Z,{}):(0,$.jsx)(S.Z,{})},{label:c.ZP.get("删除"),key:"delete",icon:(0,$.jsx)(_.Z,{})},{label:1===e.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶"),key:"pinOrUnPin",icon:1===e.isPinned?(0,$.jsx)(S.Z,{}):(0,$.jsx)(q.Z,{})}]},Ot=function(e){var t=e.record,n=e.index;return(0,$.jsx)(Z.Z,{placement:"bottomRight",trigger:["click"],menu:{items:Et(t),onClick:function(e){var i=e.key;e.domEvent.stopPropagation(),Tt(i,t,n)}},children:(0,$.jsx)("a",{onClick:function(e){return e.stopPropagation()},children:(0,$.jsx)(R.Z,{})})})},Tt=function(e,t,n){switch(e){case"edit":!function(e,t){ve(e),de(!0)}(t);break;case"enableOrDisable":!function(e,t){m.Z.confirm({title:"确认".concat(1===e.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用")),content:(0,$.jsxs)($.Fragment,{children:[c.ZP.get("确认"),1===e.isDisabled?c.ZP.get("启用"):c.ZP.get("禁用"),c.ZP.get("定时任务")," ",(0,$.jsx)(ne,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("吗")]}),onOk:function(){T.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===e.isDisabled?"enable":"disable"),[e.id]).then((function(t){var n=t.code;if(t.data,200===n){var i=1===e.isDisabled?0:1,a=r()(g),o=a.findIndex((function(t){return t.id===e.id}));-1!==o&&(a.splice(o,1,s()(s()({},e),{},{isDisabled:i})),X(a))}}))},onCancel:function(){console.log("Cancel")}})}(t);break;case"delete":!function(e,t){m.Z.confirm({title:c.ZP.get("确认删除"),content:(0,$.jsxs)($.Fragment,{children:[c.ZP.get("确认删除定时任务")," ",(0,$.jsx)(ne,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("吗")]}),onOk:function(){T.W.delete("".concat(E.Z.apiPrefix,"crons"),{data:[e.id]}).then((function(t){var n=t.code;if(t.data,200===n){h.ZP.success(c.ZP.get("删除成功"));var i=r()(g),a=i.findIndex((function(t){return t.id===e.id}));-1!==a&&(i.splice(a,1),X(i))}}))},onCancel:function(){console.log("Cancel")}})}(t);break;case"pinOrUnPin":!function(e,t){m.Z.confirm({title:"确认".concat(1===e.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶")),content:(0,$.jsxs)($.Fragment,{children:[c.ZP.get("确认"),1===e.isPinned?c.ZP.get("取消置顶"):c.ZP.get("置顶"),c.ZP.get("定时任务")," ",(0,$.jsx)(ne,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("吗")]}),onOk:function(){T.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===e.isPinned?"unpin":"pin"),[e.id]).then((function(t){var n=t.code;if(t.data,200===n){var i=1===e.isPinned?0:1,a=r()(g),o=a.findIndex((function(t){return t.id===e.id}));-1!==o&&(a.splice(o,1,s()(s()({},e),{},{isPinned:i})),X(a))}}))},onCancel:function(){console.log("Cancel")}})}(t)}},Ft={selectedRowKeys:De,onChange:function(e){We(e)}},zt=function(e){m.Z.confirm({title:"确认".concat(Q.OperationName[e]),content:(0,$.jsxs)($.Fragment,{children:[c.ZP.get("确认"),Q.OperationName[e],c.ZP.get("选中的定时任务吗")]}),onOk:function(){T.W.put("".concat(E.Z.apiPrefix,"crons/").concat(Q.OperationPath[e]),De).then((function(e){var t=e.code;e.data;200===t&&Nt()}))},onCancel:function(){console.log("Cancel")}})};(0,u.useEffect)((function(){Re&&(localStorage.setItem("logCron",Re.id),Se(!0))}),[Re]),(0,u.useEffect)((function(){Fe(s()(s()({},Te),{},{page:1}))}),[ye]),(0,u.useEffect)((function(){Te.page&&Te.size&&Nt(),Me&&Me.id&&Bt(Me.id)}),[Te,Me]),(0,u.useEffect)((function(){if(Me&&Pt&&Pt.length>0){var e=Pt.slice(4).find((function(e){return e.id===Me.id}));kt(!!e)}}),[Me,Pt]),(0,u.useEffect)((function(){Mt()}),[]);var Lt={onClick:function(e){var t=e.key;e.domEvent.stopPropagation(),function(e){switch(e){case"new":ct(!0);break;case"manage":ft(!0);break;default:Ht(e)}}(t)},items:[].concat(r()(r()(Pt).slice(4).map((function(e){return{label:(0,$.jsxs)(p.Z,{style:{display:"flex",justifyContent:"space-between"},children:[(0,$.jsx)("span",{children:e.name}),(null==Me?void 0:Me.id)===e.id&&(0,$.jsx)(B.Z,{style:{color:"#1890ff"}})]}),key:e.id,icon:(0,$.jsx)(I.Z,{})}}))),[{type:"divider"},{label:c.ZP.get("创建视图"),key:"new",icon:(0,$.jsx)(N.Z,{})},{label:c.ZP.get("视图管理"),key:"manage",icon:(0,$.jsx)(D.Z,{})}])},Mt=function(){le(!0),T.W.get("".concat(E.Z.apiPrefix,"crons/views")).then((function(e){var t=e.code,n=e.data;if(200===t){Zt(n);var i=n.filter((function(e){return!e.isDisabled})).map((function(e){return s()(s()({},e),{},{name:"全部任务"===e.name?c.ZP.get("全部任务"):e.name})}));bt(i),Fe({page:1,size:parseInt(localStorage.getItem("pageSize")||"20"),sorter:{},filters:{}}),He(s()({},i[0]))}})).finally((function(){le(!1)}))},Ht=function(e){var t=Pt.find((function(t){return t.id==e}));We([]),Fe(s()(s()({},Te),{},{page:1})),He(t||null)},Vt=(0,U.u)((function(){return{scroll:{y:St}}}),[St]),At=o()(Vt,1)[0];return(0,$.jsxs)(O.ZP,{className:"ql-container-wrapper crontab-wrapper ql-container-wrapper-has-tab",title:c.ZP.get("定时任务"),extra:[(0,$.jsx)(ae,{placeholder:c.ZP.get("请输入名称或者关键词"),style:{width:"auto"},enterButton:!0,allowClear:!0,loading:oe,value:et,onChange:function(e){return tt(e.target.value)},onSearch:function(e){je(e.trim())}}),(0,$.jsx)(x.Z,{type:"primary",onClick:function(){return ve(null),void de(!0)},children:c.ZP.get("创建任务")},"2")],header:{style:t},children:[(0,$.jsx)(v.Z,{defaultActiveKey:"all",size:"small",activeKey:Rt,tabPosition:"top",className:"crontab-view ".concat(wt?"more-active":""),tabBarExtraContent:(0,$.jsx)(Z.Z,{menu:Lt,trigger:["click"],overlayStyle:{minWidth:200},children:(0,$.jsxs)("div",{className:"view-more ".concat(wt?"active":""),children:[(0,$.jsxs)(p.Z,{children:[c.ZP.get("更多"),(0,$.jsx)(W.Z,{})]}),(0,$.jsx)("div",{className:"ant-tabs-ink-bar ant-tabs-ink-bar-animated"})]})}),onTabClick:Ht,items:r()(r()(Pt).slice(0,4).map((function(e){return{key:e.id,label:e.name}})))}),(0,$.jsxs)("div",{ref:Ct,children:[De.length>0&&(0,$.jsxs)("div",{style:{marginBottom:16},children:[(0,$.jsx)(x.Z,{type:"primary",style:{marginBottom:5},onClick:function(){m.Z.confirm({title:c.ZP.get("确认删除"),content:(0,$.jsx)($.Fragment,{children:c.ZP.get("确认删除选中的定时任务吗")}),onOk:function(){T.W.delete("".concat(E.Z.apiPrefix,"crons"),{data:De}).then((function(e){var t=e.code;e.data;200===t&&(h.ZP.success(c.ZP.get("批量删除成功")),We([]),Nt())}))},onCancel:function(){console.log("Cancel")}})},children:c.ZP.get("批量删除")}),(0,$.jsx)(x.Z,{type:"primary",onClick:function(){return zt(0)},style:{marginLeft:8,marginBottom:5},children:c.ZP.get("批量启用")}),(0,$.jsx)(x.Z,{type:"primary",onClick:function(){return zt(1)},style:{marginLeft:8,marginRight:8},children:c.ZP.get("批量禁用")}),(0,$.jsx)(x.Z,{type:"primary",style:{marginRight:8},onClick:function(){return zt(2)},children:c.ZP.get("批量运行")}),(0,$.jsx)(x.Z,{type:"primary",onClick:function(){return zt(3)},children:c.ZP.get("批量停止")}),(0,$.jsx)(x.Z,{type:"primary",onClick:function(){return zt(4)},style:{marginLeft:8,marginRight:8},children:c.ZP.get("批量置顶")}),(0,$.jsx)(x.Z,{type:"primary",onClick:function(){return zt(5)},style:{marginLeft:8,marginRight:8},children:c.ZP.get("批量取消置顶")}),(0,$.jsx)(x.Z,{type:"primary",onClick:function(){return me(!0)},style:{marginLeft:8,marginRight:8},children:c.ZP.get("批量修改标签")}),(0,$.jsxs)("span",{style:{marginLeft:8},children:[c.ZP.get("已选择"),(0,$.jsx)("a",{children:null==De?void 0:De.length}),c.ZP.get("项")]})]}),(0,$.jsx)(P.Z,{columns:a,pagination:{current:Te.page,pageSize:Te.size,showSizeChanger:!0,simple:n,total:rt,showTotal:function(e,t){return"第 ".concat(t[0],"-").concat(t[1]," 条/总共 ").concat(e," 条")},pageSizeOptions:[10,20,50,100,200,500,rt||1e4].sort((function(e,t){return e-t}))},dataSource:g,rowKey:"id",size:"middle",scroll:{x:1200,y:St},loading:oe,rowSelection:Ft,rowClassName:function(e,t){return e.isPinned?"pinned-cron cron":"cron"},onChange:function(e,t,n){var i=e.current,r=e.pageSize;Fe({page:i,size:r,sorter:n,filters:t}),localStorage.setItem("pageSize",String(r))},components:n||Te.size<50?void 0:At})]}),(0,$.jsx)(z.default,{visible:Ce,handleCancel:function(){var e;e=Re,T.W.get("".concat(E.Z.apiPrefix,"crons/").concat(e.id)).then((function(t){var n=t.code,i=t.data;if(200===n){var a=g.findIndex((function(t){return t.id===e.id})),o=r()(g);i.nextRunTime=(0,Y.rS)(i.schedule,i.extra_schedules),-1!==a&&(o.splice(a,1,s()(s()({},e),i)),X(o))}})).finally((function(){return le(!1)})),Se(!1)},cron:Re}),(0,$.jsx)(F.default,{visible:ue,handleCancel:function(){de(!1),Nt()},cron:xe}),(0,$.jsx)(F.CronLabelModal,{visible:pe,handleCancel:function(e){me(!1),e&&Nt()},ids:De}),(0,$.jsx)(L.default,{visible:Ke,handleCancel:function(){Ye(!1)},cron:Xe,theme:i,isPhone:n}),(0,$.jsx)(V.default,{visible:st,handleCancel:function(e){ct(!1),Mt()}}),(0,$.jsx)(A.default,{cronViews:ht,visible:gt,handleCancel:function(){ft(!1)},cronViewChange:function(e){Mt()}})]})}},33680:function(e,t,n){"use strict";n.r(t);var i=n(54306),r=n.n(i),a=n(88265),o=n(63313),l=n(89065),s=n(92260),c=n(84163),u=n(24378),d=n(57229),g=n(15207),f=n(65601),p=n(38101),m=n(4574),h=n(40141),Z=n(99120),x=n.n(Z),v=n(11527);l.Z.Countdown;t.default=function(e){var t=e.cron,n=e.handleCancel,i=e.visible,l=e.data,Z=e.logUrl,P=(0,o.useState)(a.ZP.get("启动中...")),b=r()(P,2),y=b[0],j=b[1],w=(0,o.useState)(!0),k=r()(w,2),C=k[0],S=k[1],_=(0,o.useState)(!0),q=r()(_,2),R=q[0],B=q[1],I=(0,o.useState)(!1),N=r()(I,2),D=N[0],W=N[1],E=(0,o.useRef)({value:0,down:!0}),O=Z||String(null==t?void 0:t.id),T=function e(n){n&&S(!0),d.W.get(Z||"".concat(g.Z.apiPrefix,"crons/").concat(t.id,"/log")).then((function(t){var n=t.code,i=t.data;if(200===n&&localStorage.getItem("logCron")===O&&i!==y){var r=i;j(r||a.ZP.get("暂无日志"));var o=Boolean(r&&!(0,h.x$)(r)&&!r.includes("任务未运行"));o||(0,h.x$)(y)||y===a.ZP.get("启动中...")||setTimeout((function(){F()})),B(o),o&&setTimeout((function(){F(),e()}),2e3)}})).finally((function(){n&&S(!1)}))},F=function(){E.current.down&&setTimeout((function(){document.querySelector("#log-flag").scrollIntoView({behavior:"smooth"})}),600)},z=function(){localStorage.removeItem("logCron"),n()};return(0,o.useEffect)((function(){t&&t.id&&i&&(T(!0),E.current.down=!0)}),[t,i]),(0,o.useEffect)((function(){l&&j(l)}),[l]),(0,o.useEffect)((function(){W(document.body.clientWidth<768)}),[]),(0,v.jsx)(c.Z,{title:(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(R||C)&&(0,v.jsx)(f.Z,{spin:!0}),!R&&!C&&(0,v.jsx)(p.Z,{}),(0,v.jsx)(s.Z.Text,{ellipsis:!0,style:{marginLeft:5},children:t&&t.name})]}),open:i,centered:!0,className:"log-modal",forceRender:!0,onOk:function(){return z()},onCancel:function(){return z()},footer:[(0,v.jsx)(u.Z,{type:"primary",onClick:function(){return z()},children:a.ZP.get("知道了")})],children:(0,v.jsxs)("div",{onScroll:function(e){var t=e.target.scrollTop;E.current.down&&(E.current={value:t,down:t-E.current.value>-5||!t})},className:"log-container",children:[C?(0,v.jsx)(m.Z,{}):(0,v.jsx)("pre",{style:D?{fontFamily:"Source Code Pro",zoom:.83}:{},children:(0,v.jsx)(x(),{children:y})}),(0,v.jsx)("div",{id:"log-flag"})]})})}},70684:function(e,t,n){"use strict";n.r(t),n.d(t,{CronLabelModal:function(){return W},default:function(){return D}});var i=n(12342),r=n.n(i),a=n(25359),o=n.n(a),l=n(57213),s=n.n(l),c=n(49811),u=n.n(c),d=n(54306),g=n.n(d),f=n(88265),p=n(63313),m=n(67393),h=n(9835),Z=n(84163),x=n(22159),v=n(2947),P=n(24378),b=n(57229),y=n(15207),j=n(11186),w=n.n(j),k=n(93525),C=n.n(k),S=n(51704),_=n(8297),q=n(26839),R=n(11527),B=function(e){var t=e.value,n=e.onChange,i=(0,p.useState)(""),r=g()(i,2),a=r[0],o=r[1],l=(0,p.useState)(!1),s=g()(l,2),c=s[0],u=s[1],d=(0,p.useState)([]),m=g()(d,2),h=m[0],Z=m[1],v=(0,p.useRef)(),P=function(){a&&!h.includes(a)&&(Z([].concat(C()(h),[a])),null==n||n([].concat(C()(h),[a]))),u(!1),o("")},b=h.map((function(e){var t=(0,R.jsx)(S.Z,{closable:!0,onClose:function(t){var i,r;t.preventDefault(),i=e,r=h.filter((function(e){return e!==i})),Z(r),null==n||n(r)},children:e});return(0,R.jsx)("span",{style:{display:"inline-block",marginBottom:8},children:t},e)}));return(0,p.useEffect)((function(){c&&v&&v.current.focus()}),[c]),(0,p.useEffect)((function(){t&&Z(t)}),[t]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(_.Z,{enter:{scale:.8,opacity:0,type:"from",duration:100},leave:{opacity:0,width:0,scale:0,duration:200},appear:!1,children:b}),c&&(0,R.jsx)(x.Z,{ref:v,type:"text",size:"small",style:{width:78},value:a,onChange:function(e){o(e.target.value)},onBlur:P,onPressEnter:P}),!c&&(0,R.jsxs)(S.Z,{onClick:function(){u(!0)},style:{borderStyle:"dashed",cursor:"pointer"},children:[(0,R.jsx)(q.Z,{})," ",f.ZP.get("新建")]})]})},I=n(32320),N=["key","name"],D=function(e){var t=e.cron,n=e.handleCancel,i=e.visible,a=m.Z.useForm(),l=g()(a,1)[0],c=(0,p.useState)(!1),d=g()(c,2),P=d[0],j=d[1],k=function(){var e=u()(o()().mark((function e(i){var r,a,l,c,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(!0),r=t?"put":"post",a=s()({},i),t&&(a.id=t.id),e.prev=4,e.next=7,b.W[r]("".concat(y.Z.apiPrefix,"crons"),a);case 7:l=e.sent,c=l.code,u=l.data,200===c&&(h.ZP.success(t?f.ZP.get("更新任务成功"):f.ZP.get("创建任务成功")),n(u)),j(!1),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),j(!1);case 17:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(t){return e.apply(this,arguments)}}();return(0,p.useEffect)((function(){l.resetFields()}),[t,i]),(0,R.jsx)(Z.Z,{title:t?f.ZP.get("编辑任务"):f.ZP.get("创建任务"),open:i,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){l.validateFields().then((function(e){k(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:P,children:(0,R.jsxs)(m.Z,{form:l,layout:"vertical",name:"form_in_modal",initialValues:t,children:[(0,R.jsx)(m.Z.Item,{name:"name",label:f.ZP.get("名称"),rules:[{required:!0,whitespace:!0}],children:(0,R.jsx)(x.Z,{placeholder:f.ZP.get("请输入任务名称")})}),(0,R.jsx)(m.Z.Item,{name:"command",label:f.ZP.get("命令/脚本"),rules:[{required:!0,whitespace:!0}],children:(0,R.jsx)(x.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("支持输入脚本路径/任意系统可执行命令/task 脚本路径")})}),(0,R.jsx)(m.Z.Item,{name:"schedule",label:f.ZP.get("定时规则"),rules:[{required:!0},{validator:function(e,t){return!t||w().parseExpression(t).hasNext()?Promise.resolve():Promise.reject(f.ZP.get("Cron表达式格式有误"))}}],children:(0,R.jsx)(x.Z,{placeholder:f.ZP.get("秒(可选) 分 时 天 月 周")})}),(0,R.jsx)(m.Z.List,{name:"extra_schedules",children:function(e,t,n){var i=t.add,a=t.remove,o=n.errors;return(0,R.jsxs)(R.Fragment,{children:[e.map((function(e){var t=e.key,n=e.name,i=r()(e,N);return(0,R.jsx)(m.Z.Item,{noStyle:!0,children:(0,R.jsxs)(v.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,R.jsx)(m.Z.Item,s()(s()({},i),{},{name:[n,"schedule"],rules:[{required:!0}],children:(0,R.jsx)(x.Z,{placeholder:f.ZP.get("秒(可选) 分 时 天 月 周")})})),(0,R.jsx)(I.Z,{className:"dynamic-delete-button",onClick:function(){return a(n)}})]})},t)})),(0,R.jsx)(m.Z.Item,{children:(0,R.jsxs)("a",{onClick:function(){return i({schedule:""})},children:[(0,R.jsx)(q.Z,{}),f.ZP.get("新增定时规则")]})}),(0,R.jsx)(m.Z.ErrorList,{errors:o})]})}}),(0,R.jsx)(m.Z.Item,{name:"labels",label:f.ZP.get("标签"),children:(0,R.jsx)(B,{})}),(0,R.jsx)(m.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,R.jsx)(x.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("请输入运行任务前要执行的命令,不能包含 task 命令")})}),(0,R.jsx)(m.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,R.jsx)(x.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:f.ZP.get("请输入运行任务后要执行的命令,不能包含 task 命令")})})]})})},W=function(e){var t=e.ids,n=e.handleCancel,i=e.visible,r=m.Z.useForm(),a=g()(r,1)[0],l=(0,p.useState)(!1),s=g()(l,2),c=s[0],d=s[1],x=function(){var e=u()(o()().mark((function e(i){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.validateFields().then(function(){var e=u()(o()().mark((function e(r){var a,l,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),a={ids:t,labels:r.labels},e.prev=2,e.next=5,b.W[i]("".concat(y.Z.apiPrefix,"crons/labels"),a);case 5:l=e.sent,s=l.code,l.data,200===s&&(h.ZP.success("post"===i?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,p.useEffect)((function(){a.resetFields()}),[t,i]);var v=[(0,R.jsx)(P.Z,{onClick:function(){return n(!1)},children:f.ZP.get("取消")}),(0,R.jsx)(P.Z,{type:"primary",danger:!0,onClick:function(){return x("delete")},children:f.ZP.get("删除")}),(0,R.jsx)(P.Z,{type:"primary",onClick:function(){return x("post")},children:f.ZP.get("添加")})];return(0,R.jsx)(Z.Z,{title:f.ZP.get("批量修改标签"),open:i,footer:v,centered:!0,maskClosable:!1,forceRender:!0,onCancel:function(){return n(!1)},confirmLoading:c,children:(0,R.jsx)(m.Z,{form:a,layout:"vertical",name:"form_in_label_modal",children:(0,R.jsx)(m.Z.Item,{name:"labels",label:f.ZP.get("标签"),children:(0,R.jsx)(B,{})})})})}},91350:function(e,t,n){"use strict";n.r(t),n.d(t,{CrontabStatus:function(){return i},OperationName:function(){return r},OperationPath:function(){return a}});var i=function(e){return e[e.running=0]="running",e[e.queued=.5]="queued",e[e.idle=1]="idle",e[e.disabled=2]="disabled",e}({}),r=function(e){return e[e["启用"]=0]="启用",e[e["禁用"]=1]="禁用",e[e["运行"]=2]="运行",e[e["停止"]=3]="停止",e[e["置顶"]=4]="置顶",e[e["取消置顶"]=5]="取消置顶",e}({}),a=function(e){return e[e.enable=0]="enable",e[e.disable=1]="disable",e[e.run=2]="run",e[e.stop=3]="stop",e[e.pin=4]="pin",e[e.unpin=5]="unpin",e}({})},10419:function(e,t,n){"use strict";n.r(t);var i=n(12342),r=n.n(i),a=n(25359),o=n.n(a),l=n(57213),s=n.n(l),c=n(49811),u=n.n(c),d=n(54306),g=n.n(d),f=n(88265),p=n(63313),m=n(67393),h=n(28756),Z=n(84163),x=n(22159),v=n(24378),P=n(2947),b=n(57229),y=n(15207),j=n(32320),w=n(26839),k=n(38582),C=n(91350),S=n(19631),_=n(11527),q=["name"],R=["key","name"],B=["key","name"],I=[{name:f.ZP.get("命令"),value:"command"},{name:f.ZP.get("名称"),value:"name"},{name:f.ZP.get("定时规则"),value:"schedule"},{name:f.ZP.get("状态"),value:"status",onlySelect:!0},{name:f.ZP.get("标签"),value:"labels"},{name:f.ZP.get("订阅"),value:"sub_id",onlySelect:!0}],N={Reg:"",NotReg:"",In:"select",Nin:"select"},D=[{name:f.ZP.get("包含"),value:"Reg"},{name:f.ZP.get("不包含"),value:"NotReg"},{name:f.ZP.get("属于"),value:"In",type:"select"},{name:f.ZP.get("不属于"),value:"Nin",type:"select"}],W=[{name:f.ZP.get("顺序"),value:"ASC"},{name:f.ZP.get("倒序"),value:"DESC"}],E=function(e){return e.and="且",e.or="或",e}(E||{});t.default=function(e){var t=e.view,n=e.handleCancel,i=e.visible,a=m.Z.useForm(),l=g()(a,1)[0],c=(0,p.useState)(!1),d=g()(c,2),O=d[0],T=d[1],F=(0,p.useState)("and"),z=g()(F,2),L=z[0],M=z[1],H=m.Z.useWatch("filters",l),V=(0,S.Z)((function(){return b.W.get("".concat(y.Z.apiPrefix,"subscriptions"))}),{cacheKey:"subscriptions"}).data,A={status:[{name:f.ZP.get("运行中"),value:C.CrontabStatus.running},{name:f.ZP.get("空闲中"),value:C.CrontabStatus.idle},{name:f.ZP.get("已禁用"),value:C.CrontabStatus.disabled}],sub_id:null==V?void 0:V.data.map((function(e){return{name:e.name,value:e.id}}))},K=function(){var e=u()(o()().mark((function e(i){var r,a,l,c;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),i.filterRelation=L,r=t?"put":"post",e.prev=3,e.next=6,b.W[r]("".concat(y.Z.apiPrefix,"crons/views"),t?s()(s()({},i),{},{id:t.id}):i);case 6:a=e.sent,l=a.code,c=a.data,200===l&&n(c),T(!1),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),T(!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||l.resetFields(),l.setFieldsValue(t||{filters:[{property:"command"}]})}),[t,i]);var Y=function(e){var t=e.name,n=r()(e,q),i=l.getFieldValue(["filters",t,"property"]);return(0,_.jsx)(h.Z,s()(s()({style:{width:120},placeholder:f.ZP.get("请选择操作符")},n),{},{children:D.filter((function(e){return A[i]?"select"===e.type:e})).map((function(e){return(0,_.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))}))},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,_.jsx)(h.Z,{style:t,children:e.map((function(e){return(0,_.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))})},Q=(0,_.jsx)(h.Z,{style:{width:80},children:W.map((function(e){return(0,_.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))});return(0,_.jsx)(Z.Z,{title:t?f.ZP.get("编辑视图"):f.ZP.get("创建视图"),open:i,forceRender:!0,width:580,centered:!0,maskClosable:!1,onOk:function(){l.validateFields().then((function(e){K(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:O,children:(0,_.jsxs)(m.Z,{form:l,layout:"vertical",name:"env_modal",children:[(0,_.jsx)(m.Z.Item,{name:"name",label:f.ZP.get("视图名称"),rules:[{required:!0,message:f.ZP.get("请输入视图名称")}],children:(0,_.jsx)(x.Z,{placeholder:f.ZP.get("请输入视图名称")})}),(0,_.jsx)(m.Z.List,{name:"filters",children:function(e,t,n){var i=t.add,a=t.remove,o=n.errors;return(0,_.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,_.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,_.jsx)(v.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},onClick:function(){M("and"===L?"or":"and")},children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("span",{children:E[L]}),(0,_.jsx)(k.Z,{type:"ql-icon-d-caret"})]})})}),(0,_.jsxs)("div",{children:[e.map((function(e){var t,n,i=e.key,o=e.name,l=r()(e,R);return(0,_.jsx)(m.Z.Item,{label:0===o?f.ZP.get("筛选条件"):"",style:{marginBottom:0},required:!0,className:"filter-item",children:(0,_.jsxs)(P.Z,{className:"view-create-modal-filters",align:"baseline",children:[(0,_.jsx)(m.Z.Item,s()(s()({},l),{},{name:[o,"property"],rules:[{required:!0}],children:U(I,{width:120})})),(0,_.jsx)(m.Z.Item,s()(s()({},l),{},{name:[o,"operation"],rules:[{required:!0,message:f.ZP.get("请选择操作符")}],children:(0,_.jsx)(Y,{name:o})})),(0,_.jsx)(m.Z.Item,s()(s()({},l),{},{name:[o,"value"],rules:[{required:!0,message:f.ZP.get("请输入内容")}],children:"select"===N[null==H?void 0:H[o].operation]?(t=null==H?void 0:H[o].property,(0,_.jsx)(h.Z,{mode:"tags",allowClear:!0,placeholder:f.ZP.get("输入后回车增加自定义选项"),children:null===(n=A[t])||void 0===n?void 0:n.map((function(e){return(0,_.jsx)(h.Z.Option,{value:e.value,children:e.name},e.name)}))})):(0,_.jsx)(x.Z,{placeholder:f.ZP.get("请输入内容")})})),0!==o&&(0,_.jsx)(j.Z,{onClick:function(){return a(o)}})]})},i)})),(0,_.jsx)(m.Z.Item,{children:(0,_.jsxs)("a",{onClick:function(){return i({property:"command",operation:"Reg"})},children:[(0,_.jsx)(w.Z,{}),f.ZP.get("新增筛选条件")]})}),(0,_.jsx)(m.Z.ErrorList,{errors:o})]})]})}}),(0,_.jsx)(m.Z.List,{name:"sorts",children:function(e,t,n){var i=t.add,a=t.remove,o=n.errors;return(0,_.jsxs)("div",{style:{position:"relative"},className:"view-filters-container ".concat(e.length>1?"active":""),children:[e.length>1&&(0,_.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,_.jsx)(v.Z,{type:"primary",size:"small",style:{position:"absolute",top:"50%",translate:"-50% -50%",padding:"0 3px",cursor:"pointer"},children:(0,_.jsx)(_.Fragment,{children:(0,_.jsx)("span",{children:E[L]})})})}),(0,_.jsxs)("div",{children:[e.map((function(e){var t=e.key,n=e.name,i=r()(e,B);return(0,_.jsx)(m.Z.Item,{label:0===n?f.ZP.get("排序方式"):"",style:{marginBottom:0},className:"filter-item",children:(0,_.jsxs)(P.Z,{className:"view-create-modal-sorts",align:"baseline",children:[(0,_.jsx)(m.Z.Item,s()(s()({},i),{},{name:[n,"property"],rules:[{required:!0}],children:U(I)})),(0,_.jsx)(m.Z.Item,s()(s()({},i),{},{name:[n,"type"],rules:[{required:!0}],children:Q})),(0,_.jsx)(j.Z,{onClick:function(){return a(n)}})]})},t)})),(0,_.jsx)(m.Z.Item,{children:(0,_.jsxs)("a",{onClick:function(){return i({property:"command",type:"ASC"})},children:[(0,_.jsx)(w.Z,{}),f.ZP.get("新增排序方式")]})}),(0,_.jsx)(m.Z.ErrorList,{errors:o})]})]})}})]})})}},3038:function(e,t,n){"use strict";n.r(t);var i=n(93525),r=n.n(i),a=n(57213),o=n.n(a),l=n(54306),s=n.n(l),c=n(12342),u=n.n(c),d=n(88265),g=n(63313),f=n(92260),p=n(16861),m=n(2947),h=n(84163),Z=n(9835),x=n(24378),v=n(94674),P=n(57229),b=n(15207),y=n(32132),j=n(13740),w=n(81871),k=n(21778),C=n(12701),S=n(66255),_=n(10419),q=n(11527),R=["index","moveRow","className","style"],B=f.Z.Text,I="DragableBodyRow",N=function(e){var t=e.index,n=e.moveRow,i=e.className,r=e.style,a=u()(e,R),l=(0,g.useRef)(),c=(0,w.L)({accept:I,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=s()(c,2),f=d[0],p=f.isOver,m=f.dropClassName,h=d[1],Z=(0,k.c)({type:I,item:{index:t},collect:function(e){return{isDragging:e.isDragging()}}});return h((0,s()(Z,2)[1])(l)),(0,q.jsx)("tr",o()({ref:l,className:"".concat(i).concat(p?m:""),style:o()({cursor:"move"},r)},a))};t.default=function(e){var t=e.cronViews,n=e.handleCancel,i=e.visible,a=e.cronViewChange,l=function(e){return w.filter((function(e){return!e.isDisabled})).length<=1&&!e.isDisabled},c=[{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,q.jsx)(p.Z,{disabled:l(t),checked:!t.isDisabled,onChange:function(e){return M(e,t,n)}})}},{title:d.ZP.get("操作"),key:"action",width:100,render:function(e,t,n){return 1!==t.type?(0,q.jsxs)(m.Z,{size:"middle",children:[(0,q.jsx)("a",{onClick:function(){return z(t,n)},children:(0,q.jsx)(y.Z,{})}),!l(t)&&(0,q.jsx)("a",{onClick:function(){return L(t,n)},children:(0,q.jsx)(j.Z,{})})]}):"-"}}],u=(0,g.useState)([]),f=s()(u,2),w=f[0],k=f[1],R=(0,g.useState)(!1),I=s()(R,2),D=I[0],W=I[1],E=(0,g.useState)(null),O=s()(E,2),T=O[0],F=O[1],z=function(e,t){F(e),W(!0)},L=function(e,t){h.Z.confirm({title:d.ZP.get("确认删除"),content:(0,q.jsxs)(q.Fragment,{children:[d.ZP.get("确认删除视图")," ",(0,q.jsx)(B,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",d.ZP.get("吗")]}),onOk:function(){P.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("删除成功")),a())}))},onCancel:function(){console.log("Cancel")}})},M=function(e,t,n){P.W.put("".concat(b.Z.apiPrefix,"crons/views/").concat(e?"enable":"disable"),[t.id]).then((function(t){var i=t.code;t.data;if(200===i){var l=r()(w);l.splice(n,1,o()(o()({},w[n]),{},{isDisabled:!e})),k(l),a()}}))},H={body:{row:N}},V=(0,g.useCallback)((function(e,t){if(e!==t){var n=w[e];P.W.put("".concat(b.Z.apiPrefix,"crons/views/move"),{fromIndex:e,toIndex:t,id:n.id}).then((function(i){var l=i.code,s=i.data;if(200===l){var c=r()(w);c.splice(e,1),c.splice(t,0,o()(o()({},n),s)),k(c),a()}}))}}),[w]);return(0,g.useEffect)((function(){k(t)}),[t]),(0,q.jsxs)(h.Z,{title:d.ZP.get("视图管理"),open:i,centered:!0,width:620,onCancel:function(){return n()},className:"view-manage-modal",forceRender:!0,footer:!1,maskClosable:!1,children:[(0,q.jsx)(m.Z,{style:{display:"flex",justifyContent:"flex-end",marginBottom:10},children:(0,q.jsx)(x.Z,{type:"primary",onClick:function(){F(null),W(!0)},children:d.ZP.get("创建视图")},"2")}),(0,q.jsx)(C.W,{backend:S.PD,children:(0,q.jsx)(v.Z,{bordered:!0,columns:c,pagination:!1,dataSource:w,rowKey:"id",size:"middle",style:{marginBottom:20},components:H,onRow:function(e,t){return{index:t,moveRow:V}}})}),(0,q.jsx)(_.default,{view:T,visible:D,handleCancel:function(e){W(!1),a(e)}})]})}},15207:function(e,t,n){"use strict";var i=n(88265),r=window.__ENV__QlBaseUrl||"/";t.Z={siteName:i.ZP.get("青龙"),apiPrefix:"".concat(r,"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:i.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:i.ZP.get("定时任务"),value:"crons"},{name:i.ZP.get("环境变量"),value:"envs"},{name:i.ZP.get("订阅管理"),value:"subscriptions"},{name:i.ZP.get("配置文件"),value:"configs"},{name:i.ZP.get("脚本管理"),value:"scripts"},{name:i.ZP.get("日志管理"),value:"logs"},{name:i.ZP.get("依赖管理"),value:"dependencies"},{name:i.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:i.ZP.get("定时任务"),envs:i.ZP.get("环境变量"),subscriptions:i.ZP.get("订阅管理"),configs:i.ZP.get("配置文件"),scripts:i.ZP.get("脚本管理"),logs:i.ZP.get("日志管理"),dependencies:i.ZP.get("依赖管理"),system:i.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:i.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:i.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:i.ZP.get("钉钉机器人")},{value:"weWorkBot",label:i.ZP.get("企业微信机器人")},{value:"weWorkApp",label:i.ZP.get("企业微信应用")},{value:"aibotk",label:i.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"chat",label:i.ZP.get("群晖chat")},{value:"email",label:i.ZP.get("邮箱")},{value:"lark",label:i.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:i.ZP.get("自定义通知")},{value:"closed",label:i.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:i.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:i.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:i.ZP.get("推送消息的优先级")}],chat:[{label:"chatUrl",tip:i.ZP.get("chat的url地址"),required:!0},{label:"chatToken",tip:i.ZP.get("chat的token码"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:i.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:i.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:i.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:i.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:i.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:i.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:i.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:i.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:i.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:i.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:i.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:i.ZP.get("BARK推送消息的跳转URL")}],telegramBot:[{label:"telegramBotToken",tip:i.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:i.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:i.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:i.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:i.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:i.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:i.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:i.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:i.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:i.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:i.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:i.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:i.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:i.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:i.ZP.get("请输入要发送的目标"),items:[{value:"room",label:i.ZP.get("群聊")},{value:"contact",label:i.ZP.get("好友")}]},{label:"aibotkName",tip:i.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:i.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:i.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:i.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")}],lark:[{label:"larkKey",tip:i.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:i.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://nodemailer.com/smtp/well-known/"),required:!0},{label:"emailUser",tip:i.ZP.get("邮箱地址"),required:!0},{label:"emailPass",tip:i.ZP.get("邮箱SMTP授权码"),required:!0}],pushMe:[{label:"pushMeKey",tip:i.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0}],chronocat:[{label:"chronocatURL",tip:i.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:i.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:i.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:i.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:i.ZP.get("请求头Content-Type"),required:!0,items:[{value:"application/json"},{value:"multipart/form-data"},{value:"application/x-www-form-urlencoded"}]},{label:"webhookUrl",tip:i.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:i.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:i.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":i.ZP.get("登录"),"/initialization":i.ZP.get("初始化"),"/crontab":i.ZP.get("定时任务"),"/env":i.ZP.get("环境变量"),"/subscription":i.ZP.get("订阅管理"),"/config":i.ZP.get("配置文件"),"/script":i.ZP.get("脚本管理"),"/diff":i.ZP.get("对比工具"),"/log":i.ZP.get("日志管理"),"/setting":i.ZP.get("系统设置"),"/error":i.ZP.get("错误日志"),"/dependence":i.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},87423:function(e,t,n){"use strict";function i(e){var t=1e3*e,n=Math.floor(t/864e5),i=t%864e5,r=Math.floor(i/36e5),a=i%36e5,o=Math.floor(a/6e4),l=a%6e4,s=Math.round(l/1e3)+"秒";return o>0&&(s=o+"分"+s),r>0&&(s=r+"小时"+s),n>0&&(s=n+"天"+s),s}n.d(t,{E:function(){return i}})},57229:function(e,t,n){"use strict";n.d(t,{W:function(){return m}});var i=n(25359),r=n.n(i),a=n(49811),o=n.n(a),l=n(88265),s=n(9835),c=n(15207),u=n(14851),d=n(73669);s.ZP.config({duration:2});var g=Date.now(),f=d.Z.create({timeout:6e4,params:{t:g}}),p=["/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(c.Z.authKey);return t&&!p.includes(e.url)?(e.headers.Authorization="Bearer ".concat(t),e):e})),f.interceptors.response.use(function(){var e=o()(r()().mark((function e(t){var n,i,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.status,![502,504].includes(n)){e.next=5;break}u.history.push("/error"),e.next=18;break;case 5:if(401!==n){e.next=9;break}"/login"!==u.history.location.pathname&&(localStorage.removeItem(c.Z.authKey),u.history.push("/login")),e.next=18;break;case 9:return e.prev=9,200!==(i=t.data).code&&(a=i.message||i.data)&&s.ZP.error({content:a,style:{maxWidth:500,margin:"0 auto"}}),e.abrupt("return",i);case 15:e.prev=15,e.t0=e.catch(9);case 17:case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,null,[[9,15]])})));return function(t){return e.apply(this,arguments)}}(),(function(e){if(e.response){var t=e.response.data?e.response.data.message||e.message||e.response.data:e.response.statusText,n=e.response.status;[502,504].includes(n)?u.history.push("/error"):401===n?"/login"!==u.history.location.pathname&&(s.ZP.error(l.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(c.Z.authKey),u.history.push("/login")):s.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}else console.log(e.message);return Promise.reject(e)}));var m=f},40141:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},I1:function(){return g},w7:function(){return d},DY:function(){return f},FA:function(){return m},rS:function(){return Z},H$:function(){return x},W9:function(){return u},x$:function(){return p}});var i=n(93525),r=n.n(i),a=n(88265),o={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript"},l=n(11186),s=n.n(l);function c(){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,".")},i="unknow";t(/windows|win32|win64|wow32|wow64/g)?i="windows":t(/macintosh|macintel/g)?i="macos":t(/x11/g)?i="linux":t(/android|adr/g)?i="android":t(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios");var r="unknow";"windows"===i?t(/windows nt 5.0|windows 2000/g)?r="2000":t(/windows nt 5.1|windows xp/g)?r="xp":t(/windows nt 5.2|windows 2003/g)?r="2003":t(/windows nt 6.0|windows vista/g)?r="vista":t(/windows nt 6.1|windows 7/g)?r="7":t(/windows nt 6.2|windows 8/g)?r="8":t(/windows nt 6.3|windows 8.1/g)?r="8.1":t(/windows nt 10.0|windows 10/g)&&(r="10"):"macos"===i?r=n(/os x [\d._]+/g):"android"===i?r=n(/android [\d._]+/g):"ios"===i&&(r=n(/os [\d._]+/g));var a="unknow";"windows"===i||"macos"===i||"linux"===i?a="desktop":("android"===i||"ios"===i||t(/mobile/g))&&(a="mobile");var o="unknow",l="unknow";t(/applewebkit/g)?(o="webkit",t(/edge/g)?l="edge":t(/opr/g)?l="opera":t(/chrome/g)?l="chrome":t(/safari/g)&&(l="safari")):t(/gecko/g)&&t(/firefox/g)?(o="gecko",l="firefox"):t(/presto/g)?(o="presto",l="opera"):t(/trident|compatible|msie/g)&&(o="trident",l="iexplore");var s="unknow";"webkit"===o?s=n(/applewebkit\/[\d._]+/g):"gecko"===o?s=n(/gecko\/[\d._]+/g):"presto"===o?s=n(/presto\/[\d._]+/g):"trident"===o&&(s=n(/trident\/[\d._]+/g));var c="unknow";"chrome"===l?c=n(/chrome\/[\d._]+/g):"safari"===l?c=n(/version\/[\d._]+/g):"firefox"===l?c=n(/firefox\/[\d._]+/g):"opera"===l?c=n(/opr\/[\d._]+/g):"iexplore"===l?c=n(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(c=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 g=Object.assign({engine:o,engineVs:s,platform:a,supporter:l,supporterVs:c,system:i,systemVs:r},"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(g.system,"/").concat(g.systemVs,"\n浏览器:").concat(g.supporter,"/").concat(g.supporterVs,"\n内核:").concat(g.engine,"/").concat(g.engineVs),"color: green;font-size: 14px;font-weight: bold;"),g}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 i=null,r=0;(i=n||document.querySelector(".ant-table-wrapper"))&&(r=i.getBoundingClientRect().top);var a=document.body.clientHeight-r-t;return a}function d(e,t){var n,i,r=window.URL||window.webkitURL||window,a=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=r.createObjectURL(a),o.download=e,n=o,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}function g(e,t,n){var i=r()(e),a=[];return function e(i){if(i)for(var r=0;r<(null==i?void 0:i.length);r++){if(t(i[r]))return n?void(i[r].children?i[r].children.unshift(n):i[r].children=[n]):void i.splice(r,1);i[r].children&&(a.push(i[r].key),e(i[r].children))}}(i),i}function f(e,t){var n;return function e(i){if(i)for(var r=0;r<(null==i?void 0:i.length);r++)t(i[r])?n=i[r]:i[r].children&&e(i[r].children)}(r()(e)),n}function p(e){return[" ",a.ZP.get("执行结束")].some((function(t){return e.includes(t)}))}function m(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 i,r;n.startsWith("/ql/data/scripts")&&(n=n.replace("/ql/data/scripts/",""));var a=n.lastIndexOf("/");return a>=0?(r=n.slice(a+1),i=n.slice(0,a)):(r=n,i=""),[r,i]}}function h(e){try{var t=s().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);t&&(!n||t<n)&&(n=t)})),n}function x(e){var t=function(e){if(!e)return"";var t=e.split(".");return".".concat(t[t.length-1])}(e);return o[t]}},38433:function(){}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ant-table-pagination.ant-pagination{margin-bottom:0!important}.crontab-detail .card-wrapper .ant-card:last-child .ant-card-body{min-height:0;height:calc(80vh - 314px);height:calc(80vh - var(--vh-offset, 0px) - 314px);overflow-y:auto}.crontab-detail .card-wrapper .ant-card:last-child .ant-card-body>div{height:100%}.crontab-detail .ant-modal-body{background:#eee;padding:12px;max-height:calc(80vh - 57px);max-height:calc(80vh - var(--vh-offset, 57px))}.crontab-detail .ant-card-body{padding:18px}.crontab-detail .ant-card-head{padding:0 18px}.crontab-detail .ant-card:first-child{max-height:66px;overflow:auto}.crontab-detail .ant-card:first-child .ant-card-body{min-width:1000px}.crontab-detail .ant-card:first-child .cron-detail-info-item{display:flex}.crontab-detail .ant-card:first-child .cron-detail-info-item .cron-detail-info-title{width:50px}.crontab-detail .ant-card:first-child .cron-detail-info-item .cron-detail-info-value{flex:1 1;margin-top:0}.crontab-detail .ant-card:nth-child(2){overflow-x:auto}.crontab-detail .ant-card:nth-child(2) .ant-card-body{display:flex;justify-content:space-between;min-width:1000px}.crontab-detail .cron-detail-info-item{flex:auto}.crontab-detail .cron-detail-info-item .cron-detail-info-title{color:#888}.crontab-detail .cron-detail-info-item .cron-detail-info-value{margin-top:12px}.crontab-detail .crontab-title-wrapper{display:flex;align-items:center;justify-content:space-between}.crontab-detail .crontab-title-wrapper .operations{display:flex;align-items:center}.crontab-detail .crontab-title-wrapper .operations .ant-btn:not(:first-child){margin-left:8px}.log-item{cursor:pointer}.log-item:hover{background:#f2f2f2}.crontab-view .ant-tabs-nav-wrap{flex:unset!important}.crontab-view .ant-tabs-nav-operations{position:absolute;visibility:hidden;pointer-events:none}.crontab-view .view-more{margin-left:32px;padding:8px 0;cursor:pointer}.crontab-view .view-more .ant-tabs-ink-bar{width:0}.crontab-view .view-more:hover,.crontab-view .view-more:focus-visible{color:#1890ff}.crontab-view .view-more:hover .ant-tabs-ink-bar,.crontab-view .view-more:focus-visible .ant-tabs-ink-bar{width:50px}.crontab-view .view-more.active{color:#1890ff}.crontab-view .view-more.active .ant-tabs-ink-bar{width:50px}.crontab-view.more-active .ant-tabs-nav-list .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{color:unset}.crontab-view.more-active .ant-tabs-nav-list .ant-tabs-ink-bar{width:0!important}.view-create-modal-filters{display:flex}.view-create-modal-filters .ant-space-item:nth-child(3){flex:1 1}.view-create-modal-sorts{display:flex}.view-create-modal-sorts .ant-space-item:nth-child(1){flex:1 1}tr.drop-over-downward td{border-bottom:2px dashed #1890ff}tr.drop-over-upward td{border-top:2px dashed #1890ff}.view-manage-modal .ant-modal-body{padding-top:10px}.view-filters-container.active .filter-item>div>.ant-form-item-control{margin-left:40px;width:calc(100% - 40px)}body[data-mode=desktop] .crontab-wrapper tbody .ant-table-cell{height:69px!important}.cron.pinned-cron>td{background:#f2f2f2}
|