@whyour/qinglong 0.14.4 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README-en.md +9 -1
  2. package/README.md +9 -1
  3. package/docker/310.Dockerfile +81 -0
  4. package/docker/Dockerfile +5 -0
  5. package/package.json +2 -2
  6. package/sample/notify.py +57 -57
  7. package/shell/update.sh +2 -2
  8. package/static/build/api/config.js +16 -20
  9. package/static/build/api/log.js +13 -1
  10. package/static/build/api/script.js +12 -3
  11. package/static/build/api/user.js +3 -0
  12. package/static/build/loaders/initData.js +23 -1
  13. package/static/build/services/config.js +45 -0
  14. package/static/build/services/script.js +29 -1
  15. package/static/build/services/system.js +4 -4
  16. package/static/dist/8008.ffb3ed8e.async.js +1 -0
  17. package/static/dist/index.html +1 -1
  18. package/static/dist/src__pages__config__index.634c902a.async.js +1 -0
  19. package/static/dist/src__pages__crontab__detail.7d1c2d15.async.js +1 -0
  20. package/static/dist/src__pages__crontab__index.5aece157.async.js +1 -0
  21. package/static/dist/src__pages__log__index.757b3471.async.js +1 -0
  22. package/static/dist/src__pages__script__editModal.1822dae7.async.js +1 -0
  23. package/static/dist/src__pages__script__index.ed44bc1b.async.js +1 -0
  24. package/static/dist/src__pages__script__renameModal.8bbbc126.async.js +1 -0
  25. package/static/dist/src__pages__setting__dependence.2efb8ee3.async.js +1 -0
  26. package/static/dist/src__pages__setting__index.9fe663df.async.js +1 -0
  27. package/static/dist/{umi.8daa227c.js → umi.d9511dd2.js} +1 -1
  28. package/version.yaml +12 -27
  29. package/static/dist/8008.2d18f19d.async.js +0 -1
  30. package/static/dist/src__pages__config__index.77dd013c.async.js +0 -1
  31. package/static/dist/src__pages__crontab__detail.5b509309.async.js +0 -1
  32. package/static/dist/src__pages__crontab__index.e74d65bc.async.js +0 -1
  33. package/static/dist/src__pages__log__index.84556deb.async.js +0 -1
  34. package/static/dist/src__pages__script__editModal.17bcb1c2.async.js +0 -1
  35. package/static/dist/src__pages__script__index.320f4af9.async.js +0 -1
  36. package/static/dist/src__pages__script__renameModal.90d4d26a.async.js +0 -1
  37. package/static/dist/src__pages__setting__dependence.1f8b48fc.async.js +0 -1
  38. package/static/dist/src__pages__setting__index.f8842b47.async.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[8008],{78008:function(e,t,n){n.r(t);var a=n(54306),i=n.n(a),o=n(88265),r=n(63313),s=n(89065),l=n(9835),c=n(84163),u=n(24378),p=n(57229),g=n(15207),h=n(21758),d=n(99120),P=n.n(d),b=n(11527),m=s.Z.Countdown;t.default=function(e){var t=e.systemInfo,n=(0,r.useState)(!1),a=i()(n,2),s=a[0],d=a[1],f=(0,r.useState)(""),v=i()(f,2),Z=v[0],k=v[1],y=(0,r.useRef)(),x=function(e){c.Z.confirm({width:500,title:o.ZP.get("更新"),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{children:o.ZP.get("已经是最新版了!")}),(0,b.jsxs)("div",{style:{fontSize:12,fontWeight:400,marginTop:5},children:[o.ZP.get("青龙")," ",e.lastVersion," ",o.ZP.get("是目前检测到的最新可用版本了。")]})]}),okText:o.ZP.get("重新下载"),onOk:function(){q(),p.W.put("".concat(g.Z.apiPrefix,"system/update")).then((function(e){})).catch((function(e){console.log(e)}))}})},w=function(e){var n=e.lastVersion,a=e.lastLog;c.Z.confirm({width:500,title:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{children:o.ZP.get("更新可用")}),(0,b.jsxs)("div",{style:{fontSize:12,fontWeight:400,marginTop:5},children:[o.ZP.get("新版本")," ",n," ",o.ZP.get("可用,你使用的版本为")," ",t.version,"。"]})]}),content:(0,b.jsx)("pre",{children:(0,b.jsx)(P(),{children:a})}),okText:o.ZP.get("下载更新"),cancelText:o.ZP.get("以后再说"),onOk:function(){q(),p.W.put("".concat(g.Z.apiPrefix,"system/update")).then((function(e){})).catch((function(e){console.log(e)}))}})},q=function(){k(""),y.current=c.Z.info({width:600,maskClosable:!1,closable:!1,keyboard:!1,okButtonProps:{disabled:!0},title:o.ZP.get("下载更新中..."),centered:!0,content:(0,b.jsx)("pre",{children:(0,b.jsx)(P(),{children:Z})})})},B=function(){p.W.put("".concat(g.Z.apiPrefix,"system/reload"),{type:"system"}).then((function(e){l.ZP.success({content:(0,b.jsxs)("span",{children:[o.ZP.get("系统将在"),(0,b.jsx)(m,{className:"inline-countdown",format:"ss",value:Date.now()+3e4}),o.ZP.get("秒后自动刷新")]}),duration:30}),setTimeout((function(){window.location.reload()}),3e4)})).catch((function(e){console.log(e)}))};(0,r.useEffect)((function(){if(Z){var e=Z.includes("失败,请检查");y.current.update({maskClosable:e,closable:e,okButtonProps:{disabled:!e},content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("pre",{children:(0,b.jsx)(P(),{children:Z})}),(0,b.jsx)("div",{id:"log-identifier",style:{paddingBottom:5}})]})})}}),[Z]);var T=(0,r.useCallback)((function(e){var t=e.message;t.includes("失败,请检查")&&l.ZP.error(o.ZP.get("更新失败,请检查网络及日志或稍后再试")),setTimeout((function(){document.querySelector("#log-identifier").scrollIntoView({behavior:"smooth"})}),600),t.includes("更新包下载成功")&&setTimeout((function(){c.Z.confirm({width:600,maskClosable:!1,title:o.ZP.get("确认重启"),centered:!0,content:o.ZP.get("系统安装包下载成功,确认重启"),okText:o.ZP.get("重启"),onOk:function(){B()},onCancel:function(){y.current.update({maskClosable:!0,closable:!0,okButtonProps:{disabled:!1}})}})}),1e3),k((function(e){return"".concat(e).concat(t)}))}),[]);return(0,r.useEffect)((function(){var e=h.Z.getInstance();return e.subscribe("updateSystemVersion",T),function(){e.unsubscribe("updateSystemVersion",T)}}),[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(u.Z,{type:"primary",onClick:function(){s||(d(!0),l.ZP.loading(o.ZP.get("检查更新中..."),0),p.W.put("".concat(g.Z.apiPrefix,"system/update-check")).then((function(e){var t=e.code,n=e.data;l.ZP.destroy(),200===t&&(n.hasNewVersion?w(n):x(n))})).catch((function(e){l.ZP.destroy(),console.log(e)})).finally((function(){d(!1)})))},children:o.ZP.get("检查更新")}),(0,b.jsx)(u.Z,{type:"primary",onClick:B,style:{marginLeft:8},children:o.ZP.get("重新启动")})]})}},15207:function(e,t,n){var a=n(88265),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:"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:"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("推送消息的优先级")}],chat:[{label:"chatUrl",tip:a.ZP.get("chat的url地址"),required:!0},{label:"chatToken",tip:a.ZP.get("chat的token码"),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")}],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("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")}],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}],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"]}},57229:function(e,t,n){n.d(t,{W:function(){return P}});var a=n(25359),i=n.n(a),o=n(49811),r=n.n(o),s=n(88265),l=n(9835),c=n(15207),u=n(14851),p=n(73669);l.ZP.config({duration:2});var g=Date.now(),h=p.Z.create({timeout:6e4,params:{t:g}}),d=["/api/user/login","/open/auth/token","/api/user/two-factor/login","/api/system","/api/user/init","/api/user/notification/init"];h.interceptors.request.use((function(e){var t=localStorage.getItem(c.Z.authKey);return t&&!d.includes(e.url)?(e.headers.Authorization="Bearer ".concat(t),e):e})),h.interceptors.response.use(function(){var e=r()(i()().mark((function e(t){var n,a,o;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}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!==(a=t.data).code&&(o=a.message||a.data)&&l.ZP.error({content:o,style:{maxWidth:500,margin:"0 auto"}}),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.data:e.response.statusText,n=e.response.status;[502,504].includes(n)?u.history.push("/error"):401===n?"/login"!==u.history.location.pathname&&(l.ZP.error(s.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(c.Z.authKey),u.history.push("/login")):l.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}else console.log(e.message);return Promise.reject(e)}));var P=h},21758:function(e,t,n){var a=n(93525),i=n.n(a),o=n(12342),r=n.n(o),s=n(25359),l=n.n(s),c=n(49811),u=n.n(c),p=n(21140),g=n.n(p),h=n(63466),d=n.n(h),P=n(52510),b=n.n(P),m=n(78078),f=n.n(m),v=["type"],Z=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g()(this,e),b()(this,"url",void 0),b()(this,"socket",null),b()(this,"subscriptions",new Map),b()(this,"options",void 0),b()(this,"reconnectAttempts",0),b()(this,"heartbeatTimeout",null),b()(this,"state","closed"),this.url=t,this.options={maxReconnectAttempts:n.maxReconnectAttempts||5,reconnectInterval:n.reconnectInterval||3e3,heartbeatInterval:n.heartbeatInterval||3e4},this.init()}var t,n;return d()(e,[{key:"init",value:(n=u()(l()().mark((function e(){var t=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.state="connecting",this.emit("connecting");case 3:if(!(this.reconnectAttempts<this.options.maxReconnectAttempts)){e.next=16;break}return this.socket=new(f())(this.url),this.setupEventListeners(),this.startHeartbeat(),e.next=9,this.waitForClose();case 9:return this.stopHeartbeat(),this.socket=null,this.reconnectAttempts++,e.next=14,new Promise((function(e){return setTimeout(e,t.options.reconnectInterval)}));case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this.handleError(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(){return n.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.socket&&(this.socket.onopen=function(){e.state="open",e.emit("open")},this.socket.onmessage=function(t){var n=JSON.parse(t.data);e.dispatchMessage(n)},this.socket.onclose=function(){e.state="closed",e.emit("close")})}},{key:"waitForClose",value:(t=u()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null===(t=this.socket)||void 0===t?void 0:t.readyState)===f().CLOSED){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,100)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"subscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(!n.has(t)){n.add(t),this.subscriptions.set(e,n);var a={action:"subscribe",topic:e};this.send(a)}}},{key:"unsubscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(n.has(t)){n.delete(t);var a={action:"unsubscribe",topic:e};this.send(a)}}},{key:"send",value:function(e){var t;(null===(t=this.socket)||void 0===t?void 0:t.readyState)===f().OPEN&&this.socket.send(JSON.stringify(e))}},{key:"dispatchMessage",value:function(e){var t=e.type,n=r()(e,v),a=this.subscriptions.get(t)||new Set;i()(a).forEach((function(e){return e(n)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatTimeout=setInterval((function(){var t;(null===(t=e.socket)||void 0===t?void 0:t.readyState)===f().OPEN&&e.socket.send(JSON.stringify({type:"heartbeat"}))}),this.options.heartbeatInterval)}},{key:"stopHeartbeat",value:function(){this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout)}},{key:"close",value:function(){this.socket&&(this.state="closed",this.stopHeartbeat(),this.socket.close(),this.emit("close"))}},{key:"handleError",value:function(e){console.error("WebSocket错误:",e),this.emit("error",e)}},{key:"on",value:function(e,t){}},{key:"emit",value:function(e,t){}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return e.instance||(e.instance=new e(t,n)),e.instance}}]),e}();b()(Z,"instance",null),t.Z=Z}}]);
@@ -10,6 +10,6 @@
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
13
- <script src="./umi.8daa227c.js"></script>
13
+ <script src="./umi.d9511dd2.js"></script>
14
14
 
15
15
  </body></html>
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[5825],{37126:function(e,n,t){t.d(n,{Z:function(){return s}});var a=t(14797),o=t(63313),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},c=t(46420),i=function(e,n){return o.createElement(c.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:n,icon:r}))};i.displayName="SearchOutlined";var s=o.forwardRef(i)},74301:function(e,n,t){t.r(n);var a=t(54306),o=t.n(a),r=t(88265),c=t(63313),i=t(9835),s=t(75310),u=t(24378),l=t(15207),d=t(23435),E=t(57229),f=t(82755),h=t(31988),p=t(14851),g=t(26747),m=t(95407),S=t(40141),N=t(11527);n.default=function(){var e=(0,p.useOutletContext)(),n=e.headerStyle,t=e.isPhone,a=e.theme,C=(0,c.useState)(""),M=o()(C,2),y=M[0],O=M[1],v=(0,c.useState)(!0),T=o()(v,2),_=T[0],U=T[1],P=(0,c.useState)("config.sh"),I=o()(P,2),A=I[0],R=I[1],x=(0,c.useState)("config.sh"),w=o()(x,2),Z=w[0],L=w[1],b=(0,c.useState)([]),D=o()(b,2),F=D[0],K=D[1],k=(0,c.useRef)(null),H=(0,c.useState)(!1),W=o()(H,2),G=W[0],j=W[1],B=(0,c.useState)("shell"),V=o()(B,2),Q=V[0],z=V[1],q=function(e){E.W.get("".concat(l.Z.apiPrefix,"configs/detail?path=").concat(encodeURIComponent(e))).then((function(e){var n=e.code,t=e.data;200===n&&O(t)}))},Y=function(){j(!0);var e=k.current?k.current.getValue().replace(/\r\n/g,"\n"):y;E.W.post("".concat(l.Z.apiPrefix,"configs/save"),{content:e,name:Z}).then((function(e){var n=e.code;e.data;200===n&&i.ZP.success(r.ZP.get("保存成功")),j(!1)}))};return(0,m.y1)("mod+s",(function(e){Y()}),{enableOnFormTags:["textarea"],preventDefault:!0}),(0,c.useEffect)((function(){U(!0),E.W.get("".concat(l.Z.apiPrefix,"configs/files")).then((function(e){var n=e.code,t=e.data;200===n&&K(t)})).finally((function(){return U(!1)})),q("config.sh")}),[]),(0,N.jsx)(d.ZP,{className:"ql-container-wrapper config-wrapper",title:A,loading:_,extra:[(0,N.jsx)(s.Z,{treeExpandAction:"click",className:"config-select",value:Z,dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:F,defaultValue:"config.sh",onSelect:function(e,n){L(e),R(n.value),q(n.value);var t=(0,S.H$)(e);z(t)}},"value"),(0,N.jsx)(u.Z,{loading:G,type:"primary",onClick:Y,children:r.ZP.get("保存")},"1")],header:{style:n},children:t?(0,N.jsx)(h.ZP,{value:y,theme:a.includes("dark")?"dark":"light",extensions:[g.RI.shell()],onChange:function(e){O(e)}}):(0,N.jsx)(f.ZP,{language:Q,value:y,theme:a,options:{fontSize:12,lineNumbersMinChars:3,folding:!1,glyphMargin:!1},onMount:function(e){k.current=e}})})}},52105:function(e,n,t){var a=t(41171),o=t(63313),r=t(68098);n.Z=function(){var e=o.useState(!1),n=(0,a.Z)(e,2),t=n[0],c=n[1];return o.useEffect((function(){c((0,r.fk)())}),[]),t}},11847:function(e,n,t){t.d(n,{c4:function(){return r}});var a=t(22481),o=t(88028),r=["xxl","xl","lg","md","sm","xs"],c={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},i=new Map,s=-1,u={},l={matchHandlers:{},dispatch:function(e){return u=e,i.forEach((function(e){return e(u)})),i.size>=1},subscribe:function(e){return i.size||this.register(),s+=1,i.set(s,e),e(u),s},unsubscribe:function(e){i.delete(e),i.size||this.unregister()},unregister:function(){var e=this;Object.keys(c).forEach((function(n){var t=c[n],a=e.matchHandlers[t];null==a||a.mql.removeListener(null==a?void 0:a.listener)})),i.clear()},register:function(){var e=this;Object.keys(c).forEach((function(n){var t=c[n],r=function(t){var r=t.matches;e.dispatch((0,o.Z)((0,o.Z)({},u),(0,a.Z)({},n,r)))},i=window.matchMedia(t);i.addListener(r),e.matchHandlers[t]={mql:i,listener:r},r(i)}))}};n.ZP=l},1020:function(e,n,t){t.d(n,{F:function(){return i},Z:function(){return c}});var a=t(22481),o=t(84875),r=t.n(o);(0,t(20341).b)("warning","error","");function c(e,n,t){var o;return r()((o={},(0,a.Z)(o,"".concat(e,"-status-success"),"success"===n),(0,a.Z)(o,"".concat(e,"-status-warning"),"warning"===n),(0,a.Z)(o,"".concat(e,"-status-error"),"error"===n),(0,a.Z)(o,"".concat(e,"-status-validating"),"validating"===n),(0,a.Z)(o,"".concat(e,"-has-feedback"),t),o))}var i=function(e,n){return n||e}},68098:function(e,n,t){t.d(n,{fk:function(){return c},jD:function(){return r}});var a,o=t(46594),r=function(){return(0,o.Z)()&&window.document.documentElement},c=function(){if(!r())return!1;if(void 0!==a)return a;var e=document.createElement("div");return e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e),a=1===e.scrollHeight,document.body.removeChild(e),a}},20277:function(e,n,t){var a=t(88028),o=t(32602),r=t(63313),c=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)n.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(t[a[o]]=e[a[o]])}return t},i={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},s=r.forwardRef((function(e,n){var t=e.style,s=e.noStyle,u=e.disabled,l=c(e,["style","noStyle","disabled"]),d={};return s||(d=(0,a.Z)({},i)),u&&(d.pointerEvents="none"),d=(0,a.Z)((0,a.Z)({},d),t),r.createElement("div",(0,a.Z)({role:"button",tabIndex:0,ref:n},l,{onKeyDown:function(e){e.keyCode===o.Z.ENTER&&e.preventDefault()},onKeyUp:function(n){var t=n.keyCode,a=e.onClick;t===o.Z.ENTER&&a&&a()},style:d}))}));n.Z=s},32602:function(e,n){var t={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var n=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||n>=t.F1&&n<=t.F12)return!1;switch(n){case t.ALT:case t.CAPS_LOCK:case t.CONTEXT_MENU:case t.CTRL:case t.DOWN:case t.END:case t.ESC:case t.HOME:case t.INSERT:case t.LEFT:case t.MAC_FF_META:case t.META:case t.NUMLOCK:case t.NUM_CENTER:case t.PAGE_DOWN:case t.PAGE_UP:case t.PAUSE:case t.PRINT_SCREEN:case t.RIGHT:case t.SHIFT:case t.UP:case t.WIN_KEY:case t.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=t.ZERO&&e<=t.NINE)return!0;if(e>=t.NUM_ZERO&&e<=t.NUM_MULTIPLY)return!0;if(e>=t.A&&e<=t.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case t.SPACE:case t.QUESTION_MARK:case t.NUM_PLUS:case t.NUM_MINUS:case t.NUM_PERIOD:case t.NUM_DIVISION:case t.SEMICOLON:case t.DASH:case t.EQUALS:case t.COMMA:case t.PERIOD:case t.SLASH:case t.APOSTROPHE:case t.SINGLE_QUOTE:case t.OPEN_SQUARE_BRACKET:case t.BACKSLASH:case t.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};n.Z=t},35019:function(e,n,t){t.d(n,{Z:function(){return s}});var a=t(2595),o="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/),r="aria-",c="data-";function i(e,n){return 0===e.indexOf(n)}function s(e){var n,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n=!1===t?{aria:!0,data:!0,attr:!0}:!0===t?{aria:!0}:(0,a.Z)({},t);var s={};return Object.keys(e).forEach((function(t){(n.aria&&("role"===t||i(t,r))||n.data&&i(t,c)||n.attr&&o.includes(t))&&(s[t]=e[t])})),s}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[9558,5812],{75909:function(e,n,t){var i=t(14797),r=t(87807),a=t(16803),o=t(63313),c=t(84875),l=t.n(c),s=t(12888),u=t(15152),d=["className","component","viewBox","spin","rotate","tabIndex","onClick","children"],f=o.forwardRef((function(e,n){var t=e.className,c=e.component,f=e.viewBox,m=e.spin,p=e.rotate,h=e.tabIndex,g=e.onClick,Z=e.children,v=(0,a.Z)(e,d);(0,u.Kp)(Boolean(c||Z),"Should have `component` prop or `children`."),(0,u.C3)();var x=o.useContext(s.Z),y=x.prefixCls,b=void 0===y?"anticon":y,j=x.rootClassName,P=l()(j,b,t),C=l()((0,r.Z)({},"".concat(b,"-spin"),!!m)),w=p?{msTransform:"rotate(".concat(p,"deg)"),transform:"rotate(".concat(p,"deg)")}:void 0,S=(0,i.Z)((0,i.Z)({},u.vD),{},{className:C,style:w,viewBox:f});f||delete S.viewBox;var N=h;return void 0===N&&g&&(N=-1),o.createElement("span",(0,i.Z)((0,i.Z)({role:"img"},v),{},{ref:n,tabIndex:N,onClick:g,className:P}),c?o.createElement(c,(0,i.Z)({},S),Z):Z?((0,u.Kp)(Boolean(f)||1===o.Children.count(Z)&&o.isValidElement(Z)&&"use"===o.Children.only(Z).type,"Make sure that you provide correct `viewBox` prop (default `0 0 1024 1024`) to the icon."),o.createElement("svg",(0,i.Z)((0,i.Z)({},S),{},{viewBox:f}),Z)):null)}));f.displayName="AntdIcon",n.Z=f},55258:function(e,n,t){t.d(n,{Z:function(){return d}});var i=t(14797),r=t(16803),a=t(63313),o=t(75909),c=["type","children"],l=new Set;function s(e){return Boolean("string"==typeof e&&e.length&&!l.has(e))}function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=e[n];if(s(t)){var i=document.createElement("script");i.setAttribute("src",t),i.setAttribute("data-namespace",t),e.length>n+1&&(i.onload=function(){u(e,n+1)},i.onerror=function(){u(e,n+1)}),l.add(t),document.body.appendChild(i)}}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.scriptUrl,t=e.extraCommonProps,l=void 0===t?{}:t;n&&"undefined"!=typeof document&&"undefined"!=typeof window&&"function"==typeof document.createElement&&(Array.isArray(n)?u(n.reverse()):u([n]));var s=a.forwardRef((function(e,n){var t=e.type,s=e.children,u=(0,r.Z)(e,c),d=null;return e.type&&(d=a.createElement("use",{xlinkHref:"#".concat(t)})),s&&(d=s),a.createElement(o.Z,(0,i.Z)((0,i.Z)((0,i.Z)({},l),u),{},{ref:n}),d)}));return s.displayName="Iconfont",s}},25265:function(e,n,t){t.d(n,{Z:function(){return l}});var i=t(14797),r=t(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},o=t(46420),c=function(e,n){return r.createElement(o.Z,(0,i.Z)((0,i.Z)({},e),{},{ref:n,icon:a}))};c.displayName="FileOutlined";var l=r.forwardRef(c)},37126:function(e,n,t){t.d(n,{Z:function(){return l}});var i=t(14797),r=t(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},o=t(46420),c=function(e,n){return r.createElement(o.Z,(0,i.Z)((0,i.Z)({},e),{},{ref:n,icon:a}))};c.displayName="SearchOutlined";var l=r.forwardRef(c)},38582:function(e,n,t){var i=(0,t(55258).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_ob5y15ewlyq.js"]});n.Z=i},74385:function(e,n,t){t.r(n),t.d(n,{default:function(){return F}});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),H=s.Z.Text,z=[{key:"log",tab:c.ZP.get("日志")},{key:"script",tab:c.ZP.get("脚本")}],F=function(e){var n,t,i,a,q=e.cron,F=void 0===q?{}:q,I=e.handleCancel,W=e.visible,L=e.theme,Y=e.isPhone,V=(0,l.useState)("log"),K=o()(V,2),U=K[0],$=K[1],G=(0,l.useState)(!0),J=o()(G,2),Q=(J[0],J[1]),X=(0,l.useState)([]),ee=o()(X,2),ne=ee[0],te=ee[1],ie=(0,l.useState)(""),re=o()(ie,2),ae=re[0],oe=re[1],ce=(0,l.useState)(""),le=o()(ce,2),se=le[0],ue=le[1],de=(0,l.useState)(!1),fe=o()(de,2),me=fe[0],pe=fe[1],he=(0,l.useRef)(null),ge=(0,l.useState)({}),Ze=o()(ge,2),ve=Ze[0],xe=Ze[1],ye=(0,l.useState)(""),be=o()(ye,2),je=be[0],Pe=be[1],Ce=(0,l.useState)(z),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,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1},onMount:function(e,n){he.current=e}})},Te=function(e){var n="".concat(E.Z.apiPrefix,"logs/detail?file=").concat(e.filename,"&path=").concat(e.directory||"");localStorage.setItem("logCron",n),Pe(n),k.W.get(n).then((function(e){var n=e.code,t=e.data;200===n&&(oe(t),pe(!0))}))},qe=function(){Q(!0),k.W.get("".concat(E.Z.apiPrefix,"crons/").concat(F.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(){F&&F.id&&(Be(F),qe(),function(){var e=(0,R.FA)(F.command);if(Array.isArray(e)){Ne(Se);var n=o()(e,2),t=n[0],i=n[1];xe({parent:i,filename:t}),k.W.get("".concat(E.Z.apiPrefix,"scripts/detail?file=").concat(t,"&path=").concat(i||"")).then((function(e){var n=e.code,t=e.data;200===n&&ue(t)}))}else e&&Ne([Se[0]])}())}),[F]),(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)(H,{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)(H,{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)(H,{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)(H,{style:{wordBreak:"break-all"},type:"warning",children:Oe.name})," ",c.ZP.get("吗")]}),onOk:function(){k.W.put("".concat(E.Z.apiPrefix,"crons/").concat(1===Oe.isPinned?"unpin":"pin"),[Oe.id]).then((function(e){var n=e.code;e.data;200===n&&Be(r()(r()({},Oe),{},{isPinned:1===Oe.isPinned?0:1}))}))},onCancel:function(){console.log("Cancel")}})}})})]})]}),centered:!0,open:W,forceRender:!0,footer:!1,onCancel:function(){return I()},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)(H,{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:F,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(){H()})),B(o),o&&setTimeout((function(){H(),e()}),2e3)}})).finally((function(){t&&N(!1)}))},H=function(){q.current.down&&setTimeout((function(){document.querySelector("#log-flag").scrollIntoView({behavior:"smooth"})}),600)},z=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 z()},onCancel:function(){return z()},footer:[(0,x.jsx)(u.Z,{type:"primary",onClick:function(){return z()},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)(),H=s.useRef(j);s.useEffect((function(){var e=f.ZP.subscribe((function(e){T(e);var n=H.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 z,F=S("row",c),I=(z=[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]){z[n]=e[i];break}}else z[n]=e})),z),W=l()(F,(t={},(0,r.Z)(t,"".concat(F,"-no-wrap"),!1===P),(0,r.Z)(t,"".concat(F,"-").concat(A),A),(0,r.Z)(t,"".concat(F,"-").concat(q),q),(0,r.Z)(t,"".concat(F,"-rtl"),"rtl"===N),t),v),L={},Y=null!=I[0]&&I[0]>0?I[0]/-2:void 0,V=null!=I[1]&&I[1]>0?I[1]/-2:void 0;if(Y&&(L.marginLeft=Y,L.marginRight=Y),D){var K=(0,o.Z)(I,2);L.rowGap=K[1]}else V&&(L.marginTop=V,L.marginBottom=V);var U=(0,o.Z)(I,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:W,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,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1},onMount:function(e,t){me.current=e}})},We=function(e){var t="".concat(q.Z.apiPrefix,"logs/detail?file=").concat(e.filename,"&path=").concat(e.directory||"");localStorage.setItem("logCron",t),je(t),_.W.get(t).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/detail?file=").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("青龙"),baseUrl:r,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://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),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:"text/plain"},{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
+ (self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[9818],{13740:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(14797),r=n(63313),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},o=n(46420),c=function(e,t){return r.createElement(o.Z,(0,i.Z)((0,i.Z)({},e),{},{ref:t,icon:a}))};c.displayName="DeleteOutlined";var l=r.forwardRef(c)},51805:function(e,t,n){"use strict";var i=n(57213),r=n.n(i),a=n(63313);t.Z=function(e,t,n){var i=n.treeNodeFilterProp;return(0,a.useMemo)((function(){var n=[];if(!t)return{treeData:e,keys:n};var a=t.toUpperCase();function o(e,t){var n=t[i];return String(n).toUpperCase().includes(a)}return{treeData:function e(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.map((function(t){var a=t.children,c=i||o(0,t),l=e(a||[],c);return c||l.length?(l.length&&n.push(t.key),r()(r()({},t),{},{children:l})):null})).filter((function(e){return e}))}(e),keys:n}}),[e,t,i])}},69365:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var i=n(93525),r=n.n(i),a=n(54306),o=n.n(a),c=n(88265),l=n(63313),s=n(92260),u=n(84163),f=n(9835),h=n(75310),d=n(15367),g=n(24378),p=n(22159),v=n(43209),m=n(84540),x=n(15207),y=n(23435),Z=n(82755),b=n(57229),P={"left-tree-container":"left-tree-container___zHanw","left-tree-scroller":"left-tree-scroller___PInUN","log-container":"log-container___ba9Tr"},k=n(31988),w=n(36035),S=n(14851),j=n(13740),B=n(40141),C=n(66292),E=n.n(C),N=n(4363),M=n.n(N),_=n(51805),D=n(79514),F=n(11527),z=s.Z.Text,I=function(){var e=(0,S.useOutletContext)(),t=e.headerStyle,n=e.isPhone,i=e.theme,a=(0,l.useState)(c.ZP.get("请选择日志文件")),s=o()(a,2),C=s[0],N=s[1],I=(0,l.useState)(c.ZP.get("请选择日志文件")),T=o()(I,2),H=T[0],L=T[1],A=(0,l.useState)([]),G=o()(A,2),O=G[0],Y=G[1],$=(0,l.useState)(!1),q=o()($,2),K=q[0],R=q[1],U=(0,l.useState)(),W=o()(U,2),J=W[0],Q=W[1],V=(0,l.useRef)(),X=(0,l.useState)([]),ee=o()(X,2),te=ee[0],ne=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],fe=function(e,t){oe(t),L(e),t.key!==H&&e&&("directory"!==t.type?(N(c.ZP.get("加载中...")),function(e){b.W.get("".concat(x.Z.apiPrefix,"logs/detail?file=").concat(e.title,"&path=").concat(e.parent||"")).then((function(e){var t=e.code,n=e.data;200===t&&N(n)}))}(t)):N(c.ZP.get("请选择日志文件")))},he=(0,l.useCallback)((function(e,t){fe(e[0],t.node)}),[]),de=(0,l.useCallback)((function(e){var t=e.target.value;ge(t)}),[O]),ge=(0,l.useCallback)(E()((function(e){ue(e)}),300),[O]),pe=(0,_.Z)(O,se,{treeNodeFilterProp:"title"}),ve=pe.treeData,me=pe.keys;(0,l.useEffect)((function(){ne(M()([].concat(r()(te),r()(me))))}),[me]);var xe=function(){L(""),oe(null),N(c.ZP.get("请选择脚本文件"))};return(0,l.useEffect)((function(){R(!0),b.W.get("".concat(x.Z.apiPrefix,"logs")).then((function(e){var t=e.code,n=e.data;200===t&&Y(n)})).finally((function(){return R(!1)}))}),[]),(0,l.useEffect)((function(){V.current&&Q(V.current.clientHeight)}),[V.current,O]),(0,F.jsx)(y.ZP,{className:"ql-container-wrapper log-wrapper",title:(0,F.jsxs)(F.Fragment,{children:[H,"file"===(null==ae?void 0:ae.type)&&(0,F.jsx)("span",{style:{marginLeft:6,fontSize:12,color:"#999",display:"inline-block",height:14},children:(0,D.Z)(ae.size)})]}),loading:K,extra:n?[(0,F.jsx)(h.Z,{treeExpandAction:"click",className:"log-select",value:H,dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:O,placeholder:c.ZP.get("请选择日志"),fieldNames:{value:"key"},treeNodeFilterProp:"title",showSearch:!0,allowClear:!0,onSelect:fe})]:[(0,F.jsx)(d.Z,{title:c.ZP.get("删除"),children:(0,F.jsx)(g.Z,{type:"primary",disabled:!H,onClick:function(){u.Z.confirm({title:"确认删除",content:(0,F.jsxs)(F.Fragment,{children:[c.ZP.get("确认删除"),(0,F.jsx)(z,{style:{wordBreak:"break-all"},type:"warning",children:H}),c.ZP.get("文件"),"directory"===ae.type?c.ZP.get("夹下所以日志"):"",c.ZP.get(",删除后不可恢复")]}),onOk:function(){b.W.delete("".concat(x.Z.apiPrefix,"logs"),{data:{filename:ae.title,path:ae.parent||"",type:ae.type}}).then((function(e){if(200===e.code){f.ZP.success("删除成功");var t=r()(O);if(ae.parent)t=(0,B.I1)(t,(function(e){return e.key===ae.key}));else{var n=t.findIndex((function(e){return e.key===ae.key}));-1!==n&&t.splice(n,1)}Y(t),xe()}}))},onCancel:function(){console.log("Cancel")}})},icon:(0,F.jsx)(j.Z,{})})})],header:{style:t},children:(0,F.jsxs)("div",{className:"".concat(P["log-container"]," log-container"),children:[!n&&(0,F.jsxs)(w.Z,{split:"vertical",size:200,maxSize:-100,children:[(0,F.jsx)("div",{className:P["left-tree-container"],children:O.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(p.Z.Search,{className:P["left-tree-search"],onChange:de,placeholder:c.ZP.get("请输入日志名"),allowClear:!0}),(0,F.jsx)("div",{className:P["left-tree-scroller"],ref:V,children:(0,F.jsx)(v.Z,{expandAction:"click",className:P["left-tree"],treeData:ve,showIcon:!0,height:J,selectedKeys:[H],showLine:{showLeafIcon:!0},onSelect:he,expandedKeys:te,onExpand:function(e){ne(e)}})})]}):(0,F.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,F.jsx)(m.Z,{description:c.ZP.get("暂无日志"),image:m.Z.PRESENTED_IMAGE_SIMPLE})})}),(0,F.jsx)(Z.ZP,{language:"shell",theme:i,value:C,options:{readOnly:!0,fontSize:12,minimap:{enabled:!1},lineNumbersMinChars:3,folding:!1,glyphMargin:!1}})]}),n&&(0,F.jsx)(k.ZP,{value:C,readOnly:!0,theme:i.includes("dark")?"dark":"light",onChange:function(e,t){N(e)}})]})})}},45170:function(e,t,n){var i=n(13807);e.exports=function(e,t){return!!(null==e?0:e.length)&&i(e,t,0)>-1}},94936:function(e){e.exports=function(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}},92504:function(e){e.exports=function(e,t,n,i){for(var r=e.length,a=n+(i?1:-1);i?a--:++a<r;)if(t(e[a],a,e))return a;return-1}},13807:function(e,t,n){var i=n(92504),r=n(99940),a=n(3729);e.exports=function(e,t,n){return t==t?a(e,t,n):i(e,r,n)}},99940:function(e){e.exports=function(e){return e!=e}},95453:function(e,t,n){var i=n(78188),r=n(45170),a=n(94936),o=n(29880),c=n(17319),l=n(79967);e.exports=function(e,t,n){var s=-1,u=r,f=e.length,h=!0,d=[],g=d;if(n)h=!1,u=a;else if(f>=200){var p=t?null:c(e);if(p)return l(p);h=!1,u=o,g=new i}else g=t?[]:d;e:for(;++s<f;){var v=e[s],m=t?t(v):v;if(v=n||0!==v?v:0,h&&m==m){for(var x=g.length;x--;)if(g[x]===m)continue e;t&&g.push(m),d.push(v)}else u(g,m,n)||(g!==d&&g.push(m),d.push(v))}return d}},17319:function(e,t,n){var i=n(81956),r=n(43226),a=n(79967),o=i&&1/a(new i([,-0]))[1]==1/0?function(e){return new i(e)}:r;e.exports=o},3729:function(e){e.exports=function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}},43226:function(e){e.exports=function(){}},4363:function(e,t,n){var i=n(95453);e.exports=function(e){return e&&e.length?i(e):[]}},79514:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});const i=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],r=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],o=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],c=(e,t,n)=>{let i=e;return"string"==typeof t||Array.isArray(t)?i=e.toLocaleString(t,n):!0!==t&&void 0===n||(i=e.toLocaleString(void 0,n)),i};function l(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);const n=(t={bits:!1,binary:!1,space:!0,...t}).bits?t.binary?o:a:t.binary?r:i,l=t.space?" ":"";if(t.signed&&0===e)return` 0${l}${n[0]}`;const s=e<0,u=s?"-":t.signed?"+":"";let f;if(s&&(e=-e),void 0!==t.minimumFractionDigits&&(f={minimumFractionDigits:t.minimumFractionDigits}),void 0!==t.maximumFractionDigits&&(f={maximumFractionDigits:t.maximumFractionDigits,...f}),e<1){return u+c(e,t.locale,f)+l+n[0]}const h=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**h,f||(e=e.toPrecision(3));return u+c(Number(e),t.locale,f)+l+n[h]}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[5586],{98912:function(e,t,n){n.r(t);var i=n(57213),a=n.n(i),o=n(54306),r=n.n(o),s=n(88265),c=n(63313),l=n(28756),u=n(60858),d=n(75310),h=n(24378),p=n(57229),f=n(15207),m=n(36035),v=n(82755),g=n(68793),b=n(12417),y=n(3094),x=n(40141),k=n(21758),Z=n(99120),w=n.n(Z),S=n(11527),C=l.Z.Option;t.default=function(e){var t=e.treeData,n=e.currentNode,i=e.content,o=e.handleCancel,Z=e.visible,P=(0,c.useState)(""),I=r()(P,2),j=I[0],O=I[1],E=(0,c.useState)("javascript"),N=r()(E,2),_=N[0],F=N[1],R=(0,c.useState)(),M=r()(R,2),H=M[0],A=M[1],L=(0,c.useState)(),T=r()(L,2),W=T[0],q=T[1],z=(0,c.useState)(!1),D=r()(z,2),V=D[0],B=D[1],J=(0,c.useState)(!1),X=r()(J,2),$=X[0],U=X[1],G=(0,c.useState)(""),Y=r()(G,2),K=Y[0],Q=Y[1],ee=(0,y.F)().theme,te=(0,c.useRef)(null),ne=(0,c.useState)(!1),ie=r()(ne,2),ae=ie[0],oe=ie[1],re=(0,c.useState)(null),se=r()(re,2),ce=se[0],le=se[1],ue=function(e){p.W.get("".concat(f.Z.apiPrefix,"scripts/detail?file=").concat(e.title,"&path=").concat(e.parent||"")).then((function(e){var t=e.code,n=e.data;200===t&&O(n)}))},de=function(){H&&H.title&&ce&&p.W.put("".concat(f.Z.apiPrefix,"scripts/stop"),{filename:H.title,path:H.parent||"",pid:ce}).then((function(e){var t=e.code;e.data;200===t&&oe(!1)}))},he=(0,c.useCallback)((function(e){var t=e.message;(0,x.x$)(t)&&setTimeout((function(){oe(!1)}),300),Q((function(e){return"".concat(e).concat(t)}))}),[]);return(0,c.useEffect)((function(){var e=k.Z.getInstance();return e.subscribe("manuallyRunScript",he),function(){e.unsubscribe("manuallyRunScript",he)}}),[]),(0,c.useEffect)((function(){if(Q(""),n){A(n),O(i),q(n.key);var e=(0,x.H$)(n.title);F(e)}}),[i,n]),(0,S.jsxs)(u.Z,{className:"edit-modal",closable:!1,title:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(d.Z,{treeExpandAction:"click",style:{marginRight:8,width:300},value:W,dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:t,placeholder:s.ZP.get("请选择脚本文件"),fieldNames:{value:"key",label:"title"},showSearch:!0,onSelect:function(e,t){if(t.key!==W&&e&&"directory"!==t.type){var n=(0,x.H$)(e);A(t),F(n),ue(t),q(t.key)}},treeLine:{showLeafIcon:!0}}),(0,S.jsxs)(l.Z,{value:_,style:{width:110,marginRight:8},onChange:function(e){F(e)},children:[(0,S.jsx)(C,{value:"javascript",children:"javascript"}),(0,S.jsx)(C,{value:"typescript",children:"typescript"}),(0,S.jsx)(C,{value:"shell",children:"shell"}),(0,S.jsx)(C,{value:"python",children:"python"})]}),(0,S.jsx)(h.Z,{type:"primary",style:{marginRight:8},onClick:ae?de:function(){Q("");var e=te.current.getValue().replace(/\r\n/g,"\n");p.W.put("".concat(f.Z.apiPrefix,"scripts/run"),{filename:H.title,path:H.parent||"",content:e}).then((function(e){var t=e.code,n=e.data;200===t&&(oe(!0),le(n))}))},children:ae?s.ZP.get("停止"):s.ZP.get("运行")}),(0,S.jsx)(h.Z,{type:"primary",style:{marginRight:8},onClick:function(){Q("")},children:s.ZP.get("清空日志")}),(0,S.jsx)(h.Z,{type:"primary",style:{marginRight:8},onClick:function(){B(!0)},children:s.ZP.get("保存")}),(0,S.jsx)(h.Z,{type:"primary",style:{marginRight:8},onClick:function(){de(),o()},children:s.ZP.get("退出")})]}),width:"100%",headerStyle:{padding:"11px 24px"},onClose:function(){o()},open:Z,children:[(0,S.jsxs)(m.Z,{split:"vertical",minSize:200,defaultSize:"50%",style:{height:"calc(100vh - 55px)"},pane2Style:{overflowY:"auto"},children:[(0,S.jsx)(v.ZP,{language:_,value:j,theme:ee,options:{fontSize:12,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1},onMount:function(e){te.current=e}}),(0,S.jsx)("pre",{style:{padding:"0 15px"},children:(0,S.jsx)(w(),{children:K})})]}),(0,S.jsx)(g.default,{visible:V,handleCancel:function(){B(!1)},file:a()({content:te.current&&te.current.getValue().replace(/\r\n/g,"\n")},H)}),(0,S.jsx)(b.default,{visible:$,handleCancel:function(){U(!1)}})]})}},68793:function(e,t,n){n.r(t);var i=n(25359),a=n.n(i),o=n(57213),r=n.n(o),s=n(49811),c=n.n(s),l=n(54306),u=n.n(l),d=n(88265),h=n(63313),p=n(67393),f=n(9835),m=n(84163),v=n(22159),g=n(57229),b=n(15207),y=n(11527);t.default=function(e){var t=e.file,n=e.handleCancel,i=e.visible,o=p.Z.useForm(),s=u()(o,1)[0],l=(0,h.useState)(!1),x=u()(l,2),k=x[0],Z=x[1],w=function(){var e=c()(a()().mark((function e(i){var o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Z(!0),o=r()(r()(r()({},t),i),{},{originFilename:t.title}),g.W.post("".concat(b.Z.apiPrefix,"scripts"),o).then((function(e){var t=e.code,i=e.data;200===t&&(f.ZP.success(d.ZP.get("保存文件成功")),n(i))})).finally((function(){Z(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,h.useEffect)((function(){s.resetFields(),Z(!1)}),[t,i]),(0,y.jsx)(m.Z,{title:d.ZP.get("保存文件"),open:i,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){s.validateFields().then((function(e){w(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:k,children:(0,y.jsxs)(p.Z,{form:s,layout:"vertical",name:"script_modal",initialValues:{filename:null==t?void 0:t.title,path:(null==t?void 0:t.parent)||""},children:[(0,y.jsx)(p.Z.Item,{name:"filename",label:d.ZP.get("文件名"),rules:[{required:!0,message:d.ZP.get("请输入文件名")}],children:(0,y.jsx)(v.Z,{placeholder:d.ZP.get("请输入文件名")})}),(0,y.jsx)(p.Z.Item,{name:"path",label:d.ZP.get("保存目录"),children:(0,y.jsx)(v.Z,{placeholder:d.ZP.get("请输入保存目录,默认scripts目录")})})]})})}},12417:function(e,t,n){n.r(t);n(25359),n(57213),n(49811);var i=n(54306),a=n.n(i),o=n(88265),r=n(63313),s=n(67393),c=(n(9835),n(84163)),l=n(22159),u=(n(57229),n(15207),n(11527));t.default=function(e){var t=e.file,n=e.handleCancel,i=e.visible,d=s.Z.useForm(),h=a()(d,1)[0],p=(0,r.useState)(!1),f=a()(p,2),m=(f[0],f[1]);return(0,r.useEffect)((function(){h.resetFields(),m(!1)}),[t,i]),(0,u.jsx)(c.Z,{title:o.ZP.get("运行设置"),open:i,forceRender:!0,centered:!0,onCancel:function(){return n()},children:(0,u.jsx)(s.Z,{form:h,layout:"vertical",name:"setting_modal",initialValues:t,children:(0,u.jsx)(s.Z.Item,{name:"filename",label:o.ZP.get("待开发"),rules:[{required:!0,message:o.ZP.get("待开发")}],children:(0,u.jsx)(l.Z,{placeholder:o.ZP.get("待开发")})})})})}},3094:function(e,t,n){n.d(t,{F:function(){return c},e:function(){return s}});var i=n(54306),a=n.n(i),o=n(63313),r=n(40141),s=function(){var e=(0,o.useState)("100%"),t=a()(e,2),n=t[0],i=t[1],s=(0,o.useState)(0),c=a()(s,2),l=c[0],u=c[1],d=(0,o.useState)(-48),h=a()(d,2),p=h[0],f=h[1],m=(0,o.useState)(!1),v=a()(m,2),g=v[0],b=v[1],y=(0,o.useMemo)((function(){return(0,r.ZP)()}),[]).platform;return(0,o.useEffect)((function(){"mobile"===y&&document.body.offsetWidth<768?(i("auto"),u(0),f(0),b(!0),document.body.setAttribute("data-mode","phone")):(i("100%"),u(0),f(-48),b(!1),document.body.setAttribute("data-mode","desktop"))}),[]),{headerStyle:{padding:"4px 16px 4px 15px",position:"sticky",top:0,left:0,zIndex:20,marginTop:p,width:n,marginLeft:l},isPhone:g}},c=function(){var e=(0,o.useState)(),t=a()(e,2),n=t[0],i=t[1];return(0,o.useEffect)((function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;i(n?"vs-dark":"vs");var a=function(e){"auto"!==t&&t||(e.matches?i("vs-dark"):i("vs"))};"function"==typeof e.addEventListener?e.addEventListener("change",a):"function"==typeof e.addListener&&e.addListener(a)}),[]),{theme:n,reloadTheme:function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;i(n?"vs-dark":"vs")}}}},21758:function(e,t,n){var i=n(93525),a=n.n(i),o=n(12342),r=n.n(o),s=n(25359),c=n.n(s),l=n(49811),u=n.n(l),d=n(21140),h=n.n(d),p=n(63466),f=n.n(p),m=n(52510),v=n.n(m),g=n(78078),b=n.n(g),y=["type"],x=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h()(this,e),v()(this,"url",void 0),v()(this,"socket",null),v()(this,"subscriptions",new Map),v()(this,"options",void 0),v()(this,"reconnectAttempts",0),v()(this,"heartbeatTimeout",null),v()(this,"state","closed"),this.url=t,this.options={maxReconnectAttempts:n.maxReconnectAttempts||5,reconnectInterval:n.reconnectInterval||3e3,heartbeatInterval:n.heartbeatInterval||3e4},this.init()}var t,n;return f()(e,[{key:"init",value:(n=u()(c()().mark((function e(){var t=this;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.state="connecting",this.emit("connecting");case 3:if(!(this.reconnectAttempts<this.options.maxReconnectAttempts)){e.next=16;break}return this.socket=new(b())(this.url),this.setupEventListeners(),this.startHeartbeat(),e.next=9,this.waitForClose();case 9:return this.stopHeartbeat(),this.socket=null,this.reconnectAttempts++,e.next=14,new Promise((function(e){return setTimeout(e,t.options.reconnectInterval)}));case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this.handleError(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(){return n.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.socket&&(this.socket.onopen=function(){e.state="open",e.emit("open")},this.socket.onmessage=function(t){var n=JSON.parse(t.data);e.dispatchMessage(n)},this.socket.onclose=function(){e.state="closed",e.emit("close")})}},{key:"waitForClose",value:(t=u()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null===(t=this.socket)||void 0===t?void 0:t.readyState)===b().CLOSED){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,100)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"subscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(!n.has(t)){n.add(t),this.subscriptions.set(e,n);var i={action:"subscribe",topic:e};this.send(i)}}},{key:"unsubscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(n.has(t)){n.delete(t);var i={action:"unsubscribe",topic:e};this.send(i)}}},{key:"send",value:function(e){var t;(null===(t=this.socket)||void 0===t?void 0:t.readyState)===b().OPEN&&this.socket.send(JSON.stringify(e))}},{key:"dispatchMessage",value:function(e){var t=e.type,n=r()(e,y),i=this.subscriptions.get(t)||new Set;a()(i).forEach((function(e){return e(n)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatTimeout=setInterval((function(){var t;(null===(t=e.socket)||void 0===t?void 0:t.readyState)===b().OPEN&&e.socket.send(JSON.stringify({type:"heartbeat"}))}),this.options.heartbeatInterval)}},{key:"stopHeartbeat",value:function(){this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout)}},{key:"close",value:function(){this.socket&&(this.state="closed",this.stopHeartbeat(),this.socket.close(),this.emit("close"))}},{key:"handleError",value:function(e){console.error("WebSocket错误:",e),this.emit("error",e)}},{key:"on",value:function(e,t){}},{key:"emit",value:function(e,t){}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return e.instance||(e.instance=new e(t,n)),e.instance}}]),e}();v()(x,"instance",null),t.Z=x},28756:function(e,t,n){var i=n(22481),a=n(88028),o=n(84875),r=n.n(o),s=n(40804),c=n(54331),l=n(63313),u=n(82259),d=n(23474),h=n(7893),p=n(65189),f=n(76737),m=n(16082),v=n(1020),g=n(91967),b=n(60934),y=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n},x="SECRET_COMBOBOX_MODE_DO_NOT_USE",k=function(e,t){var n,o,k=e.prefixCls,Z=e.bordered,w=void 0===Z||Z,S=e.className,C=e.getPopupContainer,P=e.dropdownClassName,I=e.popupClassName,j=e.listHeight,O=void 0===j?256:j,E=e.placement,N=e.listItemHeight,_=void 0===N?24:N,F=e.size,R=e.disabled,M=e.notFoundContent,H=e.status,A=e.showArrow,L=y(e,["prefixCls","bordered","className","getPopupContainer","dropdownClassName","popupClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","showArrow"]),T=l.useContext(u.E_),W=T.getPopupContainer,q=T.getPrefixCls,z=T.renderEmpty,D=T.direction,V=T.virtual,B=T.dropdownMatchSelectWidth,J=l.useContext(p.Z),X=q("select",k),$=q(),U=(0,b.ri)(X,D),G=U.compactSize,Y=U.compactItemClassnames,K=l.useMemo((function(){var e=L.mode;if("combobox"!==e)return e===x?"combobox":e}),[L.mode]),Q="multiple"===K||"tags"===K,ee=void 0!==A?A:L.loading||!(Q||"combobox"===K),te=(0,l.useContext)(f.aM),ne=te.status,ie=te.hasFeedback,ae=te.isFormItemInput,oe=te.feedbackIcon,re=(0,v.F)(ne,H);o=void 0!==M?M:"combobox"===K?null:(z||d.Z)("Select");var se=(0,g.Z)((0,a.Z)((0,a.Z)({},L),{multiple:Q,hasFeedback:ie,feedbackIcon:oe,showArrow:ee,prefixCls:X})),ce=se.suffixIcon,le=se.itemIcon,ue=se.removeIcon,de=se.clearIcon,he=(0,c.Z)(L,["suffixIcon","itemIcon"]),pe=r()(I||P,(0,i.Z)({},"".concat(X,"-dropdown-").concat(D),"rtl"===D)),fe=G||F||J,me=l.useContext(h.Z),ve=null!=R?R:me,ge=r()((n={},(0,i.Z)(n,"".concat(X,"-lg"),"large"===fe),(0,i.Z)(n,"".concat(X,"-sm"),"small"===fe),(0,i.Z)(n,"".concat(X,"-rtl"),"rtl"===D),(0,i.Z)(n,"".concat(X,"-borderless"),!w),(0,i.Z)(n,"".concat(X,"-in-form-item"),ae),n),(0,v.Z)(X,re,ie),Y,S);return l.createElement(s.ZP,(0,a.Z)({ref:t,virtual:V,dropdownMatchSelectWidth:B},he,{transitionName:(0,m.mL)($,(0,m.q0)(E),L.transitionName),listHeight:O,listItemHeight:_,mode:K,prefixCls:X,placement:void 0!==E?E:"rtl"===D?"bottomRight":"bottomLeft",direction:D,inputIcon:ce,menuItemSelectedIcon:le,removeIcon:ue,clearIcon:de,notFoundContent:o,className:ge,getPopupContainer:C||W,dropdownClassName:pe,showArrow:ie||A,disabled:ve}))},Z=l.forwardRef(k);Z.SECRET_COMBOBOX_MODE_DO_NOT_USE=x,Z.Option=s.Wx,Z.OptGroup=s.Xo,t.Z=Z}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[6534,9064,8673,440,833],{38582:function(e,t,n){"use strict";var r=(0,n(55258).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_ob5y15ewlyq.js"]});t.Z=r},51805:function(e,t,n){"use strict";var r=n(57213),a=n.n(r),i=n(63313);t.Z=function(e,t,n){var r=n.treeNodeFilterProp;return(0,i.useMemo)((function(){var n=[];if(!t)return{treeData:e,keys:n};var i=t.toUpperCase();function o(e,t){var n=t[r];return String(n).toUpperCase().includes(i)}return{treeData:function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.map((function(t){var i=t.children,l=r||o(0,t),s=e(i||[],l);return l||s.length?(s.length&&n.push(t.key),a()(a()({},t),{},{children:s})):null})).filter((function(e){return e}))}(e),keys:n}}),[e,t,r])}},98912:function(e,t,n){"use strict";n.r(t);var r=n(57213),a=n.n(r),i=n(54306),o=n.n(i),l=n(88265),s=n(63313),c=n(28756),u=n(60858),d=n(75310),p=n(24378),g=n(57229),h=n(15207),f=n(36035),m=n(82755),v=n(68793),Z=n(12417),b=n(3094),P=n(40141),y=n(21758),k=n(99120),x=n.n(k),w=n(11527),j=c.Z.Option;t.default=function(e){var t=e.treeData,n=e.currentNode,r=e.content,i=e.handleCancel,k=e.visible,S=(0,s.useState)(""),C=o()(S,2),_=C[0],q=C[1],E=(0,s.useState)("javascript"),I=o()(E,2),B=I[0],R=I[1],F=(0,s.useState)(),D=o()(F,2),N=D[0],T=D[1],M=(0,s.useState)(),A=o()(M,2),H=A[0],V=A[1],O=(0,s.useState)(!1),L=o()(O,2),W=L[0],U=L[1],K=(0,s.useState)(!1),z=o()(K,2),Q=z[0],X=z[1],Y=(0,s.useState)(""),G=o()(Y,2),$=G[0],J=G[1],ee=(0,b.F)().theme,te=(0,s.useRef)(null),ne=(0,s.useState)(!1),re=o()(ne,2),ae=re[0],ie=re[1],oe=(0,s.useState)(null),le=o()(oe,2),se=le[0],ce=le[1],ue=function(e){g.W.get("".concat(h.Z.apiPrefix,"scripts/detail?file=").concat(e.title,"&path=").concat(e.parent||"")).then((function(e){var t=e.code,n=e.data;200===t&&q(n)}))},de=function(){N&&N.title&&se&&g.W.put("".concat(h.Z.apiPrefix,"scripts/stop"),{filename:N.title,path:N.parent||"",pid:se}).then((function(e){var t=e.code;e.data;200===t&&ie(!1)}))},pe=(0,s.useCallback)((function(e){var t=e.message;(0,P.x$)(t)&&setTimeout((function(){ie(!1)}),300),J((function(e){return"".concat(e).concat(t)}))}),[]);return(0,s.useEffect)((function(){var e=y.Z.getInstance();return e.subscribe("manuallyRunScript",pe),function(){e.unsubscribe("manuallyRunScript",pe)}}),[]),(0,s.useEffect)((function(){if(J(""),n){T(n),q(r),V(n.key);var e=(0,P.H$)(n.title);R(e)}}),[r,n]),(0,w.jsxs)(u.Z,{className:"edit-modal",closable:!1,title:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d.Z,{treeExpandAction:"click",style:{marginRight:8,width:300},value:H,dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:t,placeholder:l.ZP.get("请选择脚本文件"),fieldNames:{value:"key",label:"title"},showSearch:!0,onSelect:function(e,t){if(t.key!==H&&e&&"directory"!==t.type){var n=(0,P.H$)(e);T(t),R(n),ue(t),V(t.key)}},treeLine:{showLeafIcon:!0}}),(0,w.jsxs)(c.Z,{value:B,style:{width:110,marginRight:8},onChange:function(e){R(e)},children:[(0,w.jsx)(j,{value:"javascript",children:"javascript"}),(0,w.jsx)(j,{value:"typescript",children:"typescript"}),(0,w.jsx)(j,{value:"shell",children:"shell"}),(0,w.jsx)(j,{value:"python",children:"python"})]}),(0,w.jsx)(p.Z,{type:"primary",style:{marginRight:8},onClick:ae?de:function(){J("");var e=te.current.getValue().replace(/\r\n/g,"\n");g.W.put("".concat(h.Z.apiPrefix,"scripts/run"),{filename:N.title,path:N.parent||"",content:e}).then((function(e){var t=e.code,n=e.data;200===t&&(ie(!0),ce(n))}))},children:ae?l.ZP.get("停止"):l.ZP.get("运行")}),(0,w.jsx)(p.Z,{type:"primary",style:{marginRight:8},onClick:function(){J("")},children:l.ZP.get("清空日志")}),(0,w.jsx)(p.Z,{type:"primary",style:{marginRight:8},onClick:function(){U(!0)},children:l.ZP.get("保存")}),(0,w.jsx)(p.Z,{type:"primary",style:{marginRight:8},onClick:function(){de(),i()},children:l.ZP.get("退出")})]}),width:"100%",headerStyle:{padding:"11px 24px"},onClose:function(){i()},open:k,children:[(0,w.jsxs)(f.Z,{split:"vertical",minSize:200,defaultSize:"50%",style:{height:"calc(100vh - 55px)"},pane2Style:{overflowY:"auto"},children:[(0,w.jsx)(m.ZP,{language:B,value:_,theme:ee,options:{fontSize:12,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1},onMount:function(e){te.current=e}}),(0,w.jsx)("pre",{style:{padding:"0 15px"},children:(0,w.jsx)(x(),{children:$})})]}),(0,w.jsx)(v.default,{visible:W,handleCancel:function(){U(!1)},file:a()({content:te.current&&te.current.getValue().replace(/\r\n/g,"\n")},N)}),(0,w.jsx)(Z.default,{visible:Q,handleCancel:function(){X(!1)}})]})}},85472:function(e,t,n){"use strict";n.r(t);var r=n(57213),a=n.n(r),i=n(54689),o=n.n(i),l=n(25359),s=n.n(l),c=n(49811),u=n.n(c),d=n(54306),p=n.n(d),g=n(88265),h=n(63313),f=n(28756),m=n(67393),v=n(9835),Z=n(84163),b=n(84468),P=n(22159),y=n(75310),k=n(57679),x=n(57229),w=n(15207),j=n(59953),S=n(11527);f.Z.Option;t.default=function(e){var t=e.handleCancel,n=e.treeData,r=e.visible,i=m.Z.useForm(),l=p()(i,1)[0],c=(0,h.useState)(!1),d=p()(c,2),f=d[0],C=d[1],_=(0,h.useState)([]),q=p()(_,2),E=q[0],I=q[1],B=(0,h.useState)(),R=p()(B,2),F=R[0],D=R[1],N=(0,h.useState)("blank"),T=p()(N,2),M=T[0],A=T[1],H=function(){var e=u()(s()().mark((function e(n){var r,a,i,o,l,c;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C(!0),r=n.path,a=void 0===r?"":r,i=n.filename,o=n.directory,l=void 0===o?"":o,(c=new FormData).append("file",F),c.append("filename",i),c.append("path",a),c.append("content",""),c.append("directory",l),x.W.post("".concat(w.Z.apiPrefix,"scripts"),c).then((function(e){var n=e.code;e.data;if(200===n){v.ZP.success(l?g.ZP.get("创建文件夹成功"):g.ZP.get("创建文件成功"));var r=a?"".concat(a,"/"):"",o=F?F.name:i;t({filename:o,path:a,key:"".concat(r).concat(o)})}C(!1)})).finally((function(){return C(!1)}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),V=function e(t){var n,r=o()(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.children&&i.children.length>0&&(i.children=i.children.filter((function(e){return"directory"===e.type})).map((function(e){return a()(a()({},e),{},{disabled:!1})})),e(i.children))}}catch(e){r.e(e)}finally{r.f()}return t};return(0,h.useEffect)((function(){var e=n.filter((function(e){return"directory"===e.type})).map((function(e){return a()(a()({},e),{},{disabled:!1})})),t=V(e);I(t)}),[n]),(0,h.useEffect)((function(){l.resetFields()}),[r]),(0,S.jsx)(Z.Z,{title:g.ZP.get("创建"),open:r,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){l.validateFields().then((function(e){H(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return t()},confirmLoading:f,children:(0,S.jsxs)(m.Z,{form:l,layout:"vertical",name:"edit_name_modal",children:[(0,S.jsx)(m.Z.Item,{name:"type",label:g.ZP.get("类型"),rules:[{required:!0}],initialValue:"blank",children:(0,S.jsxs)(b.ZP.Group,{onChange:function(e){A(e.target.value)},children:[(0,S.jsx)(b.ZP,{value:"blank",children:g.ZP.get("空文件")}),(0,S.jsx)(b.ZP,{value:"upload",children:g.ZP.get("本地文件")}),(0,S.jsx)(b.ZP,{value:"directory",children:g.ZP.get("文件夹")})]})}),"blank"===M&&(0,S.jsx)(m.Z.Item,{name:"filename",label:g.ZP.get("文件名"),rules:[{required:!0,message:g.ZP.get("请输入文件名")},{validator:function(e,t){return t.includes("/")?Promise.reject(new Error(g.ZP.get("文件名不能包含斜杠"))):Promise.resolve()}}],children:(0,S.jsx)(P.Z,{placeholder:g.ZP.get("请输入文件名")})}),"directory"===M&&(0,S.jsx)(m.Z.Item,{name:"directory",label:g.ZP.get("文件夹名"),rules:[{required:!0,message:g.ZP.get("请输入文件夹名")}],children:(0,S.jsx)(P.Z,{placeholder:g.ZP.get("请输入文件夹名")})}),(0,S.jsx)(m.Z.Item,{label:g.ZP.get("父目录"),name:"path",children:(0,S.jsx)(y.Z,{allowClear:!0,treeData:E,fieldNames:{value:"key",label:"title"},placeholder:g.ZP.get("请选择父目录"),treeDefaultExpandAll:!0})}),"upload"===M&&(0,S.jsx)(m.Z.Item,{label:g.ZP.get("文件"),name:"file",children:(0,S.jsxs)(k.Z.Dragger,{beforeUpload:function(e){return D(e),!1},maxCount:1,children:[(0,S.jsx)("p",{className:"ant-upload-drag-icon",children:(0,S.jsx)(j.Z,{})}),(0,S.jsx)("p",{className:"ant-upload-text",children:g.ZP.get("点击或者拖拽文件到此区域上传")})]})})]})})}},66553:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return z}});var r=n(93525),a=n.n(r),i=n(54306),o=n.n(i),l=n(88265),s=n(63313),c=n(92260),u=n(84163),d=n(9835),p=n(75310),g=n(34133),h=n(24378),f=n(15367),m=n(22159),v=n(43209),Z=n(84540),b=n(15207),P=n(23435),y=n(82755),k=n(57229),x={"left-tree-container":"left-tree-container___z9VeF","left-tree-scroller":"left-tree-scroller___MRc8C","log-container":"log-container___Iva4k"},w=n(98912),j=n(31988),S=n(36035),C=n(26839),_=n(32132),q=n(13740),E=n(23831),I=n(85472),B=n(66292),R=n.n(B),F=n(14851),D=n(43977),N=n(40141),T=n(51805),M=n(4363),A=n.n(M),H=n(38582),V=n(38359),O=n(26747),L=n(95407),W=n(79514),U=n(11527),K=c.Z.Text,z=function(){var e=(0,F.useOutletContext)(),t=e.headerStyle,n=e.isPhone,r=e.theme,i=(0,s.useState)(l.ZP.get("请选择脚本文件")),c=o()(i,2),B=c[0],M=c[1],z=(0,s.useState)(l.ZP.get("请选择脚本文件")),Q=o()(z,2),X=Q[0],Y=Q[1],G=(0,s.useState)([]),$=o()(G,2),J=$[0],ee=$[1],te=(0,s.useState)(!1),ne=o()(te,2),re=ne[0],ae=ne[1],ie=(0,s.useState)(""),oe=o()(ie,2),le=oe[0],se=oe[1],ce=(0,s.useState)(),ue=o()(ce,2),de=ue[0],pe=ue[1],ge=(0,s.useRef)(),he=(0,s.useState)(!1),fe=o()(he,2),me=fe[0],ve=fe[1],Ze=(0,s.useState)(""),be=o()(Ze,2),Pe=be[0],ye=be[1],ke=(0,s.useState)(!1),xe=o()(ke,2),we=xe[0],je=xe[1],Se=(0,s.useRef)(null),Ce=(0,s.useState)(!1),_e=o()(Ce,2),qe=_e[0],Ee=_e[1],Ie=(0,s.useState)(!1),Be=o()(Ie,2),Re=Be[0],Fe=Be[1],De=(0,s.useState)(),Ne=o()(De,2),Te=Ne[0],Me=Ne[1],Ae=(0,s.useState)([]),He=o()(Ae,2),Ve=He[0],Oe=He[1],Le=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e&&ae(!0),k.W.get("".concat(b.Z.apiPrefix,"scripts")).then((function(e){var t=e.code,n=e.data;200===t&&(ee(n),it(),Ue(n))})).finally((function(){return e&&ae(!1)}))},We=function(e){k.W.get("".concat(b.Z.apiPrefix,"scripts/detail?file=").concat(encodeURIComponent(e.title),"&path=").concat(e.parent||"")).then((function(e){var t=e.code,n=e.data;200===t&&M(n)}))},Ue=function(e){var t=(0,D.parse)(F.history.location.search),n=t.p,r=t.s;if(r){var a="".concat(n,"/").concat(r),i={node:{title:r,key:n?a:r,parent:n}};(0,N.DY)(e,(function(e){return e.key===i.node.key}))&&(Oe([n]),ze([a],i))}},Ke=function(e,t){if(Y(t.key),Me(t),t.key!==X&&e)if("directory"!==t.type){var r=(0,N.H$)(e);se(n&&"typescript"===r?"javascript":r),M(l.ZP.get("加载中...")),We(t)}else M(l.ZP.get("请选择脚本文件"))},ze=(0,s.useCallback)((function(e,t){t.node.key===X&&we||((Se.current?Se.current.getValue().replace(/\r\n/g,"\n"):B)!==B?u.Z.confirm({title:"确认离开",content:(0,U.jsx)(U.Fragment,{children:l.ZP.get("当前修改未保存,确定离开吗")}),onOk:function(){Ke(e[0],t.node),je(!1)},onCancel:function(){console.log("Cancel")}}):(je(!1),Ke(e[0],t.node)))}),[B,X,we]),Qe=(0,s.useCallback)((function(e){var t=e.target.value;Xe(t)}),[J]),Xe=(0,s.useCallback)(R()((function(e){ye(e)}),300),[J]),Ye=(0,T.Z)(J,Pe,{treeNodeFilterProp:"title"}),Ge=Ye.treeData,$e=Ye.keys;(0,s.useEffect)((function(){Oe(A()([].concat(a()(Ve),a()($e))))}),[$e]);var Je=function(){setTimeout((function(){je(!0)}),300)},et=function(){je(!1),M(l.ZP.get("加载中...")),We(Te)},tt=function(){u.Z.confirm({title:"确认保存",content:(0,U.jsxs)(U.Fragment,{children:[l.ZP.get("确认保存文件"),(0,U.jsx)(K,{style:{wordBreak:"break-all"},type:"warning",children:Te.title})," ",l.ZP.get(",保存后不可恢复")]}),onOk:function(){var e=Se.current?Se.current.getValue().replace(/\r\n/g,"\n"):B;return new Promise((function(t,n){k.W.put("".concat(b.Z.apiPrefix,"scripts"),{filename:Te.title,path:Te.parent||"",content:e}).then((function(n){var r=n.code;n.data;200===r&&(d.ZP.success("保存成功"),M(e),je(!1)),t(null)})).catch((function(e){return n(e)}))}))},onCancel:function(){console.log("Cancel")}})},nt=function(){u.Z.confirm({title:"确认删除",content:(0,U.jsxs)(U.Fragment,{children:[l.ZP.get("确认删除"),(0,U.jsx)(K,{style:{wordBreak:"break-all"},type:"warning",children:X}),l.ZP.get("文件"),"directory"===Te.type?l.ZP.get("夹及其子文件"):"",l.ZP.get(",删除后不可恢复")]}),onOk:function(){k.W.delete("".concat(b.Z.apiPrefix,"scripts"),{data:{filename:Te.title,path:Te.parent||"",type:Te.type}}).then((function(e){if(200===e.code){d.ZP.success("删除成功");var t=a()(J);if(Te.parent)t=(0,N.I1)(t,(function(e){return e.key===Te.key}));else{var n=t.findIndex((function(e){return e.key===Te.key}));-1!==n&&t.splice(n,1)}ee(t),it()}}))},onCancel:function(){console.log("Cancel")}})},rt=function(){Fe(!0)},at=function(){Ee(!0)},it=function(){Y(l.ZP.get("请选择脚本文件")),Me(null),M(l.ZP.get("请选择脚本文件"))};(0,s.useEffect)((function(){Le()}),[]),(0,s.useEffect)((function(){ge.current&&pe(ge.current.clientHeight)}),[ge.current,J]),(0,L.y1)("mod+s",(function(e){we&&tt()}),{enableOnFormTags:["textarea"],preventDefault:!0}),(0,L.y1)("mod+d",(function(e){Te.title&&nt()}),{preventDefault:!0}),(0,L.y1)("mod+o",(function(e){we||at()}),{preventDefault:!0}),(0,L.y1)("mod+e",(function(e){Te.title&&et()}),{preventDefault:!0});var ot=we?{items:[{label:l.ZP.get("保存"),key:"save",icon:(0,U.jsx)(C.Z,{})},{label:l.ZP.get("退出编辑"),key:"exit",icon:(0,U.jsx)(_.Z,{})}],onClick:function(e){var t=e.key;e.domEvent.stopPropagation(),function(e){switch(e){case"save":tt();break;case"exit":et()}}(t)}}:{items:[{label:l.ZP.get("创建"),key:"add",icon:(0,U.jsx)(C.Z,{})},{label:l.ZP.get("编辑"),key:"edit",icon:(0,U.jsx)(_.Z,{}),disabled:!X},{label:l.ZP.get("重命名"),key:"rename",icon:(0,U.jsx)(H.Z,{type:"ql-icon-rename"}),disabled:!X},{label:l.ZP.get("删除"),key:"delete",icon:(0,U.jsx)(q.Z,{}),disabled:!X}],onClick:function(e){var t=e.key;e.domEvent.stopPropagation(),function(e){switch(e){case"add":at();break;case"edit":Je();break;case"delete":nt();break;case"rename":rt()}}(t)}};return(0,U.jsx)(P.ZP,{className:"ql-container-wrapper log-wrapper",title:(0,U.jsxs)(U.Fragment,{children:[X,"file"===(null==Te?void 0:Te.type)&&(0,U.jsx)("span",{style:{marginLeft:6,fontSize:12,color:"#999",display:"inline-block",height:14},children:(0,W.Z)(Te.size)})]}),loading:re,extra:n?[(0,U.jsx)(p.Z,{treeExpandAction:"click",className:"log-select",value:X,dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:J,placeholder:l.ZP.get("请选择脚本"),fieldNames:{value:"key"},treeNodeFilterProp:"title",showSearch:!0,allowClear:!0,onSelect:Ke}),(0,U.jsx)(g.Z,{menu:ot,trigger:["click"],children:(0,U.jsx)(h.Z,{type:"primary",icon:(0,U.jsx)(E.Z,{})})})]:we?[(0,U.jsx)(h.Z,{type:"primary",onClick:tt,children:l.ZP.get("保存")}),(0,U.jsx)(h.Z,{type:"primary",onClick:et,children:l.ZP.get("退出编辑")})]:[(0,U.jsx)(f.Z,{title:l.ZP.get("创建"),children:(0,U.jsx)(h.Z,{type:"primary",onClick:at,icon:(0,U.jsx)(C.Z,{})})}),(0,U.jsx)(f.Z,{title:l.ZP.get("编辑"),children:(0,U.jsx)(h.Z,{disabled:!X,type:"primary",onClick:Je,icon:(0,U.jsx)(_.Z,{})})}),(0,U.jsx)(f.Z,{title:l.ZP.get("重命名"),children:(0,U.jsx)(h.Z,{disabled:!X,type:"primary",onClick:rt,icon:(0,U.jsx)(H.Z,{type:"ql-icon-rename"})})}),(0,U.jsx)(f.Z,{title:l.ZP.get("删除"),children:(0,U.jsx)(h.Z,{type:"primary",disabled:!X,onClick:nt,icon:(0,U.jsx)(q.Z,{})})}),(0,U.jsx)(h.Z,{type:"primary",onClick:function(){ve(!0)},children:l.ZP.get("调试")})],header:{style:t},children:(0,U.jsxs)("div",{className:"".concat(x["log-container"]," log-container"),children:[!n&&(0,U.jsxs)(S.Z,{split:"vertical",size:200,maxSize:-100,children:[(0,U.jsx)("div",{className:x["left-tree-container"],children:J.length>0?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(m.Z.Search,{className:x["left-tree-search"],onChange:Qe,placeholder:l.ZP.get("请输入脚本名"),allowClear:!0}),(0,U.jsx)("div",{className:x["left-tree-scroller"],ref:ge,children:(0,U.jsx)(v.Z,{expandAction:"click",className:x["left-tree"],treeData:Ge,showIcon:!0,height:de,selectedKeys:[X],expandedKeys:Ve,onExpand:function(e){Oe(e)},showLine:{showLeafIcon:!0},onSelect:ze,onDoubleClick:function(e,t){"file"===t.type&&(Y(t.key),Me(t),je(!0))}})})]}):(0,U.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,U.jsx)(Z.Z,{description:l.ZP.get("暂无脚本"),image:Z.Z.PRESENTED_IMAGE_SIMPLE})})}),(0,U.jsx)(y.ZP,{language:le,value:B,theme:r,options:{readOnly:!we,fontSize:12,lineNumbersMinChars:3,glyphMargin:!1},onMount:function(e){Se.current=e}})]}),n&&(0,U.jsx)(j.ZP,{value:B,extensions:le?[O.RI[le]()]:void 0,theme:r.includes("dark")?"dark":"light",readOnly:!we,onChange:function(e){M(e)}}),me&&(0,U.jsx)(w.default,{visible:me,treeData:J,currentNode:Te,content:B,handleCancel:function(){ve(!1)}}),(0,U.jsx)(I.default,{visible:qe,treeData:J,handleCancel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{filename:"",path:"",key:""},t=e.filename,n=e.path,r=e.key;if(t){var i=a()(J),o={title:t,key:r,parent:n};if(n){i=(0,N.I1)(i,(function(e){return e.key===n}),o);var l=n.split("/"),s=[];l.reduce((function(e,t){return s.push(e),"".concat(e,"/").concat(t)})),Oe([].concat(a()(Ve),s,[n]))}else i.unshift(o);ee(i),Ke(o.title,o),je(!0)}Ee(!1)}}),(0,U.jsx)(V.default,{visible:Re,handleCancel:function(){Fe(!1),Le(!1)},currentNode:Te})]})})}},38359:function(e,t,n){"use strict";n.r(t);var r=n(25359),a=n.n(r),i=n(49811),o=n.n(i),l=n(54306),s=n.n(l),c=n(88265),u=n(63313),d=n(67393),p=n(9835),g=n(84163),h=n(22159),f=n(57229),m=n(15207),v=n(11527);t.default=function(e){var t=e.currentNode,n=e.handleCancel,r=e.visible,i=d.Z.useForm(),l=s()(i,1)[0],Z=(0,u.useState)(!1),b=s()(Z,2),P=b[0],y=b[1],k=function(){var e=o()(a()().mark((function e(r){var i,o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.prev=1,e.next=4,f.W.put("".concat(m.Z.apiPrefix,"scripts/rename"),{filename:t.title,path:t.parent||"",newFilename:r.name});case 4:i=e.sent,o=i.code,i.data,200===o&&(p.ZP.success(c.ZP.get("更新名称成功")),n()),y(!1),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),y(!1);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}();return(0,u.useEffect)((function(){l.resetFields()}),[t,r]),(0,v.jsx)(g.Z,{title:c.ZP.get("重命名"),open:r,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,v.jsx)(d.Z,{form:l,initialValues:{name:null==t?void 0:t.title},layout:"vertical",name:"edit_name_modal",children:(0,v.jsx)(d.Z.Item,{name:"name",rules:[{required:!0,message:c.ZP.get("请输入新名称")}],children:(0,v.jsx)(h.Z,{placeholder:c.ZP.get("请输入新名称")})})})})}},68793:function(e,t,n){"use strict";n.r(t);var r=n(25359),a=n.n(r),i=n(57213),o=n.n(i),l=n(49811),s=n.n(l),c=n(54306),u=n.n(c),d=n(88265),p=n(63313),g=n(67393),h=n(9835),f=n(84163),m=n(22159),v=n(57229),Z=n(15207),b=n(11527);t.default=function(e){var t=e.file,n=e.handleCancel,r=e.visible,i=g.Z.useForm(),l=u()(i,1)[0],c=(0,p.useState)(!1),P=u()(c,2),y=P[0],k=P[1],x=function(){var e=s()(a()().mark((function e(r){var i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k(!0),i=o()(o()(o()({},t),r),{},{originFilename:t.title}),v.W.post("".concat(Z.Z.apiPrefix,"scripts"),i).then((function(e){var t=e.code,r=e.data;200===t&&(h.ZP.success(d.ZP.get("保存文件成功")),n(r))})).finally((function(){k(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,p.useEffect)((function(){l.resetFields(),k(!1)}),[t,r]),(0,b.jsx)(f.Z,{title:d.ZP.get("保存文件"),open:r,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){l.validateFields().then((function(e){x(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:y,children:(0,b.jsxs)(g.Z,{form:l,layout:"vertical",name:"script_modal",initialValues:{filename:null==t?void 0:t.title,path:(null==t?void 0:t.parent)||""},children:[(0,b.jsx)(g.Z.Item,{name:"filename",label:d.ZP.get("文件名"),rules:[{required:!0,message:d.ZP.get("请输入文件名")}],children:(0,b.jsx)(m.Z,{placeholder:d.ZP.get("请输入文件名")})}),(0,b.jsx)(g.Z.Item,{name:"path",label:d.ZP.get("保存目录"),children:(0,b.jsx)(m.Z,{placeholder:d.ZP.get("请输入保存目录,默认scripts目录")})})]})})}},12417:function(e,t,n){"use strict";n.r(t);n(25359),n(57213),n(49811);var r=n(54306),a=n.n(r),i=n(88265),o=n(63313),l=n(67393),s=(n(9835),n(84163)),c=n(22159),u=(n(57229),n(15207),n(11527));t.default=function(e){var t=e.file,n=e.handleCancel,r=e.visible,d=l.Z.useForm(),p=a()(d,1)[0],g=(0,o.useState)(!1),h=a()(g,2),f=(h[0],h[1]);return(0,o.useEffect)((function(){p.resetFields(),f(!1)}),[t,r]),(0,u.jsx)(s.Z,{title:i.ZP.get("运行设置"),open:r,forceRender:!0,centered:!0,onCancel:function(){return n()},children:(0,u.jsx)(l.Z,{form:p,layout:"vertical",name:"setting_modal",initialValues:t,children:(0,u.jsx)(l.Z.Item,{name:"filename",label:i.ZP.get("待开发"),rules:[{required:!0,message:i.ZP.get("待开发")}],children:(0,u.jsx)(c.Z,{placeholder:i.ZP.get("待开发")})})})})}},15207:function(e,t,n){"use strict";var r=n(88265),a=window.__ENV__QlBaseUrl||"/";t.Z={siteName:r.ZP.get("青龙"),baseUrl:a,apiPrefix:"".concat(a,"api/"),authKey:"token",layouts:[{name:"primary",include:[/.*/],exclude:[/(\/(en|zh))*\/login/]}],i18n:{languages:[{key:"pt-br",title:"Português",flag:"/portugal.svg"},{key:"en",title:"English",flag:"/america.svg"},{key:"zh",title:r.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:r.ZP.get("定时任务"),value:"crons"},{name:r.ZP.get("环境变量"),value:"envs"},{name:r.ZP.get("订阅管理"),value:"subscriptions"},{name:r.ZP.get("配置文件"),value:"configs"},{name:r.ZP.get("脚本管理"),value:"scripts"},{name:r.ZP.get("日志管理"),value:"logs"},{name:r.ZP.get("依赖管理"),value:"dependencies"},{name:r.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:r.ZP.get("定时任务"),envs:r.ZP.get("环境变量"),subscriptions:r.ZP.get("订阅管理"),configs:r.ZP.get("配置文件"),scripts:r.ZP.get("脚本管理"),logs:r.ZP.get("日志管理"),dependencies:r.ZP.get("依赖管理"),system:r.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:r.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:r.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:r.ZP.get("钉钉机器人")},{value:"weWorkBot",label:r.ZP.get("企业微信机器人")},{value:"weWorkApp",label:r.ZP.get("企业微信应用")},{value:"aibotk",label:r.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"chat",label:r.ZP.get("群晖chat")},{value:"email",label:r.ZP.get("邮箱")},{value:"lark",label:r.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:r.ZP.get("自定义通知")},{value:"closed",label:r.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:r.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:r.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:r.ZP.get("推送消息的优先级")}],chat:[{label:"chatUrl",tip:r.ZP.get("chat的url地址"),required:!0},{label:"chatToken",tip:r.ZP.get("chat的token码"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:r.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:r.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:r.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:r.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:r.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:r.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:r.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:r.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:r.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:r.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:r.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:r.ZP.get("BARK推送消息的跳转URL")}],telegramBot:[{label:"telegramBotToken",tip:r.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:r.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:r.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:r.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:r.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:r.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:r.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:r.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:r.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:r.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:r.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:r.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:r.ZP.get("请输入要发送的目标"),items:[{value:"room",label:r.ZP.get("群聊")},{value:"contact",label:r.ZP.get("好友")}]},{label:"aibotkName",tip:r.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:r.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:r.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:r.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")}],lark:[{label:"larkKey",tip:r.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:r.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:r.ZP.get("邮箱地址"),required:!0},{label:"emailPass",tip:r.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0}],pushMe:[{label:"pushMeKey",tip:r.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0}],chronocat:[{label:"chronocatURL",tip:r.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:r.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:r.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:r.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:r.ZP.get("请求头Content-Type"),required:!0,items:[{value:"text/plain"},{value:"application/json"},{value:"multipart/form-data"},{value:"application/x-www-form-urlencoded"}]},{label:"webhookUrl",tip:r.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:r.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:r.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":r.ZP.get("登录"),"/initialization":r.ZP.get("初始化"),"/crontab":r.ZP.get("定时任务"),"/env":r.ZP.get("环境变量"),"/subscription":r.ZP.get("订阅管理"),"/config":r.ZP.get("配置文件"),"/script":r.ZP.get("脚本管理"),"/diff":r.ZP.get("对比工具"),"/log":r.ZP.get("日志管理"),"/setting":r.ZP.get("系统设置"),"/error":r.ZP.get("错误日志"),"/dependence":r.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},3094:function(e,t,n){"use strict";n.d(t,{F:function(){return s},e:function(){return l}});var r=n(54306),a=n.n(r),i=n(63313),o=n(40141),l=function(){var e=(0,i.useState)("100%"),t=a()(e,2),n=t[0],r=t[1],l=(0,i.useState)(0),s=a()(l,2),c=s[0],u=s[1],d=(0,i.useState)(-48),p=a()(d,2),g=p[0],h=p[1],f=(0,i.useState)(!1),m=a()(f,2),v=m[0],Z=m[1],b=(0,i.useMemo)((function(){return(0,o.ZP)()}),[]).platform;return(0,i.useEffect)((function(){"mobile"===b&&document.body.offsetWidth<768?(r("auto"),u(0),h(0),Z(!0),document.body.setAttribute("data-mode","phone")):(r("100%"),u(0),h(-48),Z(!1),document.body.setAttribute("data-mode","desktop"))}),[]),{headerStyle:{padding:"4px 16px 4px 15px",position:"sticky",top:0,left:0,zIndex:20,marginTop:g,width:n,marginLeft:c},isPhone:v}},s=function(){var e=(0,i.useState)(),t=a()(e,2),n=t[0],r=t[1];return(0,i.useEffect)((function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;r(n?"vs-dark":"vs");var a=function(e){"auto"!==t&&t||(e.matches?r("vs-dark"):r("vs"))};"function"==typeof e.addEventListener?e.addEventListener("change",a):"function"==typeof e.addListener&&e.addListener(a)}),[]),{theme:n,reloadTheme:function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;r(n?"vs-dark":"vs")}}}},57229:function(e,t,n){"use strict";n.d(t,{W:function(){return f}});var r=n(25359),a=n.n(r),i=n(49811),o=n.n(i),l=n(88265),s=n(9835),c=n(15207),u=n(14851),d=n(73669);s.ZP.config({duration:2});var p=Date.now(),g=d.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"];g.interceptors.request.use((function(e){var t=localStorage.getItem(c.Z.authKey);return t&&!h.includes(e.url)?(e.headers.Authorization="Bearer ".concat(t),e):e})),g.interceptors.response.use(function(){var e=o()(a()().mark((function e(t){var n,r,i;return a()().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!==(r=t.data).code&&(i=r.message||r.data)&&s.ZP.error({content:i,style:{maxWidth:500,margin:"0 auto"}}),e.abrupt("return",r);case 15:e.prev=15,e.t0=e.catch(9);case 17:case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,null,[[9,15]])})));return function(t){return e.apply(this,arguments)}}(),(function(e){if(e.response){var t=e.response.data?e.response.data.message||e.message||e.response.data:e.response.statusText,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 f=g},40141:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},I1:function(){return p},w7:function(){return d},DY:function(){return g},FA:function(){return f},rS:function(){return v},H$:function(){return Z},W9:function(){return u},x$:function(){return h}});var r=n(93525),a=n.n(r),i=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,".")},r="unknow";t(/windows|win32|win64|wow32|wow64/g)?r="windows":t(/macintosh|macintel/g)?r="macos":t(/x11/g)?r="linux":t(/android|adr/g)?r="android":t(/ios|iphone|ipad|ipod|iwatch/g)&&(r="ios");var a="unknow";"windows"===r?t(/windows nt 5.0|windows 2000/g)?a="2000":t(/windows nt 5.1|windows xp/g)?a="xp":t(/windows nt 5.2|windows 2003/g)?a="2003":t(/windows nt 6.0|windows vista/g)?a="vista":t(/windows nt 6.1|windows 7/g)?a="7":t(/windows nt 6.2|windows 8/g)?a="8":t(/windows nt 6.3|windows 8.1/g)?a="8.1":t(/windows nt 10.0|windows 10/g)&&(a="10"):"macos"===r?a=n(/os x [\d._]+/g):"android"===r?a=n(/android [\d._]+/g):"ios"===r&&(a=n(/os [\d._]+/g));var i="unknow";"windows"===r||"macos"===r||"linux"===r?i="desktop":("android"===r||"ios"===r||t(/mobile/g))&&(i="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 p=Object.assign({engine:o,engineVs:s,platform:i,supporter:l,supporterVs:c,system:r,systemVs:a},"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(p.system,"/").concat(p.systemVs,"\n浏览器:").concat(p.supporter,"/").concat(p.supporterVs,"\n内核:").concat(p.engine,"/").concat(p.engineVs),"color: green;font-size: 14px;font-weight: bold;"),p}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 r=null,a=0;(r=n||document.querySelector(".ant-table-wrapper"))&&(a=r.getBoundingClientRect().top);var i=document.body.clientHeight-a-t;return i}function d(e,t){var n,r,a=window.URL||window.webkitURL||window,i=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=a.createObjectURL(i),o.download=e,n=o,(r=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)}function p(e,t,n){var r=a()(e),i=[];return function e(r){if(r)for(var a=0;a<(null==r?void 0:r.length);a++){if(t(r[a]))return n?void(r[a].children?r[a].children.unshift(n):r[a].children=[n]):void r.splice(a,1);r[a].children&&(i.push(r[a].key),e(r[a].children))}}(r),r}function g(e,t){var n;return function e(r){if(r)for(var a=0;a<(null==r?void 0:r.length);a++)t(r[a])?n=r[a]:r[a].children&&e(r[a].children)}(a()(e)),n}function h(e){return["     ",i.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 r,a;n.startsWith("/ql/data/scripts")&&(n=n.replace("/ql/data/scripts/",""));var i=n.lastIndexOf("/");return i>=0?(a=n.slice(i+1),r=n.slice(0,i)):(a=n,r=""),[a,r]}}function m(e){try{var t=s().parseExpression(e);if(t)return t.next().toDate()}catch(e){}return null}function v(e,t){var n=m(e);return null!=t&&t.length&&t.forEach((function(e){var t=m(e);t&&(!n||t<n)&&(n=t)})),n}function Z(e){var t=function(e){if(!e)return"";var t=e.split(".");return".".concat(t[t.length-1])}(e);return o[t]}},21758:function(e,t,n){"use strict";var r=n(93525),a=n.n(r),i=n(12342),o=n.n(i),l=n(25359),s=n.n(l),c=n(49811),u=n.n(c),d=n(21140),p=n.n(d),g=n(63466),h=n.n(g),f=n(52510),m=n.n(f),v=n(78078),Z=n.n(v),b=["type"],P=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p()(this,e),m()(this,"url",void 0),m()(this,"socket",null),m()(this,"subscriptions",new Map),m()(this,"options",void 0),m()(this,"reconnectAttempts",0),m()(this,"heartbeatTimeout",null),m()(this,"state","closed"),this.url=t,this.options={maxReconnectAttempts:n.maxReconnectAttempts||5,reconnectInterval:n.reconnectInterval||3e3,heartbeatInterval:n.heartbeatInterval||3e4},this.init()}var t,n;return h()(e,[{key:"init",value:(n=u()(s()().mark((function e(){var t=this;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.state="connecting",this.emit("connecting");case 3:if(!(this.reconnectAttempts<this.options.maxReconnectAttempts)){e.next=16;break}return this.socket=new(Z())(this.url),this.setupEventListeners(),this.startHeartbeat(),e.next=9,this.waitForClose();case 9:return this.stopHeartbeat(),this.socket=null,this.reconnectAttempts++,e.next=14,new Promise((function(e){return setTimeout(e,t.options.reconnectInterval)}));case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this.handleError(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(){return n.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.socket&&(this.socket.onopen=function(){e.state="open",e.emit("open")},this.socket.onmessage=function(t){var n=JSON.parse(t.data);e.dispatchMessage(n)},this.socket.onclose=function(){e.state="closed",e.emit("close")})}},{key:"waitForClose",value:(t=u()(s()().mark((function e(){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null===(t=this.socket)||void 0===t?void 0:t.readyState)===Z().CLOSED){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,100)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"subscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(!n.has(t)){n.add(t),this.subscriptions.set(e,n);var r={action:"subscribe",topic:e};this.send(r)}}},{key:"unsubscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(n.has(t)){n.delete(t);var r={action:"unsubscribe",topic:e};this.send(r)}}},{key:"send",value:function(e){var t;(null===(t=this.socket)||void 0===t?void 0:t.readyState)===Z().OPEN&&this.socket.send(JSON.stringify(e))}},{key:"dispatchMessage",value:function(e){var t=e.type,n=o()(e,b),r=this.subscriptions.get(t)||new Set;a()(r).forEach((function(e){return e(n)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatTimeout=setInterval((function(){var t;(null===(t=e.socket)||void 0===t?void 0:t.readyState)===Z().OPEN&&e.socket.send(JSON.stringify({type:"heartbeat"}))}),this.options.heartbeatInterval)}},{key:"stopHeartbeat",value:function(){this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout)}},{key:"close",value:function(){this.socket&&(this.state="closed",this.stopHeartbeat(),this.socket.close(),this.emit("close"))}},{key:"handleError",value:function(e){console.error("WebSocket错误:",e),this.emit("error",e)}},{key:"on",value:function(e,t){}},{key:"emit",value:function(e,t){}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return e.instance||(e.instance=new e(t,n)),e.instance}}]),e}();m()(P,"instance",null),t.Z=P},38433:function(){}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[9064],{38359:function(e,t,a){a.r(t);var r=a(25359),l=a.n(r),i=a(49811),o=a.n(i),n=a(54306),s=a.n(n),u=a(88265),p=a(63313),g=a(67393),c=a(9835),d=a(84163),P=a(22159),h=a(57229),b=a(15207),Z=a(11527);t.default=function(e){var t=e.currentNode,a=e.handleCancel,r=e.visible,i=g.Z.useForm(),n=s()(i,1)[0],m=(0,p.useState)(!1),k=s()(m,2),v=k[0],f=k[1],y=function(){var e=o()(l()().mark((function e(r){var i,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,h.W.put("".concat(b.Z.apiPrefix,"scripts/rename"),{filename:t.title,path:t.parent||"",newFilename:r.name});case 4:i=e.sent,o=i.code,i.data,200===o&&(c.ZP.success(u.ZP.get("更新名称成功")),a()),f(!1),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),f(!1);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}();return(0,p.useEffect)((function(){n.resetFields()}),[t,r]),(0,Z.jsx)(d.Z,{title:u.ZP.get("重命名"),open:r,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){n.validateFields().then((function(e){y(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return a()},confirmLoading:v,children:(0,Z.jsx)(g.Z,{form:n,initialValues:{name:null==t?void 0:t.title},layout:"vertical",name:"edit_name_modal",children:(0,Z.jsx)(g.Z.Item,{name:"name",rules:[{required:!0,message:u.ZP.get("请输入新名称")}],children:(0,Z.jsx)(P.Z,{placeholder:u.ZP.get("请输入新名称")})})})})}},15207:function(e,t,a){var r=a(88265),l=window.__ENV__QlBaseUrl||"/";t.Z={siteName:r.ZP.get("青龙"),baseUrl:l,apiPrefix:"".concat(l,"api/"),authKey:"token",layouts:[{name:"primary",include:[/.*/],exclude:[/(\/(en|zh))*\/login/]}],i18n:{languages:[{key:"pt-br",title:"Português",flag:"/portugal.svg"},{key:"en",title:"English",flag:"/america.svg"},{key:"zh",title:r.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:r.ZP.get("定时任务"),value:"crons"},{name:r.ZP.get("环境变量"),value:"envs"},{name:r.ZP.get("订阅管理"),value:"subscriptions"},{name:r.ZP.get("配置文件"),value:"configs"},{name:r.ZP.get("脚本管理"),value:"scripts"},{name:r.ZP.get("日志管理"),value:"logs"},{name:r.ZP.get("依赖管理"),value:"dependencies"},{name:r.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:r.ZP.get("定时任务"),envs:r.ZP.get("环境变量"),subscriptions:r.ZP.get("订阅管理"),configs:r.ZP.get("配置文件"),scripts:r.ZP.get("脚本管理"),logs:r.ZP.get("日志管理"),dependencies:r.ZP.get("依赖管理"),system:r.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:r.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:r.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:r.ZP.get("钉钉机器人")},{value:"weWorkBot",label:r.ZP.get("企业微信机器人")},{value:"weWorkApp",label:r.ZP.get("企业微信应用")},{value:"aibotk",label:r.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"chat",label:r.ZP.get("群晖chat")},{value:"email",label:r.ZP.get("邮箱")},{value:"lark",label:r.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:r.ZP.get("自定义通知")},{value:"closed",label:r.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:r.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:r.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:r.ZP.get("推送消息的优先级")}],chat:[{label:"chatUrl",tip:r.ZP.get("chat的url地址"),required:!0},{label:"chatToken",tip:r.ZP.get("chat的token码"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:r.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:r.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:r.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:r.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:r.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:r.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:r.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:r.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:r.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:r.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:r.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:r.ZP.get("BARK推送消息的跳转URL")}],telegramBot:[{label:"telegramBotToken",tip:r.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:r.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:r.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:r.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:r.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:r.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:r.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:r.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:r.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:r.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:r.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:r.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:r.ZP.get("请输入要发送的目标"),items:[{value:"room",label:r.ZP.get("群聊")},{value:"contact",label:r.ZP.get("好友")}]},{label:"aibotkName",tip:r.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:r.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:r.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:r.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")}],lark:[{label:"larkKey",tip:r.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:r.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:r.ZP.get("邮箱地址"),required:!0},{label:"emailPass",tip:r.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0}],pushMe:[{label:"pushMeKey",tip:r.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0}],chronocat:[{label:"chronocatURL",tip:r.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:r.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:r.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:r.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:r.ZP.get("请求头Content-Type"),required:!0,items:[{value:"text/plain"},{value:"application/json"},{value:"multipart/form-data"},{value:"application/x-www-form-urlencoded"}]},{label:"webhookUrl",tip:r.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:r.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:r.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":r.ZP.get("登录"),"/initialization":r.ZP.get("初始化"),"/crontab":r.ZP.get("定时任务"),"/env":r.ZP.get("环境变量"),"/subscription":r.ZP.get("订阅管理"),"/config":r.ZP.get("配置文件"),"/script":r.ZP.get("脚本管理"),"/diff":r.ZP.get("对比工具"),"/log":r.ZP.get("日志管理"),"/setting":r.ZP.get("系统设置"),"/error":r.ZP.get("错误日志"),"/dependence":r.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},57229:function(e,t,a){a.d(t,{W:function(){return h}});var r=a(25359),l=a.n(r),i=a(49811),o=a.n(i),n=a(88265),s=a(9835),u=a(15207),p=a(14851),g=a(73669);s.ZP.config({duration:2});var c=Date.now(),d=g.Z.create({timeout:6e4,params:{t:c}}),P=["/api/user/login","/open/auth/token","/api/user/two-factor/login","/api/system","/api/user/init","/api/user/notification/init"];d.interceptors.request.use((function(e){var t=localStorage.getItem(u.Z.authKey);return t&&!P.includes(e.url)?(e.headers.Authorization="Bearer ".concat(t),e):e})),d.interceptors.response.use(function(){var e=o()(l()().mark((function e(t){var a,r,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.status,![502,504].includes(a)){e.next=5;break}p.history.push("/error"),e.next=18;break;case 5:if(401!==a){e.next=9;break}"/login"!==p.history.location.pathname&&(localStorage.removeItem(u.Z.authKey),p.history.push("/login")),e.next=18;break;case 9:return e.prev=9,200!==(r=t.data).code&&(i=r.message||r.data)&&s.ZP.error({content:i,style:{maxWidth:500,margin:"0 auto"}}),e.abrupt("return",r);case 15:e.prev=15,e.t0=e.catch(9);case 17:case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,null,[[9,15]])})));return function(t){return e.apply(this,arguments)}}(),(function(e){if(e.response){var t=e.response.data?e.response.data.message||e.message||e.response.data:e.response.statusText,a=e.response.status;[502,504].includes(a)?p.history.push("/error"):401===a?"/login"!==p.history.location.pathname&&(s.ZP.error(n.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(u.Z.authKey),p.history.push("/login")):s.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}else console.log(e.message);return Promise.reject(e)}));var h=d}}]);