@whyour/qinglong 2.17.13 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -2
- package/sample/notify.js +47 -30
- package/sample/notify.py +36 -53
- package/shell/api.sh +26 -0
- package/shell/preload/sitecustomize.js +7 -1
- package/shell/preload/sitecustomize.py +9 -1
- package/shell/share.sh +3 -7
- package/shell/task.sh +1 -1
- package/shell/update.sh +2 -6
- package/static/build/api/config.js +2 -1
- package/static/build/api/script.js +4 -3
- package/static/build/api/system.js +16 -1
- package/static/build/api/user.js +1 -1
- package/static/build/config/util.js +10 -3
- package/static/build/data/system.js +1 -0
- package/static/build/loaders/express.js +8 -11
- package/static/build/loaders/initData.js +41 -5
- package/static/build/loaders/initFile.js +74 -76
- package/static/build/loaders/sock.js +4 -5
- package/static/build/services/cron.js +2 -1
- package/static/build/services/dependence.js +16 -7
- package/static/build/services/env.js +4 -27
- package/static/build/services/open.js +16 -14
- package/static/build/services/sshKey.js +5 -6
- package/static/build/services/system.js +15 -3
- package/static/build/services/user.js +116 -161
- package/static/build/shared/store.js +32 -0
- package/static/build/shared/utils.js +27 -0
- package/static/build/token.js +2 -6
- package/static/dist/{4642.260d2a8e.async.js → 4642.9e24d86c.async.js} +1 -1
- package/static/dist/4799.d5ca9f30.async.js +1 -0
- package/static/dist/index.html +2 -2
- package/static/dist/{preload_helper.2e4c8e3f.js → preload_helper.55b35ae0.js} +1 -1
- package/static/dist/{src__pages__crontab__index.7163c445.async.js → src__pages__crontab__index.55a8714d.async.js} +1 -1
- package/static/dist/{src__pages__script__index.b893a14e.async.js → src__pages__script__index.6a212c2d.async.js} +1 -1
- package/static/dist/{src__pages__setting__index.636a04c7.async.js → src__pages__setting__index.ffa1cdd6.async.js} +1 -1
- package/static/dist/{umi.916b40e1.js → umi.fb3ed7a0.js} +1 -1
- package/version.yaml +7 -8
- package/static/dist/4799.2c2c56e5.async.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[6534,9064,8673,440,4642],{55426:function(e,t,n){"use strict";var r=(0,n(19919).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_lc939gab1iq.js"]});t.Z=r},69139:function(e,t,n){"use strict";var r=n(26068),i=n.n(r),a=n(75271);t.Z=function(e,t,n){var r=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[r];return String(n).toUpperCase().includes(a)}return{treeData:function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.map((function(t){var a=t.children,l=r||o(0,t),s=e(a||[],l);return l||s.length?(s.length&&n.push(t.key),i()(i()({},t),{},{children:s})):null})).filter((function(e){return e}))}(e),keys:n}}),[e,t,r])}},9509:function(e,t,n){"use strict";n.r(t);var r=n(26068),i=n.n(r),a=n(48305),o=n.n(a),l=n(72317),s=n(75271),c=n(35181),u=n(53390),d=n(88142),p=n(93481),g=n(94978),h=n(20710),f=n(43382),m=n(83383),v=n(62632),Z=n(29280),P=n(31306),b=n(65609),y=n(69325),x=n(78060),k=n.n(x),w=n(52676),j=c.Z.Option;t.default=function(e){var t=e.treeData,n=e.currentNode,r=e.content,a=e.handleCancel,x=e.visible,S=(0,s.useState)(""),C=o()(S,2),_=C[0],q=C[1],E=(0,s.useState)(),B=o()(E,2),I=B[0],R=B[1],T=(0,s.useState)(),D=o()(T,2),N=D[0],F=D[1],A=(0,s.useState)(),M=o()(A,2),V=M[0],H=M[1],U=(0,s.useState)(!1),L=o()(U,2),O=L[0],W=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,P.F)().theme,te=(0,s.useRef)(null),ne=(0,s.useState)(!1),re=o()(ne,2),ie=re[0],ae=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&&ae(!1)}))},pe=(0,s.useCallback)((function(e){var t=e.message;(0,b.x$)(t)&&setTimeout((function(){ae(!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){F(n),q(r),H(n.key);var e=(0,b.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:V,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!==V&&e&&"directory"!==t.type){var n=(0,b.H$)(e);F(t),R(n),ue(t),H(t.key)}},treeLine:{showLeafIcon:!0}}),(0,w.jsxs)(c.Z,{value:I,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:ie?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&&(ae(!0),ce(n))}))},children:ie?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(){W(!0)},children:l.ZP.get("保存")}),(0,w.jsx)(p.Z,{type:"primary",style:{marginRight:8},onClick:function(){de(),a()},children:l.ZP.get("退出")})]}),width:"100%",headerStyle:{padding:"11px 24px"},onClose:function(){a()},open:x,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:I,value:_,theme:ee,options:{fontSize:12,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1,accessibilitySupport:"off"},onMount:function(e){te.current=e}}),(0,w.jsx)("pre",{style:{padding:"0 15px"},children:(0,w.jsx)(k(),{children:$})})]}),(0,w.jsx)(v.default,{visible:O,handleCancel:function(){W(!1)},file:i()({content:te.current&&te.current.getValue().replace(/\r\n/g,"\n")},N)}),(0,w.jsx)(Z.default,{visible:Q,handleCancel:function(){X(!1)}})]})}},18537:function(e,t,n){"use strict";n.r(t);var r=n(26068),i=n.n(r),a=n(335),o=n.n(a),l=n(90228),s=n.n(l),c=n(87999),u=n.n(c),d=n(48305),p=n.n(d),g=n(72317),h=n(75271),f=n(35181),m=n(72338),v=n(61508),Z=n(45520),P=n(94747),b=n(17082),y=n(88142),x=n(6367),k=n(94978),w=n(20710),j=n(79231),S=n(52676);f.Z.Option;t.default=function(e){var t=e.handleCancel,n=e.treeData,r=e.visible,a=m.Z.useForm(),l=p()(a,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],B=q[1],I=(0,h.useState)(),R=p()(I,2),T=R[0],D=R[1],N=(0,h.useState)("blank"),F=p()(N,2),A=F[0],M=F[1],V=function(){var e=u()(s()().mark((function e(n){var r,i,a,o,l,c;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C(!0),r=n.path,i=void 0===r?"":r,a=n.filename,o=n.directory,l=void 0===o?"":o,(c=new FormData).append("file",T||""),c.append("filename",(null==T?void 0:T.name)||a),c.append("path",i),c.append("content",""),c.append("directory",l),k.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=i?"".concat(i,"/"):"",o=T?T.name:a;t({filename:o,path:i,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)}}(),H=function e(t){var n,r=o()(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;a.children&&a.children.length>0&&(a.children=a.children.filter((function(e){return"directory"===e.type})).map((function(e){return i()(i()({},e),{},{disabled:!1})})),e(a.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 i()(i()({},e),{},{disabled:!1})})),t=H(e);B(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){V(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)(P.ZP.Group,{onChange:function(e){M(e.target.value)},children:[(0,S.jsx)(P.ZP,{value:"blank",children:g.ZP.get("空文件")}),(0,S.jsx)(P.ZP,{value:"upload",children:g.ZP.get("本地文件")}),(0,S.jsx)(P.ZP,{value:"directory",children:g.ZP.get("文件夹")})]})}),"blank"===A&&(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)(b.Z,{placeholder:g.ZP.get("请输入文件名")})}),"directory"===A&&(0,S.jsx)(m.Z.Item,{name:"directory",label:g.ZP.get("文件夹名"),rules:[{required:!0,message:g.ZP.get("请输入文件夹名")}],children:(0,S.jsx)(b.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"===A&&(0,S.jsx)(m.Z.Item,{label:g.ZP.get("文件"),name:"file",children:(0,S.jsxs)(x.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("点击或者拖拽文件到此区域上传")})]})})]})})}},40097:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return z}});var r=n(15558),i=n.n(r),a=n(48305),o=n.n(a),l=n(72317),s=n(75271),c=n(50691),u=n(45520),d=n(61508),p=n(88142),g=n(85950),h=n(93481),f=n(59816),m=n(17082),v=n(13107),Z=n(98705),P=n(20710),b=n(40872),y=n(83383),x=n(94978),k={"left-tree-container":"left-tree-container___z9VeF","left-tree-scroller":"left-tree-scroller___MRc8C","log-container":"log-container___Iva4k"},w=n(9509),j=n(71742),S=n(43382),C=n(21288),_=n(28423),q=n(88939),E=n(97953),B=n(18537),I=n(66292),R=n.n(I),T=n(31038),D=n(748),N=n(65609),F=n(69139),A=n(4363),M=n.n(A),V=n(55426),H=n(43946),U=n(82904),L=n(28837),O=n(79514),W=n(52676),K=c.Z.Text,z=function(){var e=(0,T.useOutletContext)(),t=e.headerStyle,n=e.isPhone,r=e.theme,a=(0,s.useState)(l.ZP.get("请选择脚本文件")),c=o()(a,2),I=c[0],A=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],ie=ne[1],ae=(0,s.useState)(""),oe=o()(ae,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)(""),Pe=o()(Ze,2),be=Pe[0],ye=Pe[1],xe=(0,s.useState)(!1),ke=o()(xe,2),we=ke[0],je=ke[1],Se=(0,s.useRef)(null),Ce=(0,s.useState)(!1),_e=o()(Ce,2),qe=_e[0],Ee=_e[1],Be=(0,s.useState)(!1),Ie=o()(Be,2),Re=Ie[0],Te=Ie[1],De=(0,s.useState)(),Ne=o()(De,2),Fe=Ne[0],Ae=Ne[1],Me=(0,s.useState)([]),Ve=o()(Me,2),He=Ve[0],Ue=Ve[1],Le=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e&&ie(!0),x.W.get("".concat(P.Z.apiPrefix,"scripts")).then((function(e){var t=e.code,n=e.data;200===t&&(ee(n),at(),We(n))})).finally((function(){return e&&ie(!1)}))},Oe=function(e){x.W.get("".concat(P.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&&A(n)}))},We=function(e){var t=(0,D.parse)(T.history.location.search),n=t.p,r=t.s;if(r){var i="".concat(n,"/").concat(r),a={node:{title:r,key:n?i:r,parent:n}},o=(0,N.DY)(e,(function(e){return e.key===a.node.key}));o&&(a.node=o,Ue([n]),ze([i],a))}},Ke=function(e,t){if(t.key!==X&&e)if(Y(t.key),Ae(t),"directory"!==t.type){var r=(0,N.H$)(e);se(n&&"typescript"===r?"javascript":r),A(l.ZP.get("加载中...")),Oe(t)}else A(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"):I)!==I?u.Z.confirm({title:"确认离开",content:(0,W.jsx)(W.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)))}),[I,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,F.Z)(J,be,{treeNodeFilterProp:"title"}),Ge=Ye.treeData,$e=Ye.keys;(0,s.useEffect)((function(){Ue(M()([].concat(i()(He),i()($e))))}),[$e]);var Je=function(){setTimeout((function(){je(!0)}),300)},et=function(){je(!1),A(l.ZP.get("加载中...")),Oe(Fe)},tt=function(){u.Z.confirm({title:"确认保存",content:(0,W.jsxs)(W.Fragment,{children:[l.ZP.get("确认保存文件"),(0,W.jsxs)(K,{style:{wordBreak:"break-all"},type:"warning",children:[" ",Fe.title]}),l.ZP.get(",保存后不可恢复")]}),onOk:function(){var e=Se.current?Se.current.getValue().replace(/\r\n/g,"\n"):I;return new Promise((function(t,n){x.W.put("".concat(P.Z.apiPrefix,"scripts"),{filename:Fe.title,path:Fe.parent||"",content:e}).then((function(n){var r=n.code;n.data;200===r&&(d.ZP.success("保存成功"),A(e),je(!1)),t(null)})).catch((function(e){return n(e)}))}))},onCancel:function(){console.log("Cancel")}})},nt=function(){u.Z.confirm({title:"确认删除",content:(0,W.jsxs)(W.Fragment,{children:[l.ZP.get("确认删除"),(0,W.jsxs)(K,{style:{wordBreak:"break-all"},type:"warning",children:[" ",X," "]}),l.ZP.get("文件"),"directory"===Fe.type?l.ZP.get("夹及其子文件"):"",l.ZP.get(",删除后不可恢复")]}),onOk:function(){x.W.delete("".concat(P.Z.apiPrefix,"scripts"),{data:{filename:Fe.title,path:Fe.parent||"",type:Fe.type}}).then((function(e){if(200===e.code){d.ZP.success("删除成功");var t=i()(J);if(Fe.parent)t=(0,N.I1)(t,(function(e){return e.key===Fe.key}));else{var n=t.findIndex((function(e){return e.key===Fe.key}));-1!==n&&t.splice(n,1)}ee(t),at()}}))},onCancel:function(){console.log("Cancel")}})},rt=function(){Te(!0)},it=function(){Ee(!0)},at=function(){Y(l.ZP.get("请选择脚本文件")),Ae(null),A(l.ZP.get("请选择脚本文件"))};(0,s.useEffect)((function(){Le()}),[]),(0,s.useEffect)((function(){ge.current&&pe(ge.current.clientHeight-6)}),[ge.current,J]),(0,L.y1)("mod+s",(function(e){we&&tt()}),{enableOnFormTags:["textarea"],preventDefault:!0}),(0,L.y1)("mod+d",(function(e){Fe.title&&nt()}),{preventDefault:!0}),(0,L.y1)("mod+o",(function(e){we||it()}),{preventDefault:!0}),(0,L.y1)("mod+e",(function(e){Fe.title&&et()}),{preventDefault:!0});var ot=we?{items:[{label:l.ZP.get("保存"),key:"save",icon:(0,W.jsx)(C.Z,{})},{label:l.ZP.get("退出编辑"),key:"exit",icon:(0,W.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,W.jsx)(C.Z,{})},{label:l.ZP.get("编辑"),key:"edit",icon:(0,W.jsx)(_.Z,{}),disabled:!X},{label:l.ZP.get("重命名"),key:"rename",icon:(0,W.jsx)(V.Z,{type:"ql-icon-rename"}),disabled:!X},{label:l.ZP.get("删除"),key:"delete",icon:(0,W.jsx)(q.Z,{}),disabled:!X}],onClick:function(e){var t=e.key;e.domEvent.stopPropagation(),function(e){switch(e){case"add":it();break;case"edit":Je();break;case"delete":nt();break;case"rename":rt()}}(t)}};return(0,W.jsx)(b.ZP,{className:"ql-container-wrapper log-wrapper",title:(0,W.jsxs)(W.Fragment,{children:[X,"file"===(null==Fe?void 0:Fe.type)&&(0,W.jsx)("span",{style:{marginLeft:6,fontSize:12,color:"#999",display:"inline-block",height:14},children:(0,O.Z)(Fe.size)})]}),loading:re,extra:n?[(0,W.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,W.jsx)(g.Z,{menu:ot,trigger:["click"],children:(0,W.jsx)(h.Z,{type:"primary",icon:(0,W.jsx)(E.Z,{})})})]:we?[(0,W.jsx)(h.Z,{type:"primary",onClick:tt,children:l.ZP.get("保存")}),(0,W.jsx)(h.Z,{type:"primary",onClick:et,children:l.ZP.get("退出编辑")})]:[(0,W.jsx)(f.Z,{title:l.ZP.get("创建"),children:(0,W.jsx)(h.Z,{type:"primary",onClick:it,icon:(0,W.jsx)(C.Z,{})})}),(0,W.jsx)(f.Z,{title:l.ZP.get("编辑"),children:(0,W.jsx)(h.Z,{disabled:!X,type:"primary",onClick:Je,icon:(0,W.jsx)(_.Z,{})})}),(0,W.jsx)(f.Z,{title:l.ZP.get("重命名"),children:(0,W.jsx)(h.Z,{disabled:!X,type:"primary",onClick:rt,icon:(0,W.jsx)(V.Z,{type:"ql-icon-rename"})})}),(0,W.jsx)(f.Z,{title:l.ZP.get("删除"),children:(0,W.jsx)(h.Z,{type:"primary",disabled:!X,onClick:nt,icon:(0,W.jsx)(q.Z,{})})}),(0,W.jsx)(h.Z,{type:"primary",onClick:function(){ve(!0)},children:l.ZP.get("调试")})],header:{style:t},children:(0,W.jsxs)("div",{className:"".concat(k["log-container"]," log-container"),children:[!n&&(0,W.jsxs)(S.Z,{split:"vertical",size:200,maxSize:-100,children:[(0,W.jsx)("div",{className:k["left-tree-container"],children:J.length>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(m.Z.Search,{className:k["left-tree-search"],onChange:Qe,placeholder:l.ZP.get("请输入脚本名"),allowClear:!0}),(0,W.jsx)("div",{className:k["left-tree-scroller"],ref:ge,children:(0,W.jsx)(v.Z,{expandAction:"click",className:k["left-tree"],treeData:Ge,showIcon:!0,height:de,selectedKeys:[X],expandedKeys:He,onExpand:function(e){Ue(e)},showLine:{showLeafIcon:!0},onSelect:ze,onDoubleClick:function(e,t){"file"===t.type&&(Y(t.key),Ae(t),je(!0))}})})]}):(0,W.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,W.jsx)(Z.Z,{description:l.ZP.get("暂无脚本"),image:Z.Z.PRESENTED_IMAGE_SIMPLE})})}),(0,W.jsx)(y.ZP,{language:le,value:I,theme:r,options:{readOnly:!we,fontSize:12,lineNumbersMinChars:3,glyphMargin:!1,accessibilitySupport:"off"},onMount:function(e){Se.current=e}})]}),n&&(0,W.jsx)(j.ZP,{value:I,extensions:le?[U.RI[le]()]:void 0,theme:r.includes("dark")?"dark":"light",readOnly:!we,onChange:function(e){A(e)}}),me&&(0,W.jsx)(w.default,{visible:me,treeData:J,currentNode:Fe,content:I,handleCancel:function(){ve(!1)}}),(0,W.jsx)(B.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 a=i()(J),o={title:t,key:r,parent:n};if(n){a=(0,N.I1)(a,(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)})),Ue([].concat(i()(He),s,[n]))}else a.unshift(o);ee(a),Ke(o.title,o),je(!0)}Ee(!1)}}),(0,W.jsx)(H.default,{visible:Re,handleCancel:function(){Te(!1),Le(!1)},currentNode:Fe})]})})}},43946:function(e,t,n){"use strict";n.r(t);var r=n(90228),i=n.n(r),a=n(87999),o=n.n(a),l=n(48305),s=n.n(l),c=n(72317),u=n(75271),d=n(72338),p=n(61508),g=n(45520),h=n(17082),f=n(94978),m=n(20710),v=n(52676);t.default=function(e){var t=e.currentNode,n=e.handleCancel,r=e.visible,a=d.Z.useForm(),l=s()(a,1)[0],Z=(0,u.useState)(!1),P=s()(Z,2),b=P[0],y=P[1],x=function(){var e=o()(i()().mark((function e(r){var a,o;return i()().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:a=e.sent,o=a.code,a.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){x(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:b,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("请输入新名称")})})})})}},62632:function(e,t,n){"use strict";n.r(t);var r=n(90228),i=n.n(r),a=n(26068),o=n.n(a),l=n(87999),s=n.n(l),c=n(48305),u=n.n(c),d=n(72317),p=n(75271),g=n(72338),h=n(61508),f=n(45520),m=n(17082),v=n(94978),Z=n(20710),P=n(52676);t.default=function(e){var t=e.file,n=e.handleCancel,r=e.visible,a=g.Z.useForm(),l=u()(a,1)[0],c=(0,p.useState)(!1),b=u()(c,2),y=b[0],x=b[1],k=function(){var e=s()(i()().mark((function e(r){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x(!0),a=o()(o()(o()({},t),r),{},{originFilename:t.title}),v.W.post("".concat(Z.Z.apiPrefix,"scripts"),a).then((function(e){var t=e.code,r=e.data;200===t&&(h.ZP.success(d.ZP.get("保存文件成功")),n(r))})).finally((function(){x(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,p.useEffect)((function(){l.resetFields(),x(!1)}),[t,r]),(0,P.jsx)(f.Z,{title:d.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:y,children:(0,P.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,P.jsx)(g.Z.Item,{name:"filename",label:d.ZP.get("文件名"),rules:[{required:!0,message:d.ZP.get("请输入文件名")}],children:(0,P.jsx)(m.Z,{placeholder:d.ZP.get("请输入文件名")})}),(0,P.jsx)(g.Z.Item,{name:"path",label:d.ZP.get("保存目录"),children:(0,P.jsx)(m.Z,{placeholder:d.ZP.get("请输入保存目录,默认scripts目录")})})]})})}},29280:function(e,t,n){"use strict";n.r(t);n(90228),n(26068),n(87999);var r=n(48305),i=n.n(r),a=n(72317),o=n(75271),l=n(72338),s=(n(61508),n(45520)),c=n(17082),u=(n(94978),n(20710),n(52676));t.default=function(e){var t=e.file,n=e.handleCancel,r=e.visible,d=l.Z.useForm(),p=i()(d,1)[0],g=(0,o.useState)(!1),h=i()(g,2),f=(h[0],h[1]);return(0,o.useEffect)((function(){p.resetFields(),f(!1)}),[t,r]),(0,u.jsx)(s.Z,{title:a.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:a.ZP.get("待开发"),rules:[{required:!0,message:a.ZP.get("待开发")}],children:(0,u.jsx)(c.Z,{placeholder:a.ZP.get("待开发")})})})})}},20710:function(e,t,n){"use strict";var r=n(72317),i=window.__ENV__QlBaseUrl||"/";t.Z={siteName:r.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: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:"ntfy",label:"Ntfy"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:r.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:r.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:r.ZP.get("钉钉机器人")},{value:"weWorkBot",label:r.ZP.get("企业微信机器人")},{value:"weWorkApp",label:r.ZP.get("企业微信应用")},{value:"aibotk",label:r.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:r.ZP.get("微加机器人")},{value:"wxPusherBot",label:"wxPusher"},{value:"chat",label:r.ZP.get("群晖chat")},{value:"email",label:r.ZP.get("邮箱")},{value:"lark",label:r.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:r.ZP.get("自定义通知")},{value:"closed",label:r.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:r.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:r.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:r.ZP.get("推送消息的优先级")}],ntfy:[{label:"ntfyUrl",tip:r.ZP.get("ntfy的url地址,例如 https://ntfy.sh"),required:!0},{label:"ntfyTopic",tip:r.ZP.get("ntfy的消息应用topic"),required:!0},{label:"ntfyPriority",tip:r.ZP.get("推送消息的优先级")}],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")},{label:"barkArchive",tip:r.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:r.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:r.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:r.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:r.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:r.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:r.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:r.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:r.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:r.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:r.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:r.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:r.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:r.ZP.get("请输入要发送的目标"),items:[{value:"room",label:r.ZP.get("群聊")},{value:"contact",label:r.ZP.get("好友")}]},{label:"aibotkName",tip:r.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:r.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:r.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:r.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")},{label:"pushplusTemplate",tip:r.ZP.get("发送模板")},{label:"pushplusChannel",tip:r.ZP.get("发送渠道")},{label:"pushplusWebhook",tip:r.ZP.get("webhook编码")},{label:"pushplusCallbackUrl",tip:r.ZP.get("发送结果回调地址")},{label:"pushplusTo",tip:r.ZP.get("好友令牌")}],wePlusBot:[{label:"wePlusBotToken",tip:r.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:r.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:r.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],wxPusherBot:[{label:"wxPusherBotAppToken",tip:r.ZP.get("wxPusherBot的appToken"),required:!0},{label:"wxPusherBotTopicIds",tip:r.ZP.get("wxPusherBot的topicIds"),required:!1},{label:"wxPusherBotUids",tip:r.ZP.get("wxPusherBot的uids"),required:!1}],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},{label:"pushMeUrl",tip:r.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:r.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:r.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:r.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:r.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:r.ZP.get("请求头Content-Type"),required:!0,items:[{value:"text/plain"},{value:"application/json"},{value:"multipart/form-data"},{value:"application/x-www-form-urlencoded"}]},{label:"webhookUrl",tip:r.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:r.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:r.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":r.ZP.get("登录"),"/initialization":r.ZP.get("初始化"),"/crontab":r.ZP.get("定时任务"),"/env":r.ZP.get("环境变量"),"/subscription":r.ZP.get("订阅管理"),"/config":r.ZP.get("配置文件"),"/script":r.ZP.get("脚本管理"),"/diff":r.ZP.get("对比工具"),"/log":r.ZP.get("日志管理"),"/setting":r.ZP.get("系统设置"),"/error":r.ZP.get("错误日志"),"/dependence":r.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},31306:function(e,t,n){"use strict";n.d(t,{F:function(){return s},e:function(){return l}});var r=n(48305),i=n.n(r),a=n(75271),o=n(65609),l=function(){var e=(0,a.useState)("100%"),t=i()(e,2),n=t[0],r=t[1],l=(0,a.useState)(0),s=i()(l,2),c=s[0],u=s[1],d=(0,a.useState)(-48),p=i()(d,2),g=p[0],h=p[1],f=(0,a.useState)(!1),m=i()(f,2),v=m[0],Z=m[1],P=(0,a.useMemo)((function(){return(0,o.ZP)()}),[]).platform;return(0,a.useEffect)((function(){"mobile"===P&&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,a.useState)(),t=i()(e,2),n=t[0],r=t[1];return(0,a.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 i=function(e){"auto"!==t&&t||(e.matches?r("vs-dark"):r("vs"))};"function"==typeof e.addEventListener?e.addEventListener("change",i):"function"==typeof e.addListener&&e.addListener(i)}),[]),{theme:n,reloadTheme:function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;r(n?"vs-dark":"vs")}}}},94978:function(e,t,n){"use strict";n.d(t,{W:function(){return f}});var r=n(90228),i=n.n(r),a=n(87999),o=n.n(a),l=n(72317),s=n(61508),c=n(20710),u=n(31038),d=n(74799);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()(i()().mark((function e(t){var n,r,a;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!==(r=t.data).code&&(a=r.message||r.data)&&s.ZP.error({content:a,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;if([502,504].includes(n))u.history.push("/error");else if(401===n)"/login"!==u.history.location.pathname&&(s.ZP.error(l.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(c.Z.authKey),u.history.push("/login"));else{var r,i;if("function"==typeof(null===(r=e.config)||void 0===r?void 0:r.onError))return null===(i=e.config)||void 0===i?void 0:i.onError(e.response);s.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}}else console.log(e.message);return Promise.reject(e)}));var f=g},65609:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},I1:function(){return p},o4: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(15558),i=n.n(r),a=n(72317),o={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript"},l=n(94046),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 i="unknow";"windows"===r?t(/windows nt 5.0|windows 2000/g)?i="2000":t(/windows nt 5.1|windows xp/g)?i="xp":t(/windows nt 5.2|windows 2003/g)?i="2003":t(/windows nt 6.0|windows vista/g)?i="vista":t(/windows nt 6.1|windows 7/g)?i="7":t(/windows nt 6.2|windows 8/g)?i="8":t(/windows nt 6.3|windows 8.1/g)?i="8.1":t(/windows nt 10.0|windows 10/g)&&(i="10"):"macos"===r?i=n(/os x [\d._]+/g):"android"===r?i=n(/android [\d._]+/g):"ios"===r&&(i=n(/os [\d._]+/g));var a="unknow";"windows"===r||"macos"===r||"linux"===r?a="desktop":("android"===r||"ios"===r||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 p=Object.assign({engine:o,engineVs:s,platform:a,supporter:l,supporterVs:c,system:r,systemVs:i},"none"===u?{}:{shell:u,shellVs:d});return console.log("%c\n .d88b. d888888b d8b db d888b db .d88b. d8b db d888b \n.8P Y8. `88' 888o 88 88' Y8b 88 .8P Y8. 888o 88 88' Y8b \n88 88 88 88V8o 88 88 88 88 88 88V8o 88 88 \n88 88 88 88 V8o88 88 ooo 88 88 88 88 V8o88 88 ooo \n`8P d8' .88. 88 V888 88. ~8~ 88booo. `8b d8' 88 V888 88. ~8~ \n `Y88'Y8 Y888888P VP V8P Y888P Y88888P `Y88P' VP V8P Y888P \n \n \n","color: blue;font-size: 14px;"),console.log("%c忘形雨笠烟蓑,知心牧唱樵歌。明月清风共我,闲人三个,从他今古消磨。\n","color: yellow;font-size: 18px;"),console.log("%c青龙运行环境:\n\n系统:".concat(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,i=0;(r=n||document.querySelector(".ant-table-wrapper"))&&(i=r.getBoundingClientRect().top);var a=document.body.clientHeight-i-t;return a}function d(e,t){var n,r,i=window.URL||window.webkitURL||window,a=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=i.createObjectURL(a),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=i()(e),a=[];return function e(r){if(r)for(var i=0;i<(null==r?void 0:r.length);i++){if(t(r[i]))return n?void(r[i].children?r[i].children.unshift(n):r[i].children=[n]):void r.splice(i,1);r[i].children&&(a.push(r[i].key),e(r[i].children))}}(r),r}function g(e,t){var n;return function e(r){if(r)for(var i=0;i<(null==r?void 0:r.length);i++)t(r[i])?n=r[i]:r[i].children&&e(r[i].children)}(i()(e)),n}function h(e){return[" ",a.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,i,a="".concat(window.__ENV__QL_DIR,"/data/scripts");n.startsWith(a)&&(n=n.replace(a,""));var o=n.lastIndexOf("/");return o>=0?(i=n.slice(o+1),r=n.slice(0,o)):(i=n,r=""),[i,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.schedule);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]}function P(){var e=document.createElement("div");e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="transparent",e.style.zIndex="9999",document.body.appendChild(e),e.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()})),document.body.style.overflow="hidden"}},69325:function(e,t,n){"use strict";var r=n(15558),i=n.n(r),a=n(67825),o=n.n(a),l=n(90228),s=n.n(l),c=n(87999),u=n.n(c),d=n(25298),p=n.n(d),g=n(17069),h=n.n(g),f=n(82092),m=n.n(f),v=n(78078),Z=n.n(v),P=["type"],b=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,P),r=this.subscriptions.get(t)||new Set;i()(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()(b,"instance",null),t.Z=b},50810:function(){}}]);
|
|
1
|
+
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[6534,9064,8673,440,4642],{55426:function(e,t,n){"use strict";var r=(0,n(19919).Z)({scriptUrl:["//at.alicdn.com/t/c/font_3354854_lc939gab1iq.js"]});t.Z=r},69139:function(e,t,n){"use strict";var r=n(26068),i=n.n(r),a=n(75271);t.Z=function(e,t,n){var r=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[r];return String(n).toUpperCase().includes(a)}return{treeData:function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.map((function(t){var a=t.children,l=r||o(0,t),s=e(a||[],l);return l||s.length?(s.length&&n.push(t.key),i()(i()({},t),{},{children:s})):null})).filter((function(e){return e}))}(e),keys:n}}),[e,t,r])}},9509:function(e,t,n){"use strict";n.r(t);var r=n(26068),i=n.n(r),a=n(48305),o=n.n(a),l=n(72317),s=n(75271),c=n(35181),u=n(53390),d=n(88142),p=n(93481),g=n(94978),h=n(20710),f=n(43382),m=n(83383),v=n(62632),Z=n(29280),P=n(31306),b=n(65609),y=n(69325),x=n(78060),k=n.n(x),w=n(52676),j=c.Z.Option;t.default=function(e){var t=e.treeData,n=e.currentNode,r=e.content,a=e.handleCancel,x=e.visible,S=(0,s.useState)(""),C=o()(S,2),_=C[0],q=C[1],E=(0,s.useState)(),B=o()(E,2),I=B[0],R=B[1],T=(0,s.useState)(),D=o()(T,2),N=D[0],F=D[1],A=(0,s.useState)(),M=o()(A,2),V=M[0],H=M[1],U=(0,s.useState)(!1),L=o()(U,2),O=L[0],W=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,P.F)().theme,te=(0,s.useRef)(null),ne=(0,s.useState)(!1),re=o()(ne,2),ie=re[0],ae=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&&ae(!1)}))},pe=(0,s.useCallback)((function(e){var t=e.message;(0,b.x$)(t)&&setTimeout((function(){ae(!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){F(n),q(r),H(n.key);var e=(0,b.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:V,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!==V&&e&&"directory"!==t.type){var n=(0,b.H$)(e);F(t),R(n),ue(t),H(t.key)}},treeLine:{showLeafIcon:!0}}),(0,w.jsxs)(c.Z,{value:I,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:ie?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&&(ae(!0),ce(n))}))},children:ie?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(){W(!0)},children:l.ZP.get("保存")}),(0,w.jsx)(p.Z,{type:"primary",style:{marginRight:8},onClick:function(){de(),a()},children:l.ZP.get("退出")})]}),width:"100%",headerStyle:{padding:"11px 24px"},onClose:function(){a()},open:x,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:I,value:_,theme:ee,options:{fontSize:12,minimap:{enabled:!1},lineNumbersMinChars:3,glyphMargin:!1,accessibilitySupport:"off"},onMount:function(e){te.current=e}}),(0,w.jsx)("pre",{style:{padding:"0 15px"},children:(0,w.jsx)(k(),{children:$})})]}),(0,w.jsx)(v.default,{visible:O,handleCancel:function(){W(!1)},file:i()({content:te.current&&te.current.getValue().replace(/\r\n/g,"\n")},N)}),(0,w.jsx)(Z.default,{visible:Q,handleCancel:function(){X(!1)}})]})}},18537:function(e,t,n){"use strict";n.r(t);var r=n(26068),i=n.n(r),a=n(335),o=n.n(a),l=n(90228),s=n.n(l),c=n(87999),u=n.n(c),d=n(48305),p=n.n(d),g=n(72317),h=n(75271),f=n(35181),m=n(72338),v=n(61508),Z=n(45520),P=n(94747),b=n(17082),y=n(88142),x=n(6367),k=n(94978),w=n(20710),j=n(79231),S=n(52676);f.Z.Option;t.default=function(e){var t=e.handleCancel,n=e.treeData,r=e.visible,a=m.Z.useForm(),l=p()(a,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],B=q[1],I=(0,h.useState)(),R=p()(I,2),T=R[0],D=R[1],N=(0,h.useState)("blank"),F=p()(N,2),A=F[0],M=F[1],V=function(){var e=u()(s()().mark((function e(n){var r,i,a,o,l,c;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C(!0),r=n.path,i=void 0===r?"":r,a=n.filename,o=n.directory,l=void 0===o?"":o,(c=new FormData).append("file",T||""),c.append("filename",(null==T?void 0:T.name)||a),c.append("path",i),c.append("content",""),c.append("directory",l),k.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=i?"".concat(i,"/"):"",o=T?T.name:a;t({filename:o,path:i,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)}}(),H=function e(t){var n,r=o()(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;a.children&&a.children.length>0&&(a.children=a.children.filter((function(e){return"directory"===e.type})).map((function(e){return i()(i()({},e),{},{disabled:!1})})),e(a.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 i()(i()({},e),{},{disabled:!1})})),t=H(e);B(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){V(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)(P.ZP.Group,{onChange:function(e){M(e.target.value)},children:[(0,S.jsx)(P.ZP,{value:"blank",children:g.ZP.get("空文件")}),(0,S.jsx)(P.ZP,{value:"upload",children:g.ZP.get("本地文件")}),(0,S.jsx)(P.ZP,{value:"directory",children:g.ZP.get("文件夹")})]})}),"blank"===A&&(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)(b.Z,{placeholder:g.ZP.get("请输入文件名")})}),"directory"===A&&(0,S.jsx)(m.Z.Item,{name:"directory",label:g.ZP.get("文件夹名"),rules:[{required:!0,message:g.ZP.get("请输入文件夹名")}],children:(0,S.jsx)(b.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"===A&&(0,S.jsx)(m.Z.Item,{label:g.ZP.get("文件"),name:"file",children:(0,S.jsxs)(x.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("点击或者拖拽文件到此区域上传")})]})})]})})}},40097:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return z}});var r=n(15558),i=n.n(r),a=n(48305),o=n.n(a),l=n(72317),s=n(75271),c=n(50691),u=n(45520),d=n(61508),p=n(88142),g=n(85950),h=n(93481),f=n(59816),m=n(17082),v=n(13107),Z=n(98705),P=n(20710),b=n(40872),y=n(83383),x=n(94978),k={"left-tree-container":"left-tree-container___z9VeF","left-tree-scroller":"left-tree-scroller___MRc8C","log-container":"log-container___Iva4k"},w=n(9509),j=n(71742),S=n(43382),C=n(21288),_=n(28423),q=n(88939),E=n(97953),B=n(18537),I=n(66292),R=n.n(I),T=n(31038),D=n(748),N=n(65609),F=n(69139),A=n(4363),M=n.n(A),V=n(55426),H=n(43946),U=n(82904),L=n(28837),O=n(79514),W=n(52676),K=c.Z.Text,z=function(){var e=(0,T.useOutletContext)(),t=e.headerStyle,n=e.isPhone,r=e.theme,a=(0,s.useState)(l.ZP.get("请选择脚本文件")),c=o()(a,2),I=c[0],A=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],ie=ne[1],ae=(0,s.useState)(""),oe=o()(ae,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)(""),Pe=o()(Ze,2),be=Pe[0],ye=Pe[1],xe=(0,s.useState)(!1),ke=o()(xe,2),we=ke[0],je=ke[1],Se=(0,s.useRef)(null),Ce=(0,s.useState)(!1),_e=o()(Ce,2),qe=_e[0],Ee=_e[1],Be=(0,s.useState)(!1),Ie=o()(Be,2),Re=Ie[0],Te=Ie[1],De=(0,s.useState)(),Ne=o()(De,2),Fe=Ne[0],Ae=Ne[1],Me=(0,s.useState)([]),Ve=o()(Me,2),He=Ve[0],Ue=Ve[1],Le=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e&&ie(!0),x.W.get("".concat(P.Z.apiPrefix,"scripts")).then((function(e){var t=e.code,n=e.data;200===t&&(ee(n),at(),We(n))})).finally((function(){return e&&ie(!1)}))},Oe=function(e){x.W.get("".concat(P.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&&A(n)}))},We=function(e){var t=(0,D.parse)(T.history.location.search),n=t.p,r=t.s;if(r){var i="".concat(n,"/").concat(r),a={node:{title:r,key:n?i:r,parent:n}},o=(0,N.DY)(e,(function(e){return e.key===a.node.key}));o&&(a.node=o,Ue([n]),ze([i],a))}},Ke=function(e,t){if(t.key!==X&&e)if(Y(t.key),Ae(t),"directory"!==t.type){var r=(0,N.H$)(e);se(n&&"typescript"===r?"javascript":r),A(l.ZP.get("加载中...")),Oe(t)}else A(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"):I)!==I?u.Z.confirm({title:"确认离开",content:(0,W.jsx)(W.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)))}),[I,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,F.Z)(J,be,{treeNodeFilterProp:"title"}),Ge=Ye.treeData,$e=Ye.keys;(0,s.useEffect)((function(){Ue(M()([].concat(i()(He),i()($e))))}),[$e]);var Je=function(){setTimeout((function(){je(!0)}),300)},et=function(){je(!1),A(l.ZP.get("加载中...")),Oe(Fe)},tt=function(){u.Z.confirm({title:"确认保存",content:(0,W.jsxs)(W.Fragment,{children:[l.ZP.get("确认保存文件"),(0,W.jsxs)(K,{style:{wordBreak:"break-all"},type:"warning",children:[" ",Fe.title]}),l.ZP.get(",保存后不可恢复")]}),onOk:function(){var e=Se.current?Se.current.getValue().replace(/\r\n/g,"\n"):I;return new Promise((function(t,n){x.W.put("".concat(P.Z.apiPrefix,"scripts"),{filename:Fe.title,path:Fe.parent||"",content:e}).then((function(n){var r=n.code;n.data;200===r&&(d.ZP.success("保存成功"),A(e),je(!1)),t(null)})).catch((function(e){return n(e)}))}))},onCancel:function(){console.log("Cancel")}})},nt=function(){u.Z.confirm({title:"确认删除",content:(0,W.jsxs)(W.Fragment,{children:[l.ZP.get("确认删除"),(0,W.jsxs)(K,{style:{wordBreak:"break-all"},type:"warning",children:[" ",X," "]}),l.ZP.get("文件"),"directory"===Fe.type?l.ZP.get("夹及其子文件"):"",l.ZP.get(",删除后不可恢复")]}),onOk:function(){x.W.delete("".concat(P.Z.apiPrefix,"scripts"),{data:{filename:Fe.title,path:Fe.parent||"",type:Fe.type}}).then((function(e){if(200===e.code){d.ZP.success("删除成功");var t=i()(J);if(Fe.parent)t=(0,N.I1)(t,(function(e){return e.key===Fe.key}));else{var n=t.findIndex((function(e){return e.key===Fe.key}));-1!==n&&t.splice(n,1)}ee(t),at()}}))},onCancel:function(){console.log("Cancel")}})},rt=function(){Te(!0)},it=function(){Ee(!0)},at=function(){Y(l.ZP.get("请选择脚本文件")),Ae(null),A(l.ZP.get("请选择脚本文件"))};(0,s.useEffect)((function(){Le()}),[]),(0,s.useEffect)((function(){ge.current&&pe(ge.current.clientHeight-6)}),[ge.current,J]),(0,L.y1)("mod+s",(function(e){we&&tt()}),{enableOnFormTags:["textarea"],preventDefault:!0}),(0,L.y1)("mod+d",(function(e){Fe.title&&nt()}),{preventDefault:!0}),(0,L.y1)("mod+o",(function(e){we||it()}),{preventDefault:!0}),(0,L.y1)("mod+e",(function(e){Fe.title&&et()}),{preventDefault:!0});var ot=we?{items:[{label:l.ZP.get("保存"),key:"save",icon:(0,W.jsx)(C.Z,{})},{label:l.ZP.get("退出编辑"),key:"exit",icon:(0,W.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,W.jsx)(C.Z,{})},{label:l.ZP.get("编辑"),key:"edit",icon:(0,W.jsx)(_.Z,{}),disabled:!X},{label:l.ZP.get("重命名"),key:"rename",icon:(0,W.jsx)(V.Z,{type:"ql-icon-rename"}),disabled:!X},{label:l.ZP.get("删除"),key:"delete",icon:(0,W.jsx)(q.Z,{}),disabled:!X}],onClick:function(e){var t=e.key;e.domEvent.stopPropagation(),function(e){switch(e){case"add":it();break;case"edit":Je();break;case"delete":nt();break;case"rename":rt()}}(t)}};return(0,W.jsx)(b.ZP,{className:"ql-container-wrapper log-wrapper",title:(0,W.jsxs)(W.Fragment,{children:[X,"file"===(null==Fe?void 0:Fe.type)&&(0,W.jsx)("span",{style:{marginLeft:6,fontSize:12,color:"#999",display:"inline-block",height:14},children:(0,O.Z)(Fe.size)})]}),loading:re,extra:n?[(0,W.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,W.jsx)(g.Z,{menu:ot,trigger:["click"],children:(0,W.jsx)(h.Z,{type:"primary",icon:(0,W.jsx)(E.Z,{})})})]:we?[(0,W.jsx)(h.Z,{type:"primary",onClick:tt,children:l.ZP.get("保存")}),(0,W.jsx)(h.Z,{type:"primary",onClick:et,children:l.ZP.get("退出编辑")})]:[(0,W.jsx)(f.Z,{title:l.ZP.get("创建"),children:(0,W.jsx)(h.Z,{type:"primary",onClick:it,icon:(0,W.jsx)(C.Z,{})})}),(0,W.jsx)(f.Z,{title:l.ZP.get("编辑"),children:(0,W.jsx)(h.Z,{disabled:!X,type:"primary",onClick:Je,icon:(0,W.jsx)(_.Z,{})})}),(0,W.jsx)(f.Z,{title:l.ZP.get("重命名"),children:(0,W.jsx)(h.Z,{disabled:!X,type:"primary",onClick:rt,icon:(0,W.jsx)(V.Z,{type:"ql-icon-rename"})})}),(0,W.jsx)(f.Z,{title:l.ZP.get("删除"),children:(0,W.jsx)(h.Z,{type:"primary",disabled:!X,onClick:nt,icon:(0,W.jsx)(q.Z,{})})}),(0,W.jsx)(h.Z,{type:"primary",onClick:function(){ve(!0)},children:l.ZP.get("调试")})],header:{style:t},children:(0,W.jsxs)("div",{className:"".concat(k["log-container"]," log-container"),children:[!n&&(0,W.jsxs)(S.Z,{split:"vertical",size:200,maxSize:-100,children:[(0,W.jsx)("div",{className:k["left-tree-container"],children:J.length>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(m.Z.Search,{className:k["left-tree-search"],onChange:Qe,placeholder:l.ZP.get("请输入脚本名"),allowClear:!0}),(0,W.jsx)("div",{className:k["left-tree-scroller"],ref:ge,children:(0,W.jsx)(v.Z,{expandAction:"click",className:k["left-tree"],treeData:Ge,showIcon:!0,height:de,selectedKeys:[X],expandedKeys:He,onExpand:function(e){Ue(e)},showLine:{showLeafIcon:!0},onSelect:ze,onDoubleClick:function(e,t){"file"===t.type&&(Y(t.key),Ae(t),je(!0))}})})]}):(0,W.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,W.jsx)(Z.Z,{description:l.ZP.get("暂无脚本"),image:Z.Z.PRESENTED_IMAGE_SIMPLE})})}),(0,W.jsx)(y.ZP,{language:le,value:I,theme:r,options:{readOnly:!we,fontSize:12,lineNumbersMinChars:3,glyphMargin:!1,accessibilitySupport:"off"},onMount:function(e){Se.current=e}})]}),n&&(0,W.jsx)(j.ZP,{value:I,extensions:le?[U.RI[le]()]:void 0,theme:r.includes("dark")?"dark":"light",readOnly:!we,onChange:function(e){A(e)}}),me&&(0,W.jsx)(w.default,{visible:me,treeData:J,currentNode:Fe,content:I,handleCancel:function(){ve(!1)}}),(0,W.jsx)(B.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 a=i()(J),o={title:t,key:r,parent:n};if(n){a=(0,N.I1)(a,(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)})),Ue([].concat(i()(He),s,[n]))}else a.unshift(o);ee(a),Ke(o.title,o),je(!0)}Ee(!1)}}),(0,W.jsx)(H.default,{visible:Re,handleCancel:function(){Te(!1),Le(!1)},currentNode:Fe})]})})}},43946:function(e,t,n){"use strict";n.r(t);var r=n(90228),i=n.n(r),a=n(87999),o=n.n(a),l=n(48305),s=n.n(l),c=n(72317),u=n(75271),d=n(72338),p=n(61508),g=n(45520),h=n(17082),f=n(94978),m=n(20710),v=n(52676);t.default=function(e){var t=e.currentNode,n=e.handleCancel,r=e.visible,a=d.Z.useForm(),l=s()(a,1)[0],Z=(0,u.useState)(!1),P=s()(Z,2),b=P[0],y=P[1],x=function(){var e=o()(i()().mark((function e(r){var a,o;return i()().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:a=e.sent,o=a.code,a.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){x(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:b,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("请输入新名称")})})})})}},62632:function(e,t,n){"use strict";n.r(t);var r=n(90228),i=n.n(r),a=n(26068),o=n.n(a),l=n(87999),s=n.n(l),c=n(48305),u=n.n(c),d=n(72317),p=n(75271),g=n(72338),h=n(61508),f=n(45520),m=n(17082),v=n(94978),Z=n(20710),P=n(52676);t.default=function(e){var t=e.file,n=e.handleCancel,r=e.visible,a=g.Z.useForm(),l=u()(a,1)[0],c=(0,p.useState)(!1),b=u()(c,2),y=b[0],x=b[1],k=function(){var e=s()(i()().mark((function e(r){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:x(!0),a=o()(o()(o()({},t),r),{},{originFilename:t.title}),v.W.post("".concat(Z.Z.apiPrefix,"scripts"),a).then((function(e){var t=e.code,r=e.data;200===t&&(h.ZP.success(d.ZP.get("保存文件成功")),n(r))})).finally((function(){x(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,p.useEffect)((function(){l.resetFields(),x(!1)}),[t,r]),(0,P.jsx)(f.Z,{title:d.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:y,children:(0,P.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,P.jsx)(g.Z.Item,{name:"filename",label:d.ZP.get("文件名"),rules:[{required:!0,message:d.ZP.get("请输入文件名")}],children:(0,P.jsx)(m.Z,{placeholder:d.ZP.get("请输入文件名")})}),(0,P.jsx)(g.Z.Item,{name:"path",label:d.ZP.get("保存目录"),children:(0,P.jsx)(m.Z,{placeholder:d.ZP.get("请输入保存目录,默认scripts目录")})})]})})}},29280:function(e,t,n){"use strict";n.r(t);n(90228),n(26068),n(87999);var r=n(48305),i=n.n(r),a=n(72317),o=n(75271),l=n(72338),s=(n(61508),n(45520)),c=n(17082),u=(n(94978),n(20710),n(52676));t.default=function(e){var t=e.file,n=e.handleCancel,r=e.visible,d=l.Z.useForm(),p=i()(d,1)[0],g=(0,o.useState)(!1),h=i()(g,2),f=(h[0],h[1]);return(0,o.useEffect)((function(){p.resetFields(),f(!1)}),[t,r]),(0,u.jsx)(s.Z,{title:a.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:a.ZP.get("待开发"),rules:[{required:!0,message:a.ZP.get("待开发")}],children:(0,u.jsx)(c.Z,{placeholder:a.ZP.get("待开发")})})})})}},20710:function(e,t,n){"use strict";var r=n(72317),i=window.__ENV__QlBaseUrl||"/";t.Z={siteName:r.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: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:"ntfy",label:"Ntfy"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:r.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:r.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:r.ZP.get("钉钉机器人")},{value:"weWorkBot",label:r.ZP.get("企业微信机器人")},{value:"weWorkApp",label:r.ZP.get("企业微信应用")},{value:"aibotk",label:r.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:r.ZP.get("微加机器人")},{value:"wxPusherBot",label:"wxPusher"},{value:"chat",label:r.ZP.get("群晖chat")},{value:"email",label:r.ZP.get("邮箱")},{value:"lark",label:r.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:r.ZP.get("自定义通知")},{value:"closed",label:r.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:r.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:r.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:r.ZP.get("推送消息的优先级")}],ntfy:[{label:"ntfyUrl",tip:r.ZP.get("ntfy的url地址,例如 https://ntfy.sh"),required:!0},{label:"ntfyTopic",tip:r.ZP.get("ntfy的消息应用topic"),required:!0},{label:"ntfyPriority",tip:r.ZP.get("推送消息的优先级")}],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")},{label:"barkArchive",tip:r.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:r.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:r.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:r.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:r.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:r.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:r.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:r.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:r.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:r.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:r.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:r.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:r.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:r.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:r.ZP.get("请输入要发送的目标"),items:[{value:"room",label:r.ZP.get("群聊")},{value:"contact",label:r.ZP.get("好友")}]},{label:"aibotkName",tip:r.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:r.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:r.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:r.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")},{label:"pushplusTemplate",tip:r.ZP.get("发送模板")},{label:"pushplusChannel",tip:r.ZP.get("发送渠道")},{label:"pushplusWebhook",tip:r.ZP.get("webhook编码")},{label:"pushplusCallbackUrl",tip:r.ZP.get("发送结果回调地址")},{label:"pushplusTo",tip:r.ZP.get("好友令牌")}],wePlusBot:[{label:"wePlusBotToken",tip:r.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:r.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:r.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],wxPusherBot:[{label:"wxPusherBotAppToken",tip:r.ZP.get("wxPusherBot的appToken"),required:!0},{label:"wxPusherBotTopicIds",tip:r.ZP.get("wxPusherBot的topicIds"),required:!1},{label:"wxPusherBotUids",tip:r.ZP.get("wxPusherBot的uids"),required:!1}],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},{label:"pushMeUrl",tip:r.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:r.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:r.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:r.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:r.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:r.ZP.get("请求头Content-Type"),required:!0,items:[{value:"text/plain"},{value:"application/json"},{value:"multipart/form-data"},{value:"application/x-www-form-urlencoded"}]},{label:"webhookUrl",tip:r.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:r.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:r.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":r.ZP.get("登录"),"/initialization":r.ZP.get("初始化"),"/crontab":r.ZP.get("定时任务"),"/env":r.ZP.get("环境变量"),"/subscription":r.ZP.get("订阅管理"),"/config":r.ZP.get("配置文件"),"/script":r.ZP.get("脚本管理"),"/diff":r.ZP.get("对比工具"),"/log":r.ZP.get("日志管理"),"/setting":r.ZP.get("系统设置"),"/error":r.ZP.get("错误日志"),"/dependence":r.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},31306:function(e,t,n){"use strict";n.d(t,{F:function(){return s},e:function(){return l}});var r=n(48305),i=n.n(r),a=n(75271),o=n(65609),l=function(){var e=(0,a.useState)("100%"),t=i()(e,2),n=t[0],r=t[1],l=(0,a.useState)(0),s=i()(l,2),c=s[0],u=s[1],d=(0,a.useState)(-48),p=i()(d,2),g=p[0],h=p[1],f=(0,a.useState)(!1),m=i()(f,2),v=m[0],Z=m[1],P=(0,a.useMemo)((function(){return(0,o.ZP)()}),[]).platform;return(0,a.useEffect)((function(){"mobile"===P&&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,a.useState)(),t=i()(e,2),n=t[0],r=t[1];return(0,a.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 i=function(e){"auto"!==t&&t||(e.matches?r("vs-dark"):r("vs"))};"function"==typeof e.addEventListener?e.addEventListener("change",i):"function"==typeof e.addListener&&e.addListener(i)}),[]),{theme:n,reloadTheme:function(){var e=window.matchMedia("(prefers-color-scheme: dark)"),t=localStorage.getItem("qinglong_dark_theme"),n=e.matches&&"light"!==t||"dark"===t;r(n?"vs-dark":"vs")}}}},94978:function(e,t,n){"use strict";n.d(t,{W:function(){return f}});var r=n(90228),i=n.n(r),a=n(87999),o=n.n(a),l=n(72317),s=n(61508),c=n(20710),u=n(31038),d=n(74799);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()(i()().mark((function e(t){var n,r,a;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!==(r=t.data).code&&(a=r.message||r.data)&&s.ZP.error({content:a,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;if([502,504].includes(n))u.history.push("/error");else if(401===n)"/login"!==u.history.location.pathname&&(s.ZP.error(l.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(c.Z.authKey),u.history.push("/login"));else{var r,i;if("function"==typeof(null===(r=e.config)||void 0===r?void 0:r.onError))return null===(i=e.config)||void 0===i?void 0:i.onError(e.response);s.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}}else console.log(e.message);return Promise.reject(e)}));var f=g},65609:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},I1:function(){return p},o4: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(15558),i=n.n(r),a=n(72317),o={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript",".ini":"ini",".json":"json"},l=n(94046),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 i="unknow";"windows"===r?t(/windows nt 5.0|windows 2000/g)?i="2000":t(/windows nt 5.1|windows xp/g)?i="xp":t(/windows nt 5.2|windows 2003/g)?i="2003":t(/windows nt 6.0|windows vista/g)?i="vista":t(/windows nt 6.1|windows 7/g)?i="7":t(/windows nt 6.2|windows 8/g)?i="8":t(/windows nt 6.3|windows 8.1/g)?i="8.1":t(/windows nt 10.0|windows 10/g)&&(i="10"):"macos"===r?i=n(/os x [\d._]+/g):"android"===r?i=n(/android [\d._]+/g):"ios"===r&&(i=n(/os [\d._]+/g));var a="unknow";"windows"===r||"macos"===r||"linux"===r?a="desktop":("android"===r||"ios"===r||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 p=Object.assign({engine:o,engineVs:s,platform:a,supporter:l,supporterVs:c,system:r,systemVs:i},"none"===u?{}:{shell:u,shellVs:d});return console.log("%c\n .d88b. d888888b d8b db d888b db .d88b. d8b db d888b \n.8P Y8. `88' 888o 88 88' Y8b 88 .8P Y8. 888o 88 88' Y8b \n88 88 88 88V8o 88 88 88 88 88 88V8o 88 88 \n88 88 88 88 V8o88 88 ooo 88 88 88 88 V8o88 88 ooo \n`8P d8' .88. 88 V888 88. ~8~ 88booo. `8b d8' 88 V888 88. ~8~ \n `Y88'Y8 Y888888P VP V8P Y888P Y88888P `Y88P' VP V8P Y888P \n \n \n","color: blue;font-size: 14px;"),console.log("%c忘形雨笠烟蓑,知心牧唱樵歌。明月清风共我,闲人三个,从他今古消磨。\n","color: yellow;font-size: 18px;"),console.log("%c青龙运行环境:\n\n系统:".concat(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,i=0;(r=n||document.querySelector(".ant-table-wrapper"))&&(i=r.getBoundingClientRect().top);var a=document.body.clientHeight-i-t;return a}function d(e,t){var n,r,i=window.URL||window.webkitURL||window,a=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=i.createObjectURL(a),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=i()(e),a=[];return function e(r){if(r)for(var i=0;i<(null==r?void 0:r.length);i++){if(t(r[i]))return n?void(r[i].children?r[i].children.unshift(n):r[i].children=[n]):void r.splice(i,1);r[i].children&&(a.push(r[i].key),e(r[i].children))}}(r),r}function g(e,t){var n;return function e(r){if(r)for(var i=0;i<(null==r?void 0:r.length);i++)t(r[i])?n=r[i]:r[i].children&&e(r[i].children)}(i()(e)),n}function h(e){return[" ",a.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,i,a="".concat(window.__ENV__QL_DIR,"/data/scripts");n.startsWith(a)&&(n=n.replace(a,""));var o=n.lastIndexOf("/");return o>=0?(i=n.slice(o+1),r=n.slice(0,o)):(i=n,r=""),[i,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.schedule);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]}function P(){var e=document.createElement("div");e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="transparent",e.style.zIndex="9999",document.body.appendChild(e),e.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()})),document.body.style.overflow="hidden"}},69325:function(e,t,n){"use strict";var r=n(15558),i=n.n(r),a=n(67825),o=n.n(a),l=n(90228),s=n.n(l),c=n(87999),u=n.n(c),d=n(25298),p=n.n(d),g=n(17069),h=n.n(g),f=n(82092),m=n.n(f),v=n(78078),Z=n.n(v),P=["type"],b=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,P),r=this.subscriptions.get(t)||new Set;i()(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()(b,"instance",null),t.Z=b},50810:function(){}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[2340,4642],{82337:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var o=n(72317),r=(n(75271),n(50691)),i=n(18015),a="container___nww32",s="right___o0xXT",l="title___DHxWh",c="desc___frhI6",u=n(16483),d=n.n(u),g=n(52676),p=r.Z.Link,h=function(e){var t=e.systemInfo;return(0,g.jsxs)("div",{className:a,children:[(0,g.jsx)("img",{alt:"logo",style:{width:140,marginRight:20},src:"https://qn.whyour.cn/logo.png"}),(0,g.jsxs)("div",{className:s,children:[(0,g.jsx)("span",{className:l,children:o.ZP.get("青龙")}),(0,g.jsx)("span",{className:c,children:o.ZP.get("支持python3、javascript、shell、typescript 的定时任务管理面板")}),(0,g.jsxs)(i.Z,{children:[(0,g.jsxs)(i.Z.Item,{label:o.ZP.get("版本"),span:3,children:["develop"===(null==t?void 0:t.branch)?o.ZP.get("开发版"):o.ZP.get("正式版")," ","v",t.version]}),(0,g.jsx)(i.Z.Item,{label:o.ZP.get("更新时间"),span:3,children:d()(1e3*t.publishTime).format("YYYY-MM-DD HH:mm")}),(0,g.jsx)(i.Z.Item,{label:o.ZP.get("更新日志"),span:3,children:(0,g.jsx)(p,{href:"https://qn.whyour.cn/version.yaml?t=".concat(Date.now()),target:"_blank",children:o.ZP.get("查看")})})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)(p,{href:"https://github.com/whyour/qinglong",target:"_blank",style:{marginRight:15},children:"Github"}),(0,g.jsx)(p,{href:"https://t.me/jiao_long",target:"_blank",style:{marginRight:15},children:o.ZP.get("Telegram频道")}),(0,g.jsx)(p,{href:"https://github.com/whyour/qinglong/issues",target:"_blank",children:o.ZP.get("提交BUG")})]})]})]})}},20112:function(e,t,n){"use strict";n.r(t);var o=n(90228),r=n.n(o),i=n(26068),a=n.n(i),s=n(87999),l=n.n(s),c=n(48305),u=n.n(c),d=n(72317),g=n(75271),p=n(72338),h=n(61508),f=n(45520),m=n(17082),Z=n(35181),x=n(94978),P=n(20710),v=n(52676);t.default=function(e){var t=e.app,n=e.handleCancel,o=e.visible,i=p.Z.useForm(),s=u()(i,1)[0],c=(0,g.useState)(!1),y=u()(c,2),b=y[0],w=y[1],k=function(){var e=l()(r()().mark((function e(o){var i,s,l,c,u;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),i=t?"put":"post",s=a()({},o),t&&(s.id=t.id),e.prev=4,e.next=7,x.W[i]("".concat(P.Z.apiPrefix,"apps"),s);case 7:l=e.sent,c=l.code,u=l.data,200===c&&(h.ZP.success(t?d.ZP.get("更新应用成功"):d.ZP.get("创建应用成功")),n(u)),w(!1),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),w(!1);case 17:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(t){return e.apply(this,arguments)}}();return(0,g.useEffect)((function(){s.resetFields()}),[t,o]),(0,v.jsx)(f.Z,{title:t?d.ZP.get("编辑应用"):d.ZP.get("创建应用"),open:o,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){s.validateFields().then((function(e){k(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:b,children:(0,v.jsxs)(p.Z,{form:s,layout:"vertical",name:"form_app_modal",initialValues:t,children:[(0,v.jsx)(p.Z.Item,{name:"name",label:d.ZP.get("名称"),rules:[{validator:function(e,t){return["system"].includes(t)?Promise.reject(new Error(d.ZP.get("名称不能为保留关键字"))):Promise.resolve()}}],children:(0,v.jsx)(m.Z,{placeholder:d.ZP.get("请输入应用名称")})}),(0,v.jsx)(p.Z.Item,{name:"scopes",label:d.ZP.get("权限"),rules:[{required:!0}],children:(0,v.jsx)(Z.Z,{mode:"multiple",placeholder:d.ZP.get("请选择模块权限"),allowClear:!0,style:{width:"100%"},children:P.Z.scopes.map((function(e){return(0,v.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.value)}))})})]})})}},8429:function(e,t,n){"use strict";n.r(t);var o=n(48305),r=n.n(o),i=n(65609),a=n(20710),s=n(94978),l=n(69325),c=n(78060),u=n.n(c),d=n(32890),g=n(61508),p=n(45520),h=n(93481),f=n(75271),m=n(72317),Z=n(52676),x=d.Z.Countdown;t.default=function(e){var t=e.systemInfo,n=(0,f.useState)(!1),o=r()(n,2),c=o[0],d=o[1],P=(0,f.useState)(""),v=r()(P,2),y=v[0],b=v[1],w=(0,f.useRef)(),k=function(e){p.Z.confirm({width:500,title:m.ZP.get("更新"),content:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{children:m.ZP.get("已经是最新版了!")}),(0,Z.jsxs)("div",{style:{fontSize:12,fontWeight:400,marginTop:5},children:[m.ZP.get("青龙")," ",e.lastVersion," ",m.ZP.get("是目前检测到的最新可用版本了。")]})]}),okText:m.ZP.get("重新下载"),onOk:function(){C(),s.W.put("".concat(a.Z.apiPrefix,"system/update")).then((function(e){})).catch((function(e){console.log(e)}))}})},j=function(e){var n=e.lastVersion,o=e.lastLog;p.Z.confirm({width:500,title:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{children:m.ZP.get("更新可用")}),(0,Z.jsxs)("div",{style:{fontSize:12,fontWeight:400,marginTop:5},children:[m.ZP.get("新版本")," ",n," ",m.ZP.get("可用,你使用的版本为")," ",t.version,"。"]})]}),content:(0,Z.jsx)("pre",{children:(0,Z.jsx)(u(),{children:o})}),okText:m.ZP.get("下载更新"),cancelText:m.ZP.get("以后再说"),onOk:function(){C(),s.W.put("".concat(a.Z.apiPrefix,"system/update")).then((function(e){})).catch((function(e){console.log(e)}))}})},C=function(){b(""),w.current=p.Z.info({width:600,maskClosable:!1,closable:!1,keyboard:!1,okButtonProps:{disabled:!0},title:m.ZP.get("下载更新中..."),centered:!0,content:(0,Z.jsx)("pre",{children:(0,Z.jsx)(u(),{children:y})})})},S=function(e){s.W.put("".concat(a.Z.apiPrefix,"update/").concat(e)).then((function(e){g.ZP.success({content:(0,Z.jsxs)("span",{children:[m.ZP.get("系统将在"),(0,Z.jsx)(x,{className:"inline-countdown",format:"ss",value:Date.now()+3e4}),m.ZP.get("秒后自动刷新")]}),duration:30}),(0,i.o4)(),setTimeout((function(){window.location.reload()}),3e4)})).catch((function(e){console.log(e)}))};(0,f.useEffect)((function(){if(y){var e=y.includes("失败,请检查");w.current.update({maskClosable:e,closable:e,okButtonProps:{disabled:!e},content:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("pre",{children:(0,Z.jsx)(u(),{children:y})}),(0,Z.jsx)("div",{id:"log-identifier",style:{paddingBottom:5}})]})})}}),[y]);var _=(0,f.useCallback)((function(e){var t=e.message;t.includes("失败,请检查")&&g.ZP.error(m.ZP.get("更新失败,请检查网络及日志或稍后再试")),setTimeout((function(){document.querySelector("#log-identifier").scrollIntoView({behavior:"smooth"})}),600),t.includes("更新包下载成功")&&setTimeout((function(){p.Z.confirm({width:600,maskClosable:!1,title:m.ZP.get("确认重启"),centered:!0,content:m.ZP.get("系统安装包下载成功,确认重启"),okText:m.ZP.get("重启"),onOk:function(){S("system")},onCancel:function(){w.current.update({maskClosable:!0,closable:!0,okButtonProps:{disabled:!1}})}})}),1e3),b((function(e){return"".concat(e).concat(t)}))}),[]);return(0,f.useEffect)((function(){var e=l.Z.getInstance();return e.subscribe("updateSystemVersion",_),function(){e.unsubscribe("updateSystemVersion",_)}}),[]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(h.Z,{type:"primary",onClick:function(){c||(d(!0),g.ZP.loading(m.ZP.get("检查更新中..."),0),s.W.put("".concat(a.Z.apiPrefix,"system/update-check")).then((function(e){var t=e.code,n=e.data;g.ZP.destroy(),200===t&&(n.hasNewVersion?j(n):k(n))})).catch((function(e){g.ZP.destroy(),console.log(e)})).finally((function(){d(!1)})))},children:m.ZP.get("检查更新")}),(0,Z.jsx)(h.Z,{type:"primary",onClick:function(){return S("reload")},style:{marginLeft:8},children:m.ZP.get("重新启动")})]})}},75887:function(e,t,n){"use strict";n.r(t);var o=n(26068),r=n.n(o),i=n(48305),a=n.n(i),s=n(72317),l=n(75271),c=n(72338),u=n(61508),d=n(17082),g=n(93481),p=n(20710),h=n(94978),f=(n(39817),n(78060)),m=n.n(f),Z=n(19334),x=n.n(Z),P=n(69325),v=n(52676),y={"dependence-proxy":"dependenceProxy","node-mirror":"nodeMirror","python-mirror":"pythonMirror","linux-mirror":"linuxMirror"};t.default=function(){var e=(0,l.useState)(),t=a()(e,2),n=t[0],o=t[1],i=c.Z.useForm(),f=a()(i,1)[0],Z=(0,l.useState)(""),b=a()(Z,2),w=b[0],k=b[1],j=(0,l.useState)(!1),C=a()(j,2),S=C[0],_=C[1],q=function(e){_(!0),k("in progress...\n"),h.W.put("".concat(p.Z.apiPrefix,"system/config/").concat(e),x()(n,y[e])).then((function(e){})).catch((function(){_(!1),k((function(e){return"".concat(e,"update mirror error")}))}))},I=function(e){_(!0),k(""),h.W.put("".concat(p.Z.apiPrefix,"system/config/").concat(e),x()(n,y[e])).then((function(e){var t=e.code;e.data;200===t&&u.ZP.success(s.ZP.get("更新成功"))})).catch((function(e){console.log(e)})).finally((function(){return _(!1)}))},B=function(e){var t=e.message;k((function(e){return"".concat(e).concat(t)})),(t.includes("update node mirror end")||t.includes("update linux mirror end"))&&_(!1)};return(0,l.useEffect)((function(){var e=P.Z.getInstance();return e.subscribe("updateNodeMirror",B),e.subscribe("updateLinuxMirror",B),function(){e.subscribe("updateNodeMirror",B),e.unsubscribe("updateLinuxMirror",B)}}),[]),(0,l.useEffect)((function(){h.W.get("".concat(p.Z.apiPrefix,"system/config")).then((function(e){var t=e.code,n=e.data;200===t&&n.info&&o(n.info)})).catch((function(e){console.log(e)}))}),[]),(0,v.jsxs)("div",{className:"dependence-config-wrapper",children:[(0,v.jsxs)(c.Z,{layout:"vertical",form:f,style:{flexShrink:0},children:[(0,v.jsx)(c.Z.Item,{label:s.ZP.get("代理"),name:"proxy",extra:s.ZP.get("代理与镜像源二选一即可"),tooltip:{title:s.ZP.get("代理地址, 支持HTTP(S)/SOCK5"),placement:"topLeft"},children:(0,v.jsxs)(d.Z.Group,{compact:!0,children:[(0,v.jsx)(d.Z,{placeholder:"http://1.1.1.1:8080",style:{width:250},value:null==n?void 0:n.dependenceProxy,onChange:function(e){o(r()(r()({},n),{},{dependenceProxy:e.target.value}))}}),(0,v.jsx)(g.Z,{type:"primary",loading:S,onClick:function(){I("dependence-proxy")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,v.jsx)(c.Z.Item,{label:s.ZP.get("Node 软件包镜像源"),name:"node",tooltip:s.ZP.get("NPM 镜像源"),children:(0,v.jsxs)(d.Z.Group,{compact:!0,children:[(0,v.jsx)(d.Z,{style:{width:250},placeholder:"https://registry.npmmirror.com",value:null==n?void 0:n.nodeMirror,onChange:function(e){o(r()(r()({},n),{},{nodeMirror:e.target.value}))}}),(0,v.jsx)(g.Z,{type:"primary",loading:S,onClick:function(){q("node-mirror")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,v.jsx)(c.Z.Item,{label:s.ZP.get("Python 软件包镜像源"),name:"python",tooltip:s.ZP.get("PyPI 镜像源"),children:(0,v.jsxs)(d.Z.Group,{compact:!0,children:[(0,v.jsx)(d.Z,{style:{width:250},placeholder:"https://pypi.doubanio.com/simple/",value:null==n?void 0:n.pythonMirror,onChange:function(e){o(r()(r()({},n),{},{pythonMirror:e.target.value}))}}),(0,v.jsx)(g.Z,{type:"primary",loading:S,onClick:function(){I("python-mirror")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,v.jsx)(c.Z.Item,{label:s.ZP.get("Linux 软件包镜像源"),name:"linux",tooltip:s.ZP.get("debian linux 镜像源"),children:(0,v.jsxs)(d.Z.Group,{compact:!0,children:[(0,v.jsx)(d.Z,{style:{width:250},placeholder:"http://mirrors.aliyun.com",value:null==n?void 0:n.linuxMirror,onChange:function(e){o(r()(r()({},n),{},{linuxMirror:e.target.value}))}}),(0,v.jsx)(g.Z,{type:"primary",loading:S,onClick:function(){q("linux-mirror")},style:{width:100},children:s.ZP.get("确认")})]})})]}),(0,v.jsx)("pre",{style:{fontFamily:"Source Code Pro",zoom:.83,maxHeight:"100%",overflowY:"auto"},children:(0,v.jsx)(m(),{children:w})})]})}},99918:function(e,t,n){"use strict";n.r(t);var o=n(26068),r=n.n(o),i=n(15558),a=n.n(i),s=n(48305),l=n.n(s),c=n(72317),u=n(75271),d=n(50691),g=n(47667),p=n(63505),h=n(59816),f=n(45520),m=n(61508),Z=n(93481),x=n(46035),P=n(10948),v=n(20710),y=n(40872),b=n(94978),w=n(20112),k=n(28423),j=n(28068),C=n(88939),S=n(13494),_=n(20228),q=n(51578),I=n(73591),B=n(82337),T=n(31038),M=(n(39817),n(30502)),W=n(24915),E=n(75887),D=n(52676),A=d.Z.Text,F="demo"===window.__ENV__DeployEnv;t.default=function(){var e=(0,T.useOutletContext)(),t=e.headerStyle,n=e.isPhone,o=e.user,i=e.theme,s=e.reloadUser,d=e.reloadTheme,R=e.systemInfo,H=[{title:c.ZP.get("名称"),dataIndex:"name",key:"name"},{title:"Client ID",dataIndex:"client_id",key:"client_id",render:function(e,t){return(0,D.jsx)(A,{copyable:!0,children:t.client_id})}},{title:"Client Secret",dataIndex:"client_secret",key:"client_secret",render:function(e,t){return(0,D.jsx)(A,{copyable:{text:t.client_secret},children:"*******"})}},{title:c.ZP.get("权限"),dataIndex:"scopes",key:"scopes",width:500,render:function(e,t){return(0,D.jsx)("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:t.scopes.map((function(e){return(0,D.jsx)(g.Z,{style:{marginRight:0},children:v.Z.scopesMap[e]},e)}))})}},{title:c.ZP.get("操作"),key:"action",render:function(e,t,o){var r=!n;return(0,D.jsxs)(p.Z,{size:"middle",style:{paddingLeft:8},children:[(0,D.jsx)(h.Z,{title:r?c.ZP.get("编辑"):"",children:(0,D.jsx)("a",{onClick:function(){return ye(t,o)},children:(0,D.jsx)(k.Z,{})})}),(0,D.jsx)(h.Z,{title:r?c.ZP.get("重置secret"):"",children:(0,D.jsx)("a",{onClick:function(){return we(t,o)},children:(0,D.jsx)(j.Z,{})})}),(0,D.jsx)(h.Z,{title:r?c.ZP.get("删除"):"",children:(0,D.jsx)("a",{onClick:function(){return be(t,o)},children:(0,D.jsx)(C.Z,{})})})]})}}],V=(0,u.useState)(!0),L=l()(V,2),O=L[0],U=L[1],z=(0,u.useState)([]),K=l()(z,2),N=K[0],G=K[1],Y=(0,u.useState)(!1),Q=l()(Y,2),X=Q[0],$=Q[1],J=(0,u.useState)(),ee=l()(J,2),te=ee[0],ne=ee[1],oe=(0,u.useState)("security"),re=l()(oe,2),ie=re[0],ae=re[1],se=(0,u.useState)([]),le=l()(se,2),ce=le[0],ue=le[1],de=(0,u.useState)(),ge=l()(de,2),pe=ge[0],he=ge[1],fe=(0,u.useRef)(null),me=(0,u.useState)(0),Ze=l()(me,2),xe=Ze[0],Pe=Ze[1];(0,M.Z)(fe,(function(e){var t,n=null===(t=e.target)||void 0===t?void 0:t.offsetHeight;n&&xe!==n-101&&Pe(n-101)}));var ve=function(){U(!0),b.W.get("".concat(v.Z.apiPrefix,"apps")).then((function(e){var t=e.code,n=e.data;200===t&&G(n)})).finally((function(){return U(!1)}))},ye=function(e,t){ne(e),$(!0)},be=function(e,t){f.Z.confirm({title:c.ZP.get("确认删除"),content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认删除应用")," ",(0,D.jsx)(A,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("吗")]}),onOk:function(){b.W.delete("".concat(v.Z.apiPrefix,"apps"),{data:[e.id]}).then((function(e){var n=e.code;e.data;if(200===n){m.ZP.success(c.ZP.get("删除成功"));var o=a()(N);o.splice(t,1),G(o)}}))},onCancel:function(){console.log("Cancel")}})},we=function(e,t){f.Z.confirm({title:c.ZP.get("确认重置"),content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认重置应用")," ",(0,D.jsx)(A,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("的Secret吗"),(0,D.jsx)("br",{}),(0,D.jsx)(A,{type:"secondary",children:c.ZP.get("重置Secret会让当前应用所有token失效")})]}),onOk:function(){b.W.put("".concat(v.Z.apiPrefix,"apps/").concat(e.id,"/reset-secret")).then((function(e){var t=e.code,n=e.data;200===t&&(m.ZP.success(c.ZP.get("重置成功")),ke(n))}))},onCancel:function(){console.log("Cancel")}})},ke=function(e){var t=N.findIndex((function(t){return t.id===e.id})),n=a()(N);-1===t?n.push(e):n.splice(t,1,r()({},e)),G(n)},je=function(){b.W.get("".concat(v.Z.apiPrefix,"user/notification")).then((function(e){var t=e.code,n=e.data;200===t&&he(n)})).catch((function(e){console.log(e)}))};return(0,u.useEffect)((function(){F&&ve()}),[]),(0,D.jsxs)(y.ZP,{className:"ql-container-wrapper ql-container-wrapper-has-tab ql-setting-container",title:c.ZP.get("系统设置"),header:{style:t},extra:"app"===ie?[(0,D.jsx)(Z.Z,{type:"primary",onClick:function(){return ne(null),void $(!0)},children:c.ZP.get("创建应用")},"2")]:[],children:[(0,D.jsx)("div",{ref:fe,style:{height:"100%"},children:(0,D.jsx)(x.Z,{style:{height:"100%"},defaultActiveKey:"security",size:"small",tabPosition:"top",onChange:function(e){ae(e),"app"===e?ve():"login"===e?b.W.get("".concat(v.Z.apiPrefix,"user/login-log")).then((function(e){var t=e.code,n=e.data;200===t&&ue(n)})).catch((function(e){console.log(e)})):"notification"===e&&je()},destroyInactiveTabPane:!0,items:[].concat(a()(F?[]:[{key:"security",label:c.ZP.get("安全设置"),children:(0,D.jsx)(S.default,{user:o,userChange:s})}]),[{key:"app",label:c.ZP.get("应用设置"),children:(0,D.jsx)(P.Z,{columns:H,pagination:!1,dataSource:N,rowKey:"id",size:"middle",scroll:{x:1e3,y:xe},loading:O})},{key:"notification",label:c.ZP.get("通知设置"),children:(0,D.jsx)(q.default,{data:pe})},{key:"syslog",label:c.ZP.get("系统日志"),children:(0,D.jsx)(W.default,{height:xe,theme:i})},{key:"login",label:c.ZP.get("登录日志"),children:(0,D.jsx)(_.default,{height:xe,data:ce})},{key:"dependence",label:c.ZP.get("依赖设置"),children:(0,D.jsx)(E.default,{})},{key:"other",label:c.ZP.get("其他设置"),children:(0,D.jsx)(I.default,{reloadTheme:d,systemInfo:R})},{key:"about",label:c.ZP.get("关于"),children:(0,D.jsx)(B.default,{systemInfo:R})}])})}),(0,D.jsx)(w.default,{visible:X,handleCancel:function(e){$(!1),e&&ke(e)},app:te})]})}},20228:function(e,t,n){"use strict";n.r(t);var o=n(72317),r=(n(75271),n(50691)),i=n(47667),a=n(10948),s=n(16483),l=n.n(s),c=n(52676),u=(r.Z.Text,r.Z.Link,function(e){return e[e["成功"]=0]="成功",e[e["失败"]=1]="失败",e}(u||{})),d=function(e){return e[e.success=0]="success",e[e.error=1]="error",e}(d||{}),g=[{title:o.ZP.get("序号"),width:50,render:function(e,t,n){return n+1}},{title:o.ZP.get("登录时间"),dataIndex:"timestamp",key:"timestamp",width:120,render:function(e,t){return l()(t.timestamp).format("YYYY-MM-DD HH:mm:ss")}},{title:o.ZP.get("登录地址"),dataIndex:"address",width:120,key:"address"},{title:o.ZP.get("登录IP"),dataIndex:"ip",width:100,key:"ip"},{title:o.ZP.get("登录设备"),dataIndex:"platform",key:"platform",width:80},{title:o.ZP.get("登录状态"),dataIndex:"status",key:"status",width:80,render:function(e,t){return(0,c.jsx)(i.Z,{color:d[t.status],style:{marginRight:0},children:o.ZP.get(u[t.status])})}}];t.default=function(e){var t=e.data,n=e.height;return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(a.Z,{columns:g,pagination:!1,dataSource:t,rowKey:"id",size:"middle",scroll:{x:1e3,y:n}})})}},51578:function(e,t,n){"use strict";n.r(t);var o=n(26068),r=n.n(o),i=n(48305),a=n.n(i),s=n(72317),l=n(75271),c=n(35181),u=n(72338),d=n(61508),g=n(17082),p=n(93481),h=n(94978),f=n(20710),m=n(52676),Z=c.Z.Option;t.default=function(e){var t=e.data,n=(0,l.useState)(!1),o=a()(n,2),i=o[0],x=o[1],P=(0,l.useState)("closed"),v=a()(P,2),y=v[0],b=v[1],w=(0,l.useState)([]),k=a()(w,2),j=k[0],C=k[1],S=u.Z.useForm(),_=a()(S,1)[0],q=function(e){b(e);var t=f.Z.notificationModeMap[e];C(t||[])};return(0,l.useEffect)((function(){t&&t.type&&(q(t.type),_.setFieldsValue(r()({},t)))}),[t]),(0,m.jsx)("div",{children:(0,m.jsxs)(u.Z,{onFinish:function(e){x(!0),"closed"==e.type&&(e.type=""),h.W.put("".concat(f.Z.apiPrefix,"user/notification"),e).then((function(t){var n=t.code;t.data;200===n&&d.ZP.success(e.type?s.ZP.get("通知发送成功"):s.ZP.get("通知关闭成功"))})).catch((function(e){console.log(e)})).finally((function(){return x(!1)}))},form:_,layout:"vertical",children:[(0,m.jsx)(u.Z.Item,{label:s.ZP.get("通知方式"),name:"type",rules:[{required:!0}],style:{maxWidth:400},initialValue:y,children:(0,m.jsx)(c.Z,{onChange:q,disabled:i,children:f.Z.notificationModes.map((function(e){return(0,m.jsx)(Z,{value:e.value,children:e.label},e.value)}))})}),j.map((function(e){return(0,m.jsx)(u.Z.Item,{label:e.label,name:e.label,extra:e.tip,rules:[{required:e.required}],style:{maxWidth:400},children:e.items?(0,m.jsx)(c.Z,{placeholder:e.placeholder||"".concat(s.ZP.get("请选择")," ").concat(e.label),disabled:i,children:e.items.map((function(e){return(0,m.jsx)(Z,{value:e.value,children:e.label||e.value},e.value)}))}):(0,m.jsx)(g.Z.TextArea,{disabled:i,autoSize:{minRows:1,maxRows:5},placeholder:e.placeholder||"".concat(s.ZP.get("请输入")," ").concat(e.label)})},e.label)})),(0,m.jsx)(p.Z,{type:"primary",htmlType:"submit",disabled:i,children:i?s.ZP.get("测试中..."):s.ZP.get("保存")})]})})}},73591:function(e,t,n){"use strict";n.r(t);var o=n(26068),r=n.n(o),i=n(48305),a=n.n(i),s=n(72317),l=n(75271),c=n(72338),u=n(61508),d=n(45520),g=n(94747),p=n(17082),h=n(56646),f=n(93481),m=n(35181),Z=n(6367),x=n(71571),P=n(20710),v=n(94978),y=n(8429),b=n(87105),w=(n(39817),n(79231)),k=n(84522),j=n(86443),C=n(19334),S=n.n(C),_=n(65609),q=n(52676),I={"log-remove-frequency":"logRemoveFrequency","cron-concurrency":"cronConcurrency"};t.default=function(e){var t=e.systemInfo,n=e.reloadTheme,o=localStorage.getItem("qinglong_dark_theme")||"auto",i=(0,l.useState)(),C=a()(i,2),B=C[0],T=C[1],M=c.Z.useForm(),W=a()(M,1)[0],E=(0,l.useState)(!1),D=a()(E,2),A=D[0],F=D[1],R=(0,j.default)(s.ZP.get("上传")),H=(0,j.default)(s.ZP.get("下载")),V=x||{},L=V.enable,O=V.disable,U=(V.exportGeneratedCSS,V.setFetchMethod),z=V.auto,K=function(e){v.W.put("".concat(P.Z.apiPrefix,"system/config/").concat(e),S()(B,I[e])).then((function(e){var t=e.code;e.data;200===t&&u.ZP.success(s.ZP.get("更新成功"))})).catch((function(e){console.log(e)}))};return(0,l.useEffect)((function(){v.W.get("".concat(P.Z.apiPrefix,"system/config")).then((function(e){var t=e.code,n=e.data;200===t&&n.info&&T(n.info)})).catch((function(e){console.log(e)}))}),[]),(0,q.jsxs)(c.Z,{layout:"vertical",form:W,children:[(0,q.jsx)(c.Z.Item,{label:s.ZP.get("主题"),name:"theme",initialValue:o,children:(0,q.jsxs)(g.ZP.Group,{onChange:function(e){var t=e.target.value;localStorage.setItem("qinglong_dark_theme",e.target.value),U(fetch),"dark"===t?L({}):"light"===t?O():z({}),n()},value:o,optionType:"button",buttonStyle:"solid",children:[(0,q.jsx)(g.ZP.Button,{value:"light",style:{width:70,textAlign:"center"},children:s.ZP.get("亮色")}),(0,q.jsx)(g.ZP.Button,{value:"dark",style:{width:66,textAlign:"center"},children:s.ZP.get("暗色")}),(0,q.jsx)(g.ZP.Button,{value:"auto",style:{width:129,textAlign:"center"},children:s.ZP.get("跟随系统")})]})}),(0,q.jsx)(c.Z.Item,{label:s.ZP.get("日志删除频率"),name:"frequency",tooltip:s.ZP.get("每x天自动删除x天以前的日志"),children:(0,q.jsxs)(p.Z.Group,{compact:!0,children:[(0,q.jsx)(h.Z,{addonBefore:s.ZP.get("每"),addonAfter:s.ZP.get("天"),style:{width:180},min:0,value:null==B?void 0:B.logRemoveFrequency,onChange:function(e){T(r()(r()({},B),{},{logRemoveFrequency:e}))}}),(0,q.jsx)(f.Z,{type:"primary",onClick:function(){K("log-remove-frequency")},style:{width:84},children:s.ZP.get("确认")})]})}),(0,q.jsx)(c.Z.Item,{label:s.ZP.get("定时任务并发数"),name:"frequency",children:(0,q.jsxs)(p.Z.Group,{compact:!0,children:[(0,q.jsx)(h.Z,{style:{width:180},min:1,value:null==B?void 0:B.cronConcurrency,onChange:function(e){T(r()(r()({},B),{},{cronConcurrency:e}))}}),(0,q.jsx)(f.Z,{type:"primary",onClick:function(){K("cron-concurrency")},style:{width:84},children:s.ZP.get("确认")})]})}),(0,q.jsx)(c.Z.Item,{label:s.ZP.get("语言"),name:"lang",children:(0,q.jsx)(m.Z,{defaultValue:localStorage.getItem("lang")||"",style:{width:264},onChange:function(e){localStorage.setItem("lang",e),setTimeout((function(){window.location.reload()}),500)},options:[{value:"",label:s.ZP.get("跟随系统")},{value:"zh",label:"简体中文"},{value:"en",label:"English"}]})}),(0,q.jsxs)(c.Z.Item,{label:s.ZP.get("数据备份还原"),name:"frequency",children:[(0,q.jsx)(f.Z,{type:"primary",onClick:function(){F(!0),v.W.put("".concat(P.Z.apiPrefix,"system/data/export"),{},{responseType:"blob",timeout:864e5,onDownloadProgress:function(e){e.progress&&H(parseFloat((100*e.progress).toFixed(1)))}}).then((function(e){(0,b.saveAs)(e,"data.tgz")})).catch((function(e){console.log(e)})).finally((function(){return F(!1)}))},loading:A,children:A?s.ZP.get("生成数据中..."):s.ZP.get("备份")}),(0,q.jsx)(Z.Z,{method:"put",showUploadList:!1,maxCount:1,action:"".concat(P.Z.apiPrefix,"system/data/import"),onChange:function(e){var t=e.file,n=e.event;null!=n&&n.percent&&R(Math.min(parseFloat(null==n?void 0:n.percent.toFixed(1)),99)),"done"===t.status&&(R(100),d.Z.confirm({width:600,maskClosable:!1,title:s.ZP.get("确认重启"),centered:!0,content:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("div",{children:s.ZP.get("备份数据上传成功,确认覆盖数据")}),(0,q.jsxs)("div",{children:[s.ZP.get("如果恢复失败,可进入容器执行")," ql reload data"]})]}),okText:s.ZP.get("重启"),onOk:function(){v.W.put("".concat(P.Z.apiPrefix,"update/data")).then((function(){u.ZP.success({content:(0,q.jsxs)("span",{children:[s.ZP.get("系统将在"),(0,q.jsx)(k.Z,{className:"inline-countdown",format:"ss",value:Date.now()+3e4}),s.ZP.get("秒后自动刷新")]}),duration:30}),(0,_.o4)(),setTimeout((function(){window.location.reload()}),3e4)})).catch((function(e){console.log(e)}))}})),"error"===t.status&&u.ZP.error("上传失败")},name:"data",headers:{Authorization:"Bearer ".concat(localStorage.getItem(P.Z.authKey))},children:(0,q.jsx)(f.Z,{icon:(0,q.jsx)(w.Z,{}),style:{marginLeft:8},children:s.ZP.get("还原数据")})})]}),(0,q.jsx)(c.Z.Item,{label:s.ZP.get("检查更新"),name:"update",children:(0,q.jsx)(y.default,{systemInfo:t})})]})}},86443:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return c}});var o=n(72317),r=n(46016),i=n(45520),a=n(75271),s=n(52676),l=function(e){var t=e.percent;return(0,s.jsx)(r.Z,{style:{display:"flex",justifyContent:"center"},type:"circle",percent:t})};function c(e){var t=(0,a.useRef)();return function(n){t.current?(t.current.update({title:"".concat(e).concat(n>=100?o.ZP.get("成功"):o.ZP.get("中...")),content:(0,s.jsx)(l,{percent:n}),okButtonProps:{disabled:100!==n}}),100===n&&setTimeout((function(){var e;null===(e=t.current)||void 0===e||e.destroy(),t.current=null}))):t.current=i.Z.info({width:600,maskClosable:!1,title:"".concat(e).concat(n>=100?o.ZP.get("成功"):o.ZP.get("中...")),centered:!0,content:(0,s.jsx)(l,{percent:n}),okButtonProps:{disabled:!0}})}}},13494:function(e,t,n){"use strict";n.r(t);var o=n(48305),r=n.n(o),i=n(72317),a=n(75271),s=n(50691),l=n(61508),c=n(17082),u=n(93481),d=n(72338),g=n(70892),p=n(6367),h=n(94978),f=n(20710),m=n(31038),Z=n(63392),x=n.n(Z),P=n(40276),v=n(1371),y=n(79231),b=n(69822),w=(n(72540),n(52676)),k=s.Z.Title,j=s.Z.Link;t.default=function(e){var t=e.user,n=e.userChange,o=(0,a.useState)(!1),s=r()(o,2),Z=s[0],C=s[1],S=(0,a.useState)(),_=r()(S,2),q=_[0],I=_[1],B=(0,a.useState)(!1),T=r()(B,2),M=T[0],W=T[1],E=(0,a.useState)(),D=r()(E,2),A=D[0],F=D[1],R=(0,a.useState)(),H=r()(R,2),V=H[0],L=H[1],O=(0,a.useState)(),U=r()(O,2),z=U[0],K=U[1],N=function(){h.W.put("".concat(f.Z.apiPrefix,"user/two-factor/deactive")).then((function(e){var t=e.code,o=e.data;200===t&&o&&(I(!1),n())})).catch((function(e){console.log(e)}))},G=function(){h.W.get("".concat(f.Z.apiPrefix,"user/two-factor/init")).then((function(e){var t=e.code,n=e.data;200===t&&F(n)})).catch((function(e){console.log(e)}))};return(0,a.useEffect)((function(){I(t&&t.twoFactorActivated),K(t.avatar&&"".concat(f.Z.apiPrefix,"static/").concat(t.avatar))}),[t]),M?(0,w.jsx)(w.Fragment,{children:A?(0,w.jsxs)("div",{children:[(0,w.jsx)(k,{level:5,children:i.ZP.get("第一步")}),i.ZP.get("下载两步验证手机应用,比如 Google Authenticator 、"),(0,w.jsx)(j,{href:"https://www.microsoft.com/en-us/security/mobile-authenticator-app",target:"_blank",children:"Microsoft Authenticator"}),"、",(0,w.jsx)(j,{href:"https://authy.com/download/",target:"_blank",children:"Authy"}),"、",(0,w.jsx)(j,{href:"https://support.1password.com/one-time-passwords/",target:"_blank",children:"1Password"}),"、",(0,w.jsx)(j,{href:"https://support.logmeininc.com/lastpass/help/lastpass-authenticator-lp030014",target:"_blank",children:"LastPass Authenticator"}),(0,w.jsx)(k,{style:{marginTop:5},level:5,children:i.ZP.get("第二步")}),i.ZP.get("使用手机应用扫描二维码,或者输入秘钥")," ",null==A?void 0:A.secret,(0,w.jsx)("div",{style:{marginTop:10},children:(0,w.jsx)(x(),{style:{border:"1px solid #21262d",borderRadius:6},includeMargin:!0,size:187,value:null==A?void 0:A.url})}),(0,w.jsx)(k,{style:{marginTop:5},level:5,children:i.ZP.get("第三步")}),i.ZP.get("输入手机应用上的6位数字"),(0,w.jsx)(c.Z,{style:{margin:"10px 0 10px 0",display:"block",maxWidth:200},value:V,onChange:function(e){return L(e.target.value)},placeholder:"123456"}),(0,w.jsx)(u.Z,{type:"primary",loading:Z,onClick:function(){C(!0),h.W.put("".concat(f.Z.apiPrefix,"user/two-factor/active"),{code:V}).then((function(e){var t=e.code,o=e.data;200===t&&(o?(l.ZP.success(i.ZP.get("激活成功")),W(!1),I(!0),n()):l.ZP.success(i.ZP.get("验证失败")))})).catch((function(e){console.log(e)})).finally((function(){return C(!1)}))},children:i.ZP.get("完成设置")})]}):(0,w.jsx)(P.Z,{})}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4},children:i.ZP.get("修改用户名密码")}),(0,w.jsxs)(d.Z,{onFinish:function(e){h.W.put("".concat(f.Z.apiPrefix,"user"),{username:e.username,password:e.password}).then((function(e){var t=e.code;e.data;200===t&&(localStorage.removeItem(f.Z.authKey),m.history.push("/login"))})).catch((function(e){console.log(e)}))},layout:"vertical",children:[(0,w.jsx)(d.Z.Item,{label:i.ZP.get("用户名"),name:"username",rules:[{required:!0}],hasFeedback:!0,style:{maxWidth:300},children:(0,w.jsx)(c.Z,{autoComplete:"username",placeholder:i.ZP.get("用户名")})}),(0,w.jsx)(d.Z.Item,{label:i.ZP.get("密码"),name:"password",rules:[{required:!0},{pattern:/^(?!admin$).*$/,message:i.ZP.get("密码不能为admin")}],hasFeedback:!0,style:{maxWidth:300},children:(0,w.jsx)(c.Z,{type:"password",autoComplete:"current-password",placeholder:i.ZP.get("密码")})}),(0,w.jsx)(u.Z,{type:"primary",htmlType:"submit",children:i.ZP.get("保存")})]}),(0,w.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4,marginTop:16},children:i.ZP.get("两步验证")}),(0,w.jsx)(u.Z,{type:"primary",danger:q,onClick:function(){q?N():(G(),W(!0))},children:q?i.ZP.get("禁用"):i.ZP.get("启用")}),(0,w.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4,marginTop:16},children:i.ZP.get("头像")}),(0,w.jsx)(g.C,{size:128,shape:"square",icon:(0,w.jsx)(v.Z,{}),src:z}),(0,w.jsx)(b.Z,{rotationSlider:!0,children:(0,w.jsx)(p.Z,{method:"put",showUploadList:!1,maxCount:1,action:"".concat(f.Z.apiPrefix,"user/avatar"),onChange:function(e){e.file&&e.file.response&&(K("".concat(f.Z.apiPrefix,"static/").concat(e.file.response.data)),n())},name:"avatar",headers:{Authorization:"Bearer ".concat(localStorage.getItem(f.Z.authKey))},children:(0,w.jsx)(u.Z,{icon:(0,w.jsx)(y.Z,{}),style:{marginLeft:8},children:i.ZP.get("更换头像")})})})]})}},24915:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return N}});var o=n(90228),r=n.n(o),i=n(87999),a=n.n(i),s=n(48305),l=n.n(s),c=n(72317),u=n(75271),d=n(71742),g=n(19116),p=n(61508),h=n(93481),f=n(20553),m=n(98705),Z=n(54075),x=n(2727),P=n(94978),v=n(20710),y=n(31352),b=n(11333),w=n.n(b),k=n(25298),j=n.n(k),C=n(17069),S=n.n(C),_=n(82092),q=n.n(_),I=n(5174),B=n(80403),T=/\[\ue6f5info\]/g,M=/\[\ue67fdebug\]/g,W=/\[\ue880warn\]/g,E=/\[\ue602error\]/g,D="system-log-info",A="system-warn-info",F="system-error-info",R="system-debug-info",H=I.lg.fromClass(function(){function e(t){j()(this,e),q()(this,"decorations",void 0),this.decorations=this.getDecorations(t)}return S()(e,[{key:"update",value:function(e){e.docChanged&&(this.decorations=this.getDecorations(e.view))}},{key:"getDecorations",value:function(e){for(var t,n=new B.f_,o=e.state.doc.toString();null!==(t=T.exec(o));){var r=I.p.mark({class:D});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),V=I.lg.fromClass(function(){function e(t){j()(this,e),q()(this,"decorations",void 0),this.decorations=this.getDecorations(t)}return S()(e,[{key:"update",value:function(e){e.docChanged&&(this.decorations=this.getDecorations(e.view))}},{key:"getDecorations",value:function(e){for(var t,n=new B.f_,o=e.state.doc.toString();null!==(t=W.exec(o));){var r=I.p.mark({class:A});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),L=I.lg.fromClass(function(){function e(t){j()(this,e),q()(this,"decorations",void 0),this.decorations=this.getDecorations(t)}return S()(e,[{key:"update",value:function(e){e.docChanged&&(this.decorations=this.getDecorations(e.view))}},{key:"getDecorations",value:function(e){for(var t,n=new B.f_,o=e.state.doc.toString();null!==(t=M.exec(o));){var r=I.p.mark({class:R});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),O=I.lg.fromClass(function(){function e(t){j()(this,e),q()(this,"decorations",void 0),this.decorations=this.getDecorations(t)}return S()(e,[{key:"update",value:function(e){e.docChanged&&(this.decorations=this.getDecorations(e.view))}},{key:"getDecorations",value:function(e){for(var t,n=new B.f_,o=e.state.doc.toString();null!==(t=E.exec(o));){var r=I.p.mark({class:F});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),U=I.tk.baseTheme({".system-log-info":{color:"#2196F3"},".system-warn-info":{color:"#FFB827"},".system-error-info":{color:"#FA5151"},".system-debug-info":{color:"#009A29"}}),z=n(52676),K=g.Z.RangePicker,N=function(e){var t=e.height,n=e.theme,o=(0,u.useRef)(null),i=(0,u.useRef)(),s=(0,u.useState)(["",""]),g=l()(s,2),b=g[0],k=g[1],j=(0,u.useState)(""),C=l()(j,2),S=C[0],_=C[1],q=(0,y.Z)((function(){return P.W.get("".concat(v.Z.apiPrefix,"system/log?startTime=").concat(b[0],"&endTime=").concat(b[1]),{responseType:"blob"})}),{refreshDeps:[b],onSuccess:function(e){return a()(r()().mark((function t(){return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=_,t.next=3,e.text();case 3:t.t1=t.sent,(0,t.t0)(t.t1);case 5:case"end":return t.stop()}}),t)})))()}}),I=q.loading,B=q.refresh,T=function(e){o.current.scrollDOM.scrollTo({top:"start"===e?0:o.current.scrollDOM.scrollHeight})};return(0,z.jsxs)("div",{style:{position:"relative"},children:[(0,z.jsxs)("div",{children:[(0,z.jsx)(K,{style:{marginBottom:12,marginRight:12},disabledDate:function(e){return e>w()()||e<w()().subtract(7,"days")},defaultValue:[w()(),w()()],onOpenChange:function(e){i.current=!!e&&["",""]},onCalendarChange:function(e,t,n){var o=n.range;i.current&&"boolean"!=typeof i.current&&("start"===o&&(i.current[0]=t[0]),"end"===o&&(i.current[1]=t[1]),i.current[0]&&i.current[1]&&k(t))}}),(0,z.jsx)(h.Z,{onClick:function(){P.W.delete("".concat(v.Z.apiPrefix,"system/log")).then((function(e){p.ZP.success("删除成功"),B()}))},children:c.ZP.get("清空日志")})]}),S?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(d.ZP,{maxHeight:"".concat(t,"px"),value:S,onCreateEditor:function(e){o.current=e},extensions:[L,O,H,V,U],readOnly:!0,theme:n.includes("dark")?"dark":"light"}),(0,z.jsxs)("div",{style:{position:"absolute",bottom:20,right:20,display:"flex",flexDirection:"column",gap:10},children:[(0,z.jsx)(h.Z,{size:"small",icon:(0,z.jsx)(Z.Z,{}),onClick:function(){T("start")}}),(0,z.jsx)(h.Z,{size:"small",icon:(0,z.jsx)(x.Z,{}),onClick:function(){T("end")}})]})]}):I?(0,z.jsx)(f.Z,{}):(0,z.jsx)(m.Z,{image:m.Z.PRESENTED_IMAGE_SIMPLE})]})}},20710:function(e,t,n){"use strict";var o=n(72317),r=window.__ENV__QlBaseUrl||"/";t.Z={siteName:o.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:o.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:o.ZP.get("定时任务"),value:"crons"},{name:o.ZP.get("环境变量"),value:"envs"},{name:o.ZP.get("订阅管理"),value:"subscriptions"},{name:o.ZP.get("配置文件"),value:"configs"},{name:o.ZP.get("脚本管理"),value:"scripts"},{name:o.ZP.get("日志管理"),value:"logs"},{name:o.ZP.get("依赖管理"),value:"dependencies"},{name:o.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:o.ZP.get("定时任务"),envs:o.ZP.get("环境变量"),subscriptions:o.ZP.get("订阅管理"),configs:o.ZP.get("配置文件"),scripts:o.ZP.get("脚本管理"),logs:o.ZP.get("日志管理"),dependencies:o.ZP.get("依赖管理"),system:o.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"ntfy",label:"Ntfy"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:o.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:o.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:o.ZP.get("钉钉机器人")},{value:"weWorkBot",label:o.ZP.get("企业微信机器人")},{value:"weWorkApp",label:o.ZP.get("企业微信应用")},{value:"aibotk",label:o.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:o.ZP.get("微加机器人")},{value:"wxPusherBot",label:"wxPusher"},{value:"chat",label:o.ZP.get("群晖chat")},{value:"email",label:o.ZP.get("邮箱")},{value:"lark",label:o.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:o.ZP.get("自定义通知")},{value:"closed",label:o.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:o.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:o.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:o.ZP.get("推送消息的优先级")}],ntfy:[{label:"ntfyUrl",tip:o.ZP.get("ntfy的url地址,例如 https://ntfy.sh"),required:!0},{label:"ntfyTopic",tip:o.ZP.get("ntfy的消息应用topic"),required:!0},{label:"ntfyPriority",tip:o.ZP.get("推送消息的优先级")}],chat:[{label:"chatUrl",tip:o.ZP.get("chat的url地址"),required:!0},{label:"chatToken",tip:o.ZP.get("chat的token码"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:o.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:o.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:o.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:o.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:o.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:o.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:o.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:o.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:o.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:o.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:o.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:o.ZP.get("BARK推送消息的跳转URL")},{label:"barkArchive",tip:o.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:o.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:o.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:o.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:o.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:o.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:o.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:o.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:o.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:o.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:o.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:o.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:o.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:o.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:o.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:o.ZP.get("请输入要发送的目标"),items:[{value:"room",label:o.ZP.get("群聊")},{value:"contact",label:o.ZP.get("好友")}]},{label:"aibotkName",tip:o.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:o.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:o.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:o.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")},{label:"pushplusTemplate",tip:o.ZP.get("发送模板")},{label:"pushplusChannel",tip:o.ZP.get("发送渠道")},{label:"pushplusWebhook",tip:o.ZP.get("webhook编码")},{label:"pushplusCallbackUrl",tip:o.ZP.get("发送结果回调地址")},{label:"pushplusTo",tip:o.ZP.get("好友令牌")}],wePlusBot:[{label:"wePlusBotToken",tip:o.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:o.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:o.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],wxPusherBot:[{label:"wxPusherBotAppToken",tip:o.ZP.get("wxPusherBot的appToken"),required:!0},{label:"wxPusherBotTopicIds",tip:o.ZP.get("wxPusherBot的topicIds"),required:!1},{label:"wxPusherBotUids",tip:o.ZP.get("wxPusherBot的uids"),required:!1}],lark:[{label:"larkKey",tip:o.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:o.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:o.ZP.get("邮箱地址"),required:!0},{label:"emailPass",tip:o.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0}],pushMe:[{label:"pushMeKey",tip:o.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0},{label:"pushMeUrl",tip:o.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:o.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:o.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:o.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:o.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:o.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:o.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:o.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:o.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":o.ZP.get("登录"),"/initialization":o.ZP.get("初始化"),"/crontab":o.ZP.get("定时任务"),"/env":o.ZP.get("环境变量"),"/subscription":o.ZP.get("订阅管理"),"/config":o.ZP.get("配置文件"),"/script":o.ZP.get("脚本管理"),"/diff":o.ZP.get("对比工具"),"/log":o.ZP.get("日志管理"),"/setting":o.ZP.get("系统设置"),"/error":o.ZP.get("错误日志"),"/dependence":o.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},94978:function(e,t,n){"use strict";n.d(t,{W:function(){return f}});var o=n(90228),r=n.n(o),i=n(87999),a=n.n(i),s=n(72317),l=n(61508),c=n(20710),u=n(31038),d=n(74799);l.ZP.config({duration:2});var g=Date.now(),p=d.Z.create({timeout:6e4,params:{t:g}}),h=["/api/user/login","/open/auth/token","/api/user/two-factor/login","/api/system","/api/user/init","/api/user/notification/init"];p.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})),p.interceptors.response.use(function(){var e=a()(r()().mark((function e(t){var n,o,i;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!==(o=t.data).code&&(i=o.message||o.data)&&l.ZP.error({content:i,style:{maxWidth:500,margin:"0 auto"}}),e.abrupt("return",o);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;if([502,504].includes(n))u.history.push("/error");else if(401===n)"/login"!==u.history.location.pathname&&(l.ZP.error(s.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(c.Z.authKey),u.history.push("/login"));else{var o,r;if("function"==typeof(null===(o=e.config)||void 0===o?void 0:o.onError))return null===(r=e.config)||void 0===r?void 0:r.onError(e.response);l.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}}else console.log(e.message);return Promise.reject(e)}));var f=p},65609:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},I1:function(){return g},o4:function(){return P},w7:function(){return d},DY:function(){return p},FA:function(){return f},rS:function(){return Z},H$:function(){return x},W9:function(){return u},x$:function(){return h}});var o=n(15558),r=n.n(o),i=n(72317),a={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript"},s=n(94046),l=n.n(s);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,".")},o="unknow";t(/windows|win32|win64|wow32|wow64/g)?o="windows":t(/macintosh|macintel/g)?o="macos":t(/x11/g)?o="linux":t(/android|adr/g)?o="android":t(/ios|iphone|ipad|ipod|iwatch/g)&&(o="ios");var r="unknow";"windows"===o?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"===o?r=n(/os x [\d._]+/g):"android"===o?r=n(/android [\d._]+/g):"ios"===o&&(r=n(/os [\d._]+/g));var i="unknow";"windows"===o||"macos"===o||"linux"===o?i="desktop":("android"===o||"ios"===o||t(/mobile/g))&&(i="mobile");var a="unknow",s="unknow";t(/applewebkit/g)?(a="webkit",t(/edge/g)?s="edge":t(/opr/g)?s="opera":t(/chrome/g)?s="chrome":t(/safari/g)&&(s="safari")):t(/gecko/g)&&t(/firefox/g)?(a="gecko",s="firefox"):t(/presto/g)?(a="presto",s="opera"):t(/trident|compatible|msie/g)&&(a="trident",s="iexplore");var l="unknow";"webkit"===a?l=n(/applewebkit\/[\d._]+/g):"gecko"===a?l=n(/gecko\/[\d._]+/g):"presto"===a?l=n(/presto\/[\d._]+/g):"trident"===a&&(l=n(/trident\/[\d._]+/g));var c="unknow";"chrome"===s?c=n(/chrome\/[\d._]+/g):"safari"===s?c=n(/version\/[\d._]+/g):"firefox"===s?c=n(/firefox\/[\d._]+/g):"opera"===s?c=n(/opr\/[\d._]+/g):"iexplore"===s?c=n(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===s&&(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:a,engineVs:l,platform:i,supporter:s,supporterVs:c,system:o,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 o=null,r=0;(o=n||document.querySelector(".ant-table-wrapper"))&&(r=o.getBoundingClientRect().top);var i=document.body.clientHeight-r-t;return i}function d(e,t){var n,o,r=window.URL||window.webkitURL||window,i=new Blob([t]),a=document.createElementNS("http://www.w3.org/1999/xhtml","a");a.href=r.createObjectURL(i),a.download=e,n=a,(o=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(o)}function g(e,t,n){var o=r()(e),i=[];return function e(o){if(o)for(var r=0;r<(null==o?void 0:o.length);r++){if(t(o[r]))return n?void(o[r].children?o[r].children.unshift(n):o[r].children=[n]):void o.splice(r,1);o[r].children&&(i.push(o[r].key),e(o[r].children))}}(o),o}function p(e,t){var n;return function e(o){if(o)for(var r=0;r<(null==o?void 0:o.length);r++)t(o[r])?n=o[r]:o[r].children&&e(o[r].children)}(r()(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 o,r,i="".concat(window.__ENV__QL_DIR,"/data/scripts");n.startsWith(i)&&(n=n.replace(i,""));var a=n.lastIndexOf("/");return a>=0?(r=n.slice(a+1),o=n.slice(0,a)):(r=n,o=""),[r,o]}}function m(e){try{var t=l().parseExpression(e);if(t)return t.next().toDate()}catch(e){}return null}function Z(e,t){var n=m(e);return null!=t&&t.length&&t.forEach((function(e){var t=m(e.schedule);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 a[t]}function P(){var e=document.createElement("div");e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="transparent",e.style.zIndex="9999",document.body.appendChild(e),e.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()})),document.body.style.overflow="hidden"}},69325:function(e,t,n){"use strict";var o=n(15558),r=n.n(o),i=n(67825),a=n.n(i),s=n(90228),l=n.n(s),c=n(87999),u=n.n(c),d=n(25298),g=n.n(d),p=n(17069),h=n.n(p),f=n(82092),m=n.n(f),Z=n(78078),x=n.n(Z),P=["type"],v=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g()(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()(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(x())(this.url),this.setupEventListeners(),this.startHeartbeat(),e.next=9,this.waitForClose();case 9:return this.stopHeartbeat(),this.socket=null,this.reconnectAttempts++,e.next=14,new Promise((function(e){return setTimeout(e,t.options.reconnectInterval)}));case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this.handleError(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(){return n.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.socket&&(this.socket.onopen=function(){e.state="open",e.emit("open")},this.socket.onmessage=function(t){var n=JSON.parse(t.data);e.dispatchMessage(n)},this.socket.onclose=function(){e.state="closed",e.emit("close")})}},{key:"waitForClose",value:(t=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)===x().CLOSED){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,100)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"subscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(!n.has(t)){n.add(t),this.subscriptions.set(e,n);var o={action:"subscribe",topic:e};this.send(o)}}},{key:"unsubscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(n.has(t)){n.delete(t);var o={action:"unsubscribe",topic:e};this.send(o)}}},{key:"send",value:function(e){var t;(null===(t=this.socket)||void 0===t?void 0:t.readyState)===x().OPEN&&this.socket.send(JSON.stringify(e))}},{key:"dispatchMessage",value:function(e){var t=e.type,n=a()(e,P),o=this.subscriptions.get(t)||new Set;r()(o).forEach((function(e){return e(n)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatTimeout=setInterval((function(){var t;(null===(t=e.socket)||void 0===t?void 0:t.readyState)===x().OPEN&&e.socket.send(JSON.stringify({type:"heartbeat"}))}),this.options.heartbeatInterval)}},{key:"stopHeartbeat",value:function(){this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout)}},{key:"close",value:function(){this.socket&&(this.state="closed",this.stopHeartbeat(),this.socket.close(),this.emit("close"))}},{key:"handleError",value:function(e){console.error("WebSocket错误:",e),this.emit("error",e)}},{key:"on",value:function(e,t){}},{key:"emit",value:function(e,t){}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return e.instance||(e.instance=new e(t,n)),e.instance}}]),e}();m()(v,"instance",null),t.Z=v},39817:function(){},50810:function(){}}]);
|
|
1
|
+
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[2340,4642],{82337:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var o=n(72317),r=(n(75271),n(50691)),i=n(18015),a="container___nww32",s="right___o0xXT",l="title___DHxWh",c="desc___frhI6",u=n(16483),d=n.n(u),g=n(52676),p=r.Z.Link,h=function(e){var t=e.systemInfo;return(0,g.jsxs)("div",{className:a,children:[(0,g.jsx)("img",{alt:"logo",style:{width:140,marginRight:20},src:"https://qn.whyour.cn/logo.png"}),(0,g.jsxs)("div",{className:s,children:[(0,g.jsx)("span",{className:l,children:o.ZP.get("青龙")}),(0,g.jsx)("span",{className:c,children:o.ZP.get("支持python3、javascript、shell、typescript 的定时任务管理面板")}),(0,g.jsxs)(i.Z,{children:[(0,g.jsxs)(i.Z.Item,{label:o.ZP.get("版本"),span:3,children:["develop"===(null==t?void 0:t.branch)?o.ZP.get("开发版"):o.ZP.get("正式版")," ","v",t.version]}),(0,g.jsx)(i.Z.Item,{label:o.ZP.get("更新时间"),span:3,children:d()(1e3*t.publishTime).format("YYYY-MM-DD HH:mm")}),(0,g.jsx)(i.Z.Item,{label:o.ZP.get("更新日志"),span:3,children:(0,g.jsx)(p,{href:"https://qn.whyour.cn/version.yaml?t=".concat(Date.now()),target:"_blank",children:o.ZP.get("查看")})})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)(p,{href:"https://github.com/whyour/qinglong",target:"_blank",style:{marginRight:15},children:"Github"}),(0,g.jsx)(p,{href:"https://t.me/jiao_long",target:"_blank",style:{marginRight:15},children:o.ZP.get("Telegram频道")}),(0,g.jsx)(p,{href:"https://github.com/whyour/qinglong/issues",target:"_blank",children:o.ZP.get("提交BUG")})]})]})]})}},20112:function(e,t,n){"use strict";n.r(t);var o=n(90228),r=n.n(o),i=n(26068),a=n.n(i),s=n(87999),l=n.n(s),c=n(48305),u=n.n(c),d=n(72317),g=n(75271),p=n(72338),h=n(61508),f=n(45520),m=n(17082),Z=n(35181),x=n(94978),P=n(20710),v=n(52676);t.default=function(e){var t=e.app,n=e.handleCancel,o=e.visible,i=p.Z.useForm(),s=u()(i,1)[0],c=(0,g.useState)(!1),y=u()(c,2),b=y[0],w=y[1],k=function(){var e=l()(r()().mark((function e(o){var i,s,l,c,u;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),i=t?"put":"post",s=a()({},o),t&&(s.id=t.id),e.prev=4,e.next=7,x.W[i]("".concat(P.Z.apiPrefix,"apps"),s);case 7:l=e.sent,c=l.code,u=l.data,200===c&&(h.ZP.success(t?d.ZP.get("更新应用成功"):d.ZP.get("创建应用成功")),n(u)),w(!1),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),w(!1);case 17:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(t){return e.apply(this,arguments)}}();return(0,g.useEffect)((function(){s.resetFields()}),[t,o]),(0,v.jsx)(f.Z,{title:t?d.ZP.get("编辑应用"):d.ZP.get("创建应用"),open:o,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){s.validateFields().then((function(e){k(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:b,children:(0,v.jsxs)(p.Z,{form:s,layout:"vertical",name:"form_app_modal",initialValues:t,children:[(0,v.jsx)(p.Z.Item,{name:"name",label:d.ZP.get("名称"),rules:[{validator:function(e,t){return["system"].includes(t)?Promise.reject(new Error(d.ZP.get("名称不能为保留关键字"))):Promise.resolve()}}],children:(0,v.jsx)(m.Z,{placeholder:d.ZP.get("请输入应用名称")})}),(0,v.jsx)(p.Z.Item,{name:"scopes",label:d.ZP.get("权限"),rules:[{required:!0}],children:(0,v.jsx)(Z.Z,{mode:"multiple",placeholder:d.ZP.get("请选择模块权限"),allowClear:!0,style:{width:"100%"},children:P.Z.scopes.map((function(e){return(0,v.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.value)}))})})]})})}},8429:function(e,t,n){"use strict";n.r(t);var o=n(48305),r=n.n(o),i=n(65609),a=n(20710),s=n(94978),l=n(69325),c=n(78060),u=n.n(c),d=n(32890),g=n(61508),p=n(45520),h=n(93481),f=n(75271),m=n(72317),Z=n(52676),x=d.Z.Countdown;t.default=function(e){var t=e.systemInfo,n=(0,f.useState)(!1),o=r()(n,2),c=o[0],d=o[1],P=(0,f.useState)(""),v=r()(P,2),y=v[0],b=v[1],w=(0,f.useRef)(),k=function(e){p.Z.confirm({width:500,title:m.ZP.get("更新"),content:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{children:m.ZP.get("已经是最新版了!")}),(0,Z.jsxs)("div",{style:{fontSize:12,fontWeight:400,marginTop:5},children:[m.ZP.get("青龙")," ",e.lastVersion," ",m.ZP.get("是目前检测到的最新可用版本了。")]})]}),okText:m.ZP.get("重新下载"),onOk:function(){C(),s.W.put("".concat(a.Z.apiPrefix,"system/update")).then((function(e){})).catch((function(e){console.log(e)}))}})},j=function(e){var n=e.lastVersion,o=e.lastLog;p.Z.confirm({width:500,title:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{children:m.ZP.get("更新可用")}),(0,Z.jsxs)("div",{style:{fontSize:12,fontWeight:400,marginTop:5},children:[m.ZP.get("新版本")," ",n," ",m.ZP.get("可用,你使用的版本为")," ",t.version,"。"]})]}),content:(0,Z.jsx)("pre",{children:(0,Z.jsx)(u(),{children:o})}),okText:m.ZP.get("下载更新"),cancelText:m.ZP.get("以后再说"),onOk:function(){C(),s.W.put("".concat(a.Z.apiPrefix,"system/update")).then((function(e){})).catch((function(e){console.log(e)}))}})},C=function(){b(""),w.current=p.Z.info({width:600,maskClosable:!1,closable:!1,keyboard:!1,okButtonProps:{disabled:!0},title:m.ZP.get("下载更新中..."),centered:!0,content:(0,Z.jsx)("pre",{children:(0,Z.jsx)(u(),{children:y})})})},S=function(e){s.W.put("".concat(a.Z.apiPrefix,"update/").concat(e)).then((function(e){g.ZP.success({content:(0,Z.jsxs)("span",{children:[m.ZP.get("系统将在"),(0,Z.jsx)(x,{className:"inline-countdown",format:"ss",value:Date.now()+3e4}),m.ZP.get("秒后自动刷新")]}),duration:30}),(0,i.o4)(),setTimeout((function(){window.location.reload()}),3e4)})).catch((function(e){console.log(e)}))};(0,f.useEffect)((function(){if(y){var e=y.includes("失败,请检查");w.current.update({maskClosable:e,closable:e,okButtonProps:{disabled:!e},content:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("pre",{children:(0,Z.jsx)(u(),{children:y})}),(0,Z.jsx)("div",{id:"log-identifier",style:{paddingBottom:5}})]})})}}),[y]);var _=(0,f.useCallback)((function(e){var t=e.message;t.includes("失败,请检查")&&g.ZP.error(m.ZP.get("更新失败,请检查网络及日志或稍后再试")),setTimeout((function(){document.querySelector("#log-identifier").scrollIntoView({behavior:"smooth"})}),600),t.includes("更新包下载成功")&&setTimeout((function(){p.Z.confirm({width:600,maskClosable:!1,title:m.ZP.get("确认重启"),centered:!0,content:m.ZP.get("系统安装包下载成功,确认重启"),okText:m.ZP.get("重启"),onOk:function(){S("system")},onCancel:function(){w.current.update({maskClosable:!0,closable:!0,okButtonProps:{disabled:!1}})}})}),1e3),b((function(e){return"".concat(e).concat(t)}))}),[]);return(0,f.useEffect)((function(){var e=l.Z.getInstance();return e.subscribe("updateSystemVersion",_),function(){e.unsubscribe("updateSystemVersion",_)}}),[]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(h.Z,{type:"primary",onClick:function(){c||(d(!0),g.ZP.loading(m.ZP.get("检查更新中..."),0),s.W.put("".concat(a.Z.apiPrefix,"system/update-check")).then((function(e){var t=e.code,n=e.data;g.ZP.destroy(),200===t&&(n.hasNewVersion?j(n):k(n))})).catch((function(e){g.ZP.destroy(),console.log(e)})).finally((function(){d(!1)})))},children:m.ZP.get("检查更新")}),(0,Z.jsx)(h.Z,{type:"primary",onClick:function(){return S("reload")},style:{marginLeft:8},children:m.ZP.get("重新启动")})]})}},75887:function(e,t,n){"use strict";n.r(t);var o=n(26068),r=n.n(o),i=n(48305),a=n.n(i),s=n(72317),l=n(75271),c=n(72338),u=n(61508),d=n(17082),g=n(93481),p=n(20710),h=n(94978),f=(n(39817),n(78060)),m=n.n(f),Z=n(19334),x=n.n(Z),P=n(69325),v=n(52676),y={"dependence-proxy":"dependenceProxy","node-mirror":"nodeMirror","python-mirror":"pythonMirror","linux-mirror":"linuxMirror"};t.default=function(){var e=(0,l.useState)(),t=a()(e,2),n=t[0],o=t[1],i=c.Z.useForm(),f=a()(i,1)[0],Z=(0,l.useState)(""),b=a()(Z,2),w=b[0],k=b[1],j=(0,l.useState)(!1),C=a()(j,2),S=C[0],_=C[1],q=function(e){_(!0),k("in progress...\n"),h.W.put("".concat(p.Z.apiPrefix,"system/config/").concat(e),x()(n,y[e])).then((function(e){})).catch((function(){_(!1),k((function(e){return"".concat(e,"update mirror error")}))}))},I=function(e){_(!0),k(""),h.W.put("".concat(p.Z.apiPrefix,"system/config/").concat(e),x()(n,y[e])).then((function(e){var t=e.code;e.data;200===t&&u.ZP.success(s.ZP.get("更新成功"))})).catch((function(e){console.log(e)})).finally((function(){return _(!1)}))},B=function(e){var t=e.message;k((function(e){return"".concat(e).concat(t)})),(t.includes("update node mirror end")||t.includes("update linux mirror end"))&&_(!1)};return(0,l.useEffect)((function(){var e=P.Z.getInstance();return e.subscribe("updateNodeMirror",B),e.subscribe("updateLinuxMirror",B),function(){e.subscribe("updateNodeMirror",B),e.unsubscribe("updateLinuxMirror",B)}}),[]),(0,l.useEffect)((function(){h.W.get("".concat(p.Z.apiPrefix,"system/config")).then((function(e){var t=e.code,n=e.data;200===t&&n.info&&o(n.info)})).catch((function(e){console.log(e)}))}),[]),(0,v.jsxs)("div",{className:"dependence-config-wrapper",children:[(0,v.jsxs)(c.Z,{layout:"vertical",form:f,style:{flexShrink:0},children:[(0,v.jsx)(c.Z.Item,{label:s.ZP.get("代理"),name:"proxy",extra:s.ZP.get("代理与镜像源二选一即可"),tooltip:{title:s.ZP.get("代理地址, 支持HTTP(S)/SOCK5"),placement:"topLeft"},children:(0,v.jsxs)(d.Z.Group,{compact:!0,children:[(0,v.jsx)(d.Z,{placeholder:"http://1.1.1.1:8080",style:{width:250},value:null==n?void 0:n.dependenceProxy,onChange:function(e){o(r()(r()({},n),{},{dependenceProxy:e.target.value}))}}),(0,v.jsx)(g.Z,{type:"primary",loading:S,onClick:function(){I("dependence-proxy")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,v.jsx)(c.Z.Item,{label:s.ZP.get("Node 软件包镜像源"),name:"node",tooltip:s.ZP.get("NPM 镜像源"),children:(0,v.jsxs)(d.Z.Group,{compact:!0,children:[(0,v.jsx)(d.Z,{style:{width:250},placeholder:"https://registry.npmmirror.com",value:null==n?void 0:n.nodeMirror,onChange:function(e){o(r()(r()({},n),{},{nodeMirror:e.target.value}))}}),(0,v.jsx)(g.Z,{type:"primary",loading:S,onClick:function(){q("node-mirror")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,v.jsx)(c.Z.Item,{label:s.ZP.get("Python 软件包镜像源"),name:"python",tooltip:s.ZP.get("PyPI 镜像源"),children:(0,v.jsxs)(d.Z.Group,{compact:!0,children:[(0,v.jsx)(d.Z,{style:{width:250},placeholder:"https://pypi.doubanio.com/simple/",value:null==n?void 0:n.pythonMirror,onChange:function(e){o(r()(r()({},n),{},{pythonMirror:e.target.value}))}}),(0,v.jsx)(g.Z,{type:"primary",loading:S,onClick:function(){I("python-mirror")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,v.jsx)(c.Z.Item,{label:s.ZP.get("Linux 软件包镜像源"),name:"linux",tooltip:s.ZP.get("debian linux 镜像源"),children:(0,v.jsxs)(d.Z.Group,{compact:!0,children:[(0,v.jsx)(d.Z,{style:{width:250},placeholder:"http://mirrors.aliyun.com",value:null==n?void 0:n.linuxMirror,onChange:function(e){o(r()(r()({},n),{},{linuxMirror:e.target.value}))}}),(0,v.jsx)(g.Z,{type:"primary",loading:S,onClick:function(){q("linux-mirror")},style:{width:100},children:s.ZP.get("确认")})]})})]}),(0,v.jsx)("pre",{style:{fontFamily:"Source Code Pro",zoom:.83,maxHeight:"100%",overflowY:"auto"},children:(0,v.jsx)(m(),{children:w})})]})}},99918:function(e,t,n){"use strict";n.r(t);var o=n(26068),r=n.n(o),i=n(15558),a=n.n(i),s=n(48305),l=n.n(s),c=n(72317),u=n(75271),d=n(50691),g=n(47667),p=n(63505),h=n(59816),f=n(45520),m=n(61508),Z=n(93481),x=n(46035),P=n(10948),v=n(20710),y=n(40872),b=n(94978),w=n(20112),k=n(28423),j=n(28068),C=n(88939),S=n(13494),_=n(20228),q=n(51578),I=n(73591),B=n(82337),T=n(31038),M=(n(39817),n(30502)),W=n(24915),E=n(75887),D=n(52676),A=d.Z.Text,F="demo"===window.__ENV__DeployEnv;t.default=function(){var e=(0,T.useOutletContext)(),t=e.headerStyle,n=e.isPhone,o=e.user,i=e.theme,s=e.reloadUser,d=e.reloadTheme,R=e.systemInfo,H=[{title:c.ZP.get("名称"),dataIndex:"name",key:"name"},{title:"Client ID",dataIndex:"client_id",key:"client_id",render:function(e,t){return(0,D.jsx)(A,{copyable:!0,children:t.client_id})}},{title:"Client Secret",dataIndex:"client_secret",key:"client_secret",render:function(e,t){return(0,D.jsx)(A,{copyable:{text:t.client_secret},children:"*******"})}},{title:c.ZP.get("权限"),dataIndex:"scopes",key:"scopes",width:500,render:function(e,t){return(0,D.jsx)("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:t.scopes.map((function(e){return(0,D.jsx)(g.Z,{style:{marginRight:0},children:v.Z.scopesMap[e]},e)}))})}},{title:c.ZP.get("操作"),key:"action",render:function(e,t,o){var r=!n;return(0,D.jsxs)(p.Z,{size:"middle",style:{paddingLeft:8},children:[(0,D.jsx)(h.Z,{title:r?c.ZP.get("编辑"):"",children:(0,D.jsx)("a",{onClick:function(){return ye(t,o)},children:(0,D.jsx)(k.Z,{})})}),(0,D.jsx)(h.Z,{title:r?c.ZP.get("重置secret"):"",children:(0,D.jsx)("a",{onClick:function(){return we(t,o)},children:(0,D.jsx)(j.Z,{})})}),(0,D.jsx)(h.Z,{title:r?c.ZP.get("删除"):"",children:(0,D.jsx)("a",{onClick:function(){return be(t,o)},children:(0,D.jsx)(C.Z,{})})})]})}}],V=(0,u.useState)(!0),L=l()(V,2),O=L[0],U=L[1],z=(0,u.useState)([]),K=l()(z,2),N=K[0],G=K[1],Y=(0,u.useState)(!1),Q=l()(Y,2),X=Q[0],$=Q[1],J=(0,u.useState)(),ee=l()(J,2),te=ee[0],ne=ee[1],oe=(0,u.useState)("security"),re=l()(oe,2),ie=re[0],ae=re[1],se=(0,u.useState)([]),le=l()(se,2),ce=le[0],ue=le[1],de=(0,u.useState)(),ge=l()(de,2),pe=ge[0],he=ge[1],fe=(0,u.useRef)(null),me=(0,u.useState)(0),Ze=l()(me,2),xe=Ze[0],Pe=Ze[1];(0,M.Z)(fe,(function(e){var t,n=null===(t=e.target)||void 0===t?void 0:t.offsetHeight;n&&xe!==n-101&&Pe(n-101)}));var ve=function(){U(!0),b.W.get("".concat(v.Z.apiPrefix,"apps")).then((function(e){var t=e.code,n=e.data;200===t&&G(n)})).finally((function(){return U(!1)}))},ye=function(e,t){ne(e),$(!0)},be=function(e,t){f.Z.confirm({title:c.ZP.get("确认删除"),content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认删除应用")," ",(0,D.jsx)(A,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("吗")]}),onOk:function(){b.W.delete("".concat(v.Z.apiPrefix,"apps"),{data:[e.id]}).then((function(e){var n=e.code;e.data;if(200===n){m.ZP.success(c.ZP.get("删除成功"));var o=a()(N);o.splice(t,1),G(o)}}))},onCancel:function(){console.log("Cancel")}})},we=function(e,t){f.Z.confirm({title:c.ZP.get("确认重置"),content:(0,D.jsxs)(D.Fragment,{children:[c.ZP.get("确认重置应用")," ",(0,D.jsx)(A,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",c.ZP.get("的Secret吗"),(0,D.jsx)("br",{}),(0,D.jsx)(A,{type:"secondary",children:c.ZP.get("重置Secret会让当前应用所有token失效")})]}),onOk:function(){b.W.put("".concat(v.Z.apiPrefix,"apps/").concat(e.id,"/reset-secret")).then((function(e){var t=e.code,n=e.data;200===t&&(m.ZP.success(c.ZP.get("重置成功")),ke(n))}))},onCancel:function(){console.log("Cancel")}})},ke=function(e){var t=N.findIndex((function(t){return t.id===e.id})),n=a()(N);-1===t?n.push(e):n.splice(t,1,r()({},e)),G(n)},je=function(){b.W.get("".concat(v.Z.apiPrefix,"user/notification")).then((function(e){var t=e.code,n=e.data;200===t&&he(n)})).catch((function(e){console.log(e)}))};return(0,u.useEffect)((function(){F&&ve()}),[]),(0,D.jsxs)(y.ZP,{className:"ql-container-wrapper ql-container-wrapper-has-tab ql-setting-container",title:c.ZP.get("系统设置"),header:{style:t},extra:"app"===ie?[(0,D.jsx)(Z.Z,{type:"primary",onClick:function(){return ne(null),void $(!0)},children:c.ZP.get("创建应用")},"2")]:[],children:[(0,D.jsx)("div",{ref:fe,style:{height:"100%"},children:(0,D.jsx)(x.Z,{style:{height:"100%"},defaultActiveKey:"security",size:"small",tabPosition:"top",onChange:function(e){ae(e),"app"===e?ve():"login"===e?b.W.get("".concat(v.Z.apiPrefix,"user/login-log")).then((function(e){var t=e.code,n=e.data;200===t&&ue(n)})).catch((function(e){console.log(e)})):"notification"===e&&je()},destroyInactiveTabPane:!0,items:[].concat(a()(F?[]:[{key:"security",label:c.ZP.get("安全设置"),children:(0,D.jsx)(S.default,{user:o,userChange:s})}]),[{key:"app",label:c.ZP.get("应用设置"),children:(0,D.jsx)(P.Z,{columns:H,pagination:!1,dataSource:N,rowKey:"id",size:"middle",scroll:{x:1e3,y:xe},loading:O})},{key:"notification",label:c.ZP.get("通知设置"),children:(0,D.jsx)(q.default,{data:pe})},{key:"syslog",label:c.ZP.get("系统日志"),children:(0,D.jsx)(W.default,{height:xe,theme:i})},{key:"login",label:c.ZP.get("登录日志"),children:(0,D.jsx)(_.default,{height:xe,data:ce})},{key:"dependence",label:c.ZP.get("依赖设置"),children:(0,D.jsx)(E.default,{})},{key:"other",label:c.ZP.get("其他设置"),children:(0,D.jsx)(I.default,{reloadTheme:d,systemInfo:R})},{key:"about",label:c.ZP.get("关于"),children:(0,D.jsx)(B.default,{systemInfo:R})}])})}),(0,D.jsx)(w.default,{visible:X,handleCancel:function(e){$(!1),e&&ke(e)},app:te})]})}},20228:function(e,t,n){"use strict";n.r(t);var o=n(72317),r=(n(75271),n(50691)),i=n(47667),a=n(10948),s=n(16483),l=n.n(s),c=n(52676),u=(r.Z.Text,r.Z.Link,function(e){return e[e["成功"]=0]="成功",e[e["失败"]=1]="失败",e}(u||{})),d=function(e){return e[e.success=0]="success",e[e.error=1]="error",e}(d||{}),g=[{title:o.ZP.get("序号"),width:50,render:function(e,t,n){return n+1}},{title:o.ZP.get("登录时间"),dataIndex:"timestamp",key:"timestamp",width:120,render:function(e,t){return l()(t.timestamp).format("YYYY-MM-DD HH:mm:ss")}},{title:o.ZP.get("登录地址"),dataIndex:"address",width:120,key:"address"},{title:o.ZP.get("登录IP"),dataIndex:"ip",width:100,key:"ip"},{title:o.ZP.get("登录设备"),dataIndex:"platform",key:"platform",width:80},{title:o.ZP.get("登录状态"),dataIndex:"status",key:"status",width:80,render:function(e,t){return(0,c.jsx)(i.Z,{color:d[t.status],style:{marginRight:0},children:o.ZP.get(u[t.status])})}}];t.default=function(e){var t=e.data,n=e.height;return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(a.Z,{columns:g,pagination:!1,dataSource:t,rowKey:"id",size:"middle",scroll:{x:1e3,y:n}})})}},51578:function(e,t,n){"use strict";n.r(t);var o=n(26068),r=n.n(o),i=n(48305),a=n.n(i),s=n(72317),l=n(75271),c=n(35181),u=n(72338),d=n(61508),g=n(17082),p=n(93481),h=n(94978),f=n(20710),m=n(52676),Z=c.Z.Option;t.default=function(e){var t=e.data,n=(0,l.useState)(!1),o=a()(n,2),i=o[0],x=o[1],P=(0,l.useState)("closed"),v=a()(P,2),y=v[0],b=v[1],w=(0,l.useState)([]),k=a()(w,2),j=k[0],C=k[1],S=u.Z.useForm(),_=a()(S,1)[0],q=function(e){b(e);var t=f.Z.notificationModeMap[e];C(t||[])};return(0,l.useEffect)((function(){t&&t.type&&(q(t.type),_.setFieldsValue(r()({},t)))}),[t]),(0,m.jsx)("div",{children:(0,m.jsxs)(u.Z,{onFinish:function(e){x(!0),"closed"==e.type&&(e.type=""),h.W.put("".concat(f.Z.apiPrefix,"user/notification"),e).then((function(t){var n=t.code;t.data;200===n&&d.ZP.success(e.type?s.ZP.get("通知发送成功"):s.ZP.get("通知关闭成功"))})).catch((function(e){console.log(e)})).finally((function(){return x(!1)}))},form:_,layout:"vertical",children:[(0,m.jsx)(u.Z.Item,{label:s.ZP.get("通知方式"),name:"type",rules:[{required:!0}],style:{maxWidth:400},initialValue:y,children:(0,m.jsx)(c.Z,{onChange:q,disabled:i,children:f.Z.notificationModes.map((function(e){return(0,m.jsx)(Z,{value:e.value,children:e.label},e.value)}))})}),j.map((function(e){return(0,m.jsx)(u.Z.Item,{label:e.label,name:e.label,extra:e.tip,rules:[{required:e.required}],style:{maxWidth:400},children:e.items?(0,m.jsx)(c.Z,{placeholder:e.placeholder||"".concat(s.ZP.get("请选择")," ").concat(e.label),disabled:i,children:e.items.map((function(e){return(0,m.jsx)(Z,{value:e.value,children:e.label||e.value},e.value)}))}):(0,m.jsx)(g.Z.TextArea,{disabled:i,autoSize:{minRows:1,maxRows:5},placeholder:e.placeholder||"".concat(s.ZP.get("请输入")," ").concat(e.label)})},e.label)})),(0,m.jsx)(p.Z,{type:"primary",htmlType:"submit",disabled:i,children:i?s.ZP.get("测试中..."):s.ZP.get("保存")})]})})}},73591:function(e,t,n){"use strict";n.r(t);var o=n(26068),r=n.n(o),i=n(48305),a=n.n(i),s=n(72317),l=n(75271),c=n(72338),u=n(61508),d=n(45520),g=n(94747),p=n(17082),h=n(56646),f=n(93481),m=n(35181),Z=n(6367),x=n(71571),P=n(20710),v=n(94978),y=n(8429),b=n(87105),w=(n(39817),n(79231)),k=n(84522),j=n(86443),C=n(19334),S=n.n(C),_=n(65609),q=n(52676),I={"log-remove-frequency":"logRemoveFrequency","cron-concurrency":"cronConcurrency"};t.default=function(e){var t=e.systemInfo,n=e.reloadTheme,o=localStorage.getItem("qinglong_dark_theme")||"auto",i=(0,l.useState)(),C=a()(i,2),B=C[0],T=C[1],M=c.Z.useForm(),W=a()(M,1)[0],E=(0,l.useState)(!1),D=a()(E,2),A=D[0],F=D[1],R=(0,j.default)(s.ZP.get("上传")),H=(0,j.default)(s.ZP.get("下载")),V=x||{},L=V.enable,O=V.disable,U=(V.exportGeneratedCSS,V.setFetchMethod),z=V.auto,K=function(e){v.W.put("".concat(P.Z.apiPrefix,"system/config/").concat(e),S()(B,I[e])).then((function(e){var t=e.code;e.data;200===t&&u.ZP.success(s.ZP.get("更新成功"))})).catch((function(e){console.log(e)}))};return(0,l.useEffect)((function(){v.W.get("".concat(P.Z.apiPrefix,"system/config")).then((function(e){var t=e.code,n=e.data;200===t&&n.info&&T(n.info)})).catch((function(e){console.log(e)}))}),[]),(0,q.jsxs)(c.Z,{layout:"vertical",form:W,children:[(0,q.jsx)(c.Z.Item,{label:s.ZP.get("主题"),name:"theme",initialValue:o,children:(0,q.jsxs)(g.ZP.Group,{onChange:function(e){var t=e.target.value;localStorage.setItem("qinglong_dark_theme",e.target.value),U(fetch),"dark"===t?L({}):"light"===t?O():z({}),n()},value:o,optionType:"button",buttonStyle:"solid",children:[(0,q.jsx)(g.ZP.Button,{value:"light",style:{width:70,textAlign:"center"},children:s.ZP.get("亮色")}),(0,q.jsx)(g.ZP.Button,{value:"dark",style:{width:66,textAlign:"center"},children:s.ZP.get("暗色")}),(0,q.jsx)(g.ZP.Button,{value:"auto",style:{width:129,textAlign:"center"},children:s.ZP.get("跟随系统")})]})}),(0,q.jsx)(c.Z.Item,{label:s.ZP.get("日志删除频率"),name:"frequency",tooltip:s.ZP.get("每x天自动删除x天以前的日志"),children:(0,q.jsxs)(p.Z.Group,{compact:!0,children:[(0,q.jsx)(h.Z,{addonBefore:s.ZP.get("每"),addonAfter:s.ZP.get("天"),style:{width:180},min:0,value:null==B?void 0:B.logRemoveFrequency,onChange:function(e){T(r()(r()({},B),{},{logRemoveFrequency:e}))}}),(0,q.jsx)(f.Z,{type:"primary",onClick:function(){K("log-remove-frequency")},style:{width:84},children:s.ZP.get("确认")})]})}),(0,q.jsx)(c.Z.Item,{label:s.ZP.get("定时任务并发数"),name:"frequency",children:(0,q.jsxs)(p.Z.Group,{compact:!0,children:[(0,q.jsx)(h.Z,{style:{width:180},min:1,value:null==B?void 0:B.cronConcurrency,onChange:function(e){T(r()(r()({},B),{},{cronConcurrency:e}))}}),(0,q.jsx)(f.Z,{type:"primary",onClick:function(){K("cron-concurrency")},style:{width:84},children:s.ZP.get("确认")})]})}),(0,q.jsx)(c.Z.Item,{label:s.ZP.get("语言"),name:"lang",children:(0,q.jsx)(m.Z,{defaultValue:localStorage.getItem("lang")||"",style:{width:264},onChange:function(e){localStorage.setItem("lang",e),setTimeout((function(){window.location.reload()}),500)},options:[{value:"",label:s.ZP.get("跟随系统")},{value:"zh",label:"简体中文"},{value:"en",label:"English"}]})}),(0,q.jsxs)(c.Z.Item,{label:s.ZP.get("数据备份还原"),name:"frequency",children:[(0,q.jsx)(f.Z,{type:"primary",onClick:function(){F(!0),v.W.put("".concat(P.Z.apiPrefix,"system/data/export"),{},{responseType:"blob",timeout:864e5,onDownloadProgress:function(e){e.progress&&H(parseFloat((100*e.progress).toFixed(1)))}}).then((function(e){(0,b.saveAs)(e,"data.tgz")})).catch((function(e){console.log(e)})).finally((function(){return F(!1)}))},loading:A,children:A?s.ZP.get("生成数据中..."):s.ZP.get("备份")}),(0,q.jsx)(Z.Z,{method:"put",showUploadList:!1,maxCount:1,action:"".concat(P.Z.apiPrefix,"system/data/import"),onChange:function(e){var t=e.file,n=e.event;null!=n&&n.percent&&R(Math.min(parseFloat(null==n?void 0:n.percent.toFixed(1)),99)),"done"===t.status&&(R(100),d.Z.confirm({width:600,maskClosable:!1,title:s.ZP.get("确认重启"),centered:!0,content:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("div",{children:s.ZP.get("备份数据上传成功,确认覆盖数据")}),(0,q.jsxs)("div",{children:[s.ZP.get("如果恢复失败,可进入容器执行")," ql reload data"]})]}),okText:s.ZP.get("重启"),onOk:function(){v.W.put("".concat(P.Z.apiPrefix,"update/data")).then((function(){u.ZP.success({content:(0,q.jsxs)("span",{children:[s.ZP.get("系统将在"),(0,q.jsx)(k.Z,{className:"inline-countdown",format:"ss",value:Date.now()+3e4}),s.ZP.get("秒后自动刷新")]}),duration:30}),(0,_.o4)(),setTimeout((function(){window.location.reload()}),3e4)})).catch((function(e){console.log(e)}))}})),"error"===t.status&&u.ZP.error("上传失败")},name:"data",headers:{Authorization:"Bearer ".concat(localStorage.getItem(P.Z.authKey))},children:(0,q.jsx)(f.Z,{icon:(0,q.jsx)(w.Z,{}),style:{marginLeft:8},children:s.ZP.get("还原数据")})})]}),(0,q.jsx)(c.Z.Item,{label:s.ZP.get("检查更新"),name:"update",children:(0,q.jsx)(y.default,{systemInfo:t})})]})}},86443:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return c}});var o=n(72317),r=n(46016),i=n(45520),a=n(75271),s=n(52676),l=function(e){var t=e.percent;return(0,s.jsx)(r.Z,{style:{display:"flex",justifyContent:"center"},type:"circle",percent:t})};function c(e){var t=(0,a.useRef)();return function(n){t.current?(t.current.update({title:"".concat(e).concat(n>=100?o.ZP.get("成功"):o.ZP.get("中...")),content:(0,s.jsx)(l,{percent:n}),okButtonProps:{disabled:100!==n}}),100===n&&setTimeout((function(){var e;null===(e=t.current)||void 0===e||e.destroy(),t.current=null}))):t.current=i.Z.info({width:600,maskClosable:!1,title:"".concat(e).concat(n>=100?o.ZP.get("成功"):o.ZP.get("中...")),centered:!0,content:(0,s.jsx)(l,{percent:n}),okButtonProps:{disabled:!0}})}}},13494:function(e,t,n){"use strict";n.r(t);var o=n(48305),r=n.n(o),i=n(72317),a=n(75271),s=n(50691),l=n(61508),c=n(17082),u=n(93481),d=n(72338),g=n(70892),p=n(6367),h=n(94978),f=n(20710),m=n(31038),Z=n(63392),x=n.n(Z),P=n(40276),v=n(1371),y=n(79231),b=n(69822),w=(n(72540),n(52676)),k=s.Z.Title,j=s.Z.Link;t.default=function(e){var t=e.user,n=e.userChange,o=(0,a.useState)(!1),s=r()(o,2),Z=s[0],C=s[1],S=(0,a.useState)(),_=r()(S,2),q=_[0],I=_[1],B=(0,a.useState)(!1),T=r()(B,2),M=T[0],W=T[1],E=(0,a.useState)(),D=r()(E,2),A=D[0],F=D[1],R=(0,a.useState)(),H=r()(R,2),V=H[0],L=H[1],O=(0,a.useState)(),U=r()(O,2),z=U[0],K=U[1],N=function(){h.W.put("".concat(f.Z.apiPrefix,"user/two-factor/deactive")).then((function(e){var t=e.code,o=e.data;200===t&&o&&(I(!1),n())})).catch((function(e){console.log(e)}))},G=function(){h.W.get("".concat(f.Z.apiPrefix,"user/two-factor/init")).then((function(e){var t=e.code,n=e.data;200===t&&F(n)})).catch((function(e){console.log(e)}))};return(0,a.useEffect)((function(){I(t&&t.twoFactorActivated),K(t.avatar&&"".concat(f.Z.apiPrefix,"static/").concat(t.avatar))}),[t]),M?(0,w.jsx)(w.Fragment,{children:A?(0,w.jsxs)("div",{children:[(0,w.jsx)(k,{level:5,children:i.ZP.get("第一步")}),i.ZP.get("下载两步验证手机应用,比如 Google Authenticator 、"),(0,w.jsx)(j,{href:"https://www.microsoft.com/en-us/security/mobile-authenticator-app",target:"_blank",children:"Microsoft Authenticator"}),"、",(0,w.jsx)(j,{href:"https://authy.com/download/",target:"_blank",children:"Authy"}),"、",(0,w.jsx)(j,{href:"https://support.1password.com/one-time-passwords/",target:"_blank",children:"1Password"}),"、",(0,w.jsx)(j,{href:"https://support.logmeininc.com/lastpass/help/lastpass-authenticator-lp030014",target:"_blank",children:"LastPass Authenticator"}),(0,w.jsx)(k,{style:{marginTop:5},level:5,children:i.ZP.get("第二步")}),i.ZP.get("使用手机应用扫描二维码,或者输入秘钥")," ",null==A?void 0:A.secret,(0,w.jsx)("div",{style:{marginTop:10},children:(0,w.jsx)(x(),{style:{border:"1px solid #21262d",borderRadius:6},includeMargin:!0,size:187,value:null==A?void 0:A.url})}),(0,w.jsx)(k,{style:{marginTop:5},level:5,children:i.ZP.get("第三步")}),i.ZP.get("输入手机应用上的6位数字"),(0,w.jsx)(c.Z,{style:{margin:"10px 0 10px 0",display:"block",maxWidth:200},value:V,onChange:function(e){return L(e.target.value)},placeholder:"123456"}),(0,w.jsx)(u.Z,{type:"primary",loading:Z,onClick:function(){C(!0),h.W.put("".concat(f.Z.apiPrefix,"user/two-factor/active"),{code:V}).then((function(e){var t=e.code,o=e.data;200===t&&(o?(l.ZP.success(i.ZP.get("激活成功")),W(!1),I(!0),n()):l.ZP.success(i.ZP.get("验证失败")))})).catch((function(e){console.log(e)})).finally((function(){return C(!1)}))},children:i.ZP.get("完成设置")})]}):(0,w.jsx)(P.Z,{})}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4},children:i.ZP.get("修改用户名密码")}),(0,w.jsxs)(d.Z,{onFinish:function(e){h.W.put("".concat(f.Z.apiPrefix,"user"),{username:e.username,password:e.password}).then((function(e){var t=e.code;e.data;200===t&&(localStorage.removeItem(f.Z.authKey),m.history.push("/login"))})).catch((function(e){console.log(e)}))},layout:"vertical",children:[(0,w.jsx)(d.Z.Item,{label:i.ZP.get("用户名"),name:"username",rules:[{required:!0}],hasFeedback:!0,style:{maxWidth:300},children:(0,w.jsx)(c.Z,{autoComplete:"username",placeholder:i.ZP.get("用户名")})}),(0,w.jsx)(d.Z.Item,{label:i.ZP.get("密码"),name:"password",rules:[{required:!0},{pattern:/^(?!admin$).*$/,message:i.ZP.get("密码不能为admin")}],hasFeedback:!0,style:{maxWidth:300},children:(0,w.jsx)(c.Z,{type:"password",autoComplete:"current-password",placeholder:i.ZP.get("密码")})}),(0,w.jsx)(u.Z,{type:"primary",htmlType:"submit",children:i.ZP.get("保存")})]}),(0,w.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4,marginTop:16},children:i.ZP.get("两步验证")}),(0,w.jsx)(u.Z,{type:"primary",danger:q,onClick:function(){q?N():(G(),W(!0))},children:q?i.ZP.get("禁用"):i.ZP.get("启用")}),(0,w.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4,marginTop:16},children:i.ZP.get("头像")}),(0,w.jsx)(g.C,{size:128,shape:"square",icon:(0,w.jsx)(v.Z,{}),src:z}),(0,w.jsx)(b.Z,{rotationSlider:!0,children:(0,w.jsx)(p.Z,{method:"put",showUploadList:!1,maxCount:1,action:"".concat(f.Z.apiPrefix,"user/avatar"),onChange:function(e){e.file&&e.file.response&&(K("".concat(f.Z.apiPrefix,"static/").concat(e.file.response.data)),n())},name:"avatar",headers:{Authorization:"Bearer ".concat(localStorage.getItem(f.Z.authKey))},children:(0,w.jsx)(u.Z,{icon:(0,w.jsx)(y.Z,{}),style:{marginLeft:8},children:i.ZP.get("更换头像")})})})]})}},24915:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return N}});var o=n(90228),r=n.n(o),i=n(87999),a=n.n(i),s=n(48305),l=n.n(s),c=n(72317),u=n(75271),d=n(71742),g=n(19116),p=n(61508),h=n(93481),f=n(20553),m=n(98705),Z=n(54075),x=n(2727),P=n(94978),v=n(20710),y=n(31352),b=n(11333),w=n.n(b),k=n(25298),j=n.n(k),C=n(17069),S=n.n(C),_=n(82092),q=n.n(_),I=n(5174),B=n(80403),T=/\[\ue6f5info\]/g,M=/\[\ue67fdebug\]/g,W=/\[\ue880warn\]/g,E=/\[\ue602error\]/g,D="system-log-info",A="system-warn-info",F="system-error-info",R="system-debug-info",H=I.lg.fromClass(function(){function e(t){j()(this,e),q()(this,"decorations",void 0),this.decorations=this.getDecorations(t)}return S()(e,[{key:"update",value:function(e){e.docChanged&&(this.decorations=this.getDecorations(e.view))}},{key:"getDecorations",value:function(e){for(var t,n=new B.f_,o=e.state.doc.toString();null!==(t=T.exec(o));){var r=I.p.mark({class:D});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),V=I.lg.fromClass(function(){function e(t){j()(this,e),q()(this,"decorations",void 0),this.decorations=this.getDecorations(t)}return S()(e,[{key:"update",value:function(e){e.docChanged&&(this.decorations=this.getDecorations(e.view))}},{key:"getDecorations",value:function(e){for(var t,n=new B.f_,o=e.state.doc.toString();null!==(t=W.exec(o));){var r=I.p.mark({class:A});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),L=I.lg.fromClass(function(){function e(t){j()(this,e),q()(this,"decorations",void 0),this.decorations=this.getDecorations(t)}return S()(e,[{key:"update",value:function(e){e.docChanged&&(this.decorations=this.getDecorations(e.view))}},{key:"getDecorations",value:function(e){for(var t,n=new B.f_,o=e.state.doc.toString();null!==(t=M.exec(o));){var r=I.p.mark({class:R});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),O=I.lg.fromClass(function(){function e(t){j()(this,e),q()(this,"decorations",void 0),this.decorations=this.getDecorations(t)}return S()(e,[{key:"update",value:function(e){e.docChanged&&(this.decorations=this.getDecorations(e.view))}},{key:"getDecorations",value:function(e){for(var t,n=new B.f_,o=e.state.doc.toString();null!==(t=E.exec(o));){var r=I.p.mark({class:F});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),U=I.tk.baseTheme({".system-log-info":{color:"#2196F3"},".system-warn-info":{color:"#FFB827"},".system-error-info":{color:"#FA5151"},".system-debug-info":{color:"#009A29"}}),z=n(52676),K=g.Z.RangePicker,N=function(e){var t=e.height,n=e.theme,o=(0,u.useRef)(null),i=(0,u.useRef)(),s=(0,u.useState)(["",""]),g=l()(s,2),b=g[0],k=g[1],j=(0,u.useState)(""),C=l()(j,2),S=C[0],_=C[1],q=(0,y.Z)((function(){return P.W.get("".concat(v.Z.apiPrefix,"system/log?startTime=").concat(b[0],"&endTime=").concat(b[1]),{responseType:"blob"})}),{refreshDeps:[b],onSuccess:function(e){return a()(r()().mark((function t(){return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=_,t.next=3,e.text();case 3:t.t1=t.sent,(0,t.t0)(t.t1);case 5:case"end":return t.stop()}}),t)})))()}}),I=q.loading,B=q.refresh,T=function(e){o.current.scrollDOM.scrollTo({top:"start"===e?0:o.current.scrollDOM.scrollHeight})};return(0,z.jsxs)("div",{style:{position:"relative"},children:[(0,z.jsxs)("div",{children:[(0,z.jsx)(K,{style:{marginBottom:12,marginRight:12},disabledDate:function(e){return e>w()()||e<w()().subtract(7,"days")},defaultValue:[w()(),w()()],onOpenChange:function(e){i.current=!!e&&["",""]},onCalendarChange:function(e,t,n){var o=n.range;i.current&&"boolean"!=typeof i.current&&("start"===o&&(i.current[0]=t[0]),"end"===o&&(i.current[1]=t[1]),i.current[0]&&i.current[1]&&k(t))}}),(0,z.jsx)(h.Z,{onClick:function(){P.W.delete("".concat(v.Z.apiPrefix,"system/log")).then((function(e){p.ZP.success("删除成功"),B()}))},children:c.ZP.get("清空日志")})]}),S?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(d.ZP,{maxHeight:"".concat(t,"px"),value:S,onCreateEditor:function(e){o.current=e},extensions:[L,O,H,V,U],readOnly:!0,theme:n.includes("dark")?"dark":"light"}),(0,z.jsxs)("div",{style:{position:"absolute",bottom:20,right:20,display:"flex",flexDirection:"column",gap:10},children:[(0,z.jsx)(h.Z,{size:"small",icon:(0,z.jsx)(Z.Z,{}),onClick:function(){T("start")}}),(0,z.jsx)(h.Z,{size:"small",icon:(0,z.jsx)(x.Z,{}),onClick:function(){T("end")}})]})]}):I?(0,z.jsx)(f.Z,{}):(0,z.jsx)(m.Z,{image:m.Z.PRESENTED_IMAGE_SIMPLE})]})}},20710:function(e,t,n){"use strict";var o=n(72317),r=window.__ENV__QlBaseUrl||"/";t.Z={siteName:o.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:o.ZP.get("中文"),flag:"/china.svg"}],defaultLanguage:"en"},scopes:[{name:o.ZP.get("定时任务"),value:"crons"},{name:o.ZP.get("环境变量"),value:"envs"},{name:o.ZP.get("订阅管理"),value:"subscriptions"},{name:o.ZP.get("配置文件"),value:"configs"},{name:o.ZP.get("脚本管理"),value:"scripts"},{name:o.ZP.get("日志管理"),value:"logs"},{name:o.ZP.get("依赖管理"),value:"dependencies"},{name:o.ZP.get("系统信息"),value:"system"}],scopesMap:{crons:o.ZP.get("定时任务"),envs:o.ZP.get("环境变量"),subscriptions:o.ZP.get("订阅管理"),configs:o.ZP.get("配置文件"),scripts:o.ZP.get("脚本管理"),logs:o.ZP.get("日志管理"),dependencies:o.ZP.get("依赖管理"),system:o.ZP.get("系统信息")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"ntfy",label:"Ntfy"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:o.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:o.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:o.ZP.get("钉钉机器人")},{value:"weWorkBot",label:o.ZP.get("企业微信机器人")},{value:"weWorkApp",label:o.ZP.get("企业微信应用")},{value:"aibotk",label:o.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:o.ZP.get("微加机器人")},{value:"wxPusherBot",label:"wxPusher"},{value:"chat",label:o.ZP.get("群晖chat")},{value:"email",label:o.ZP.get("邮箱")},{value:"lark",label:o.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:o.ZP.get("自定义通知")},{value:"closed",label:o.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:o.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:o.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:o.ZP.get("推送消息的优先级")}],ntfy:[{label:"ntfyUrl",tip:o.ZP.get("ntfy的url地址,例如 https://ntfy.sh"),required:!0},{label:"ntfyTopic",tip:o.ZP.get("ntfy的消息应用topic"),required:!0},{label:"ntfyPriority",tip:o.ZP.get("推送消息的优先级")}],chat:[{label:"chatUrl",tip:o.ZP.get("chat的url地址"),required:!0},{label:"chatToken",tip:o.ZP.get("chat的token码"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:o.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:o.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:o.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:o.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:o.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:o.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:o.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:o.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:o.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:o.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:o.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:o.ZP.get("BARK推送消息的跳转URL")},{label:"barkArchive",tip:o.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:o.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:o.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:o.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:o.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:o.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:o.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:o.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:o.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:o.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:o.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:o.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:o.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:o.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:o.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:o.ZP.get("请输入要发送的目标"),items:[{value:"room",label:o.ZP.get("群聊")},{value:"contact",label:o.ZP.get("好友")}]},{label:"aibotkName",tip:o.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:o.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:o.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:o.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")},{label:"pushplusTemplate",tip:o.ZP.get("发送模板")},{label:"pushplusChannel",tip:o.ZP.get("发送渠道")},{label:"pushplusWebhook",tip:o.ZP.get("webhook编码")},{label:"pushplusCallbackUrl",tip:o.ZP.get("发送结果回调地址")},{label:"pushplusTo",tip:o.ZP.get("好友令牌")}],wePlusBot:[{label:"wePlusBotToken",tip:o.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:o.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:o.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],wxPusherBot:[{label:"wxPusherBotAppToken",tip:o.ZP.get("wxPusherBot的appToken"),required:!0},{label:"wxPusherBotTopicIds",tip:o.ZP.get("wxPusherBot的topicIds"),required:!1},{label:"wxPusherBotUids",tip:o.ZP.get("wxPusherBot的uids"),required:!1}],lark:[{label:"larkKey",tip:o.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0}],email:[{label:"emailService",tip:o.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:o.ZP.get("邮箱地址"),required:!0},{label:"emailPass",tip:o.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0}],pushMe:[{label:"pushMeKey",tip:o.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0},{label:"pushMeUrl",tip:o.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:o.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:o.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:o.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:o.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:o.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:o.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:o.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:o.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":o.ZP.get("登录"),"/initialization":o.ZP.get("初始化"),"/crontab":o.ZP.get("定时任务"),"/env":o.ZP.get("环境变量"),"/subscription":o.ZP.get("订阅管理"),"/config":o.ZP.get("配置文件"),"/script":o.ZP.get("脚本管理"),"/diff":o.ZP.get("对比工具"),"/log":o.ZP.get("日志管理"),"/setting":o.ZP.get("系统设置"),"/error":o.ZP.get("错误日志"),"/dependence":o.ZP.get("依赖管理")},dependenceTypes:["nodejs","python3","linux"]}},94978:function(e,t,n){"use strict";n.d(t,{W:function(){return f}});var o=n(90228),r=n.n(o),i=n(87999),a=n.n(i),s=n(72317),l=n(61508),c=n(20710),u=n(31038),d=n(74799);l.ZP.config({duration:2});var g=Date.now(),p=d.Z.create({timeout:6e4,params:{t:g}}),h=["/api/user/login","/open/auth/token","/api/user/two-factor/login","/api/system","/api/user/init","/api/user/notification/init"];p.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})),p.interceptors.response.use(function(){var e=a()(r()().mark((function e(t){var n,o,i;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!==(o=t.data).code&&(i=o.message||o.data)&&l.ZP.error({content:i,style:{maxWidth:500,margin:"0 auto"}}),e.abrupt("return",o);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;if([502,504].includes(n))u.history.push("/error");else if(401===n)"/login"!==u.history.location.pathname&&(l.ZP.error(s.ZP.get("登录已过期,请重新登录")),localStorage.removeItem(c.Z.authKey),u.history.push("/login"));else{var o,r;if("function"==typeof(null===(o=e.config)||void 0===o?void 0:o.onError))return null===(r=e.config)||void 0===r?void 0:r.onError(e.response);l.ZP.error({content:t,style:{maxWidth:500,margin:"0 auto"}})}}else console.log(e.message);return Promise.reject(e)}));var f=p},65609:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},I1:function(){return g},o4:function(){return P},w7:function(){return d},DY:function(){return p},FA:function(){return f},rS:function(){return Z},H$:function(){return x},W9:function(){return u},x$:function(){return h}});var o=n(15558),r=n.n(o),i=n(72317),a={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript",".ini":"ini",".json":"json"},s=n(94046),l=n.n(s);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,".")},o="unknow";t(/windows|win32|win64|wow32|wow64/g)?o="windows":t(/macintosh|macintel/g)?o="macos":t(/x11/g)?o="linux":t(/android|adr/g)?o="android":t(/ios|iphone|ipad|ipod|iwatch/g)&&(o="ios");var r="unknow";"windows"===o?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"===o?r=n(/os x [\d._]+/g):"android"===o?r=n(/android [\d._]+/g):"ios"===o&&(r=n(/os [\d._]+/g));var i="unknow";"windows"===o||"macos"===o||"linux"===o?i="desktop":("android"===o||"ios"===o||t(/mobile/g))&&(i="mobile");var a="unknow",s="unknow";t(/applewebkit/g)?(a="webkit",t(/edge/g)?s="edge":t(/opr/g)?s="opera":t(/chrome/g)?s="chrome":t(/safari/g)&&(s="safari")):t(/gecko/g)&&t(/firefox/g)?(a="gecko",s="firefox"):t(/presto/g)?(a="presto",s="opera"):t(/trident|compatible|msie/g)&&(a="trident",s="iexplore");var l="unknow";"webkit"===a?l=n(/applewebkit\/[\d._]+/g):"gecko"===a?l=n(/gecko\/[\d._]+/g):"presto"===a?l=n(/presto\/[\d._]+/g):"trident"===a&&(l=n(/trident\/[\d._]+/g));var c="unknow";"chrome"===s?c=n(/chrome\/[\d._]+/g):"safari"===s?c=n(/version\/[\d._]+/g):"firefox"===s?c=n(/firefox\/[\d._]+/g):"opera"===s?c=n(/opr\/[\d._]+/g):"iexplore"===s?c=n(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===s&&(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:a,engineVs:l,platform:i,supporter:s,supporterVs:c,system:o,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 o=null,r=0;(o=n||document.querySelector(".ant-table-wrapper"))&&(r=o.getBoundingClientRect().top);var i=document.body.clientHeight-r-t;return i}function d(e,t){var n,o,r=window.URL||window.webkitURL||window,i=new Blob([t]),a=document.createElementNS("http://www.w3.org/1999/xhtml","a");a.href=r.createObjectURL(i),a.download=e,n=a,(o=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(o)}function g(e,t,n){var o=r()(e),i=[];return function e(o){if(o)for(var r=0;r<(null==o?void 0:o.length);r++){if(t(o[r]))return n?void(o[r].children?o[r].children.unshift(n):o[r].children=[n]):void o.splice(r,1);o[r].children&&(i.push(o[r].key),e(o[r].children))}}(o),o}function p(e,t){var n;return function e(o){if(o)for(var r=0;r<(null==o?void 0:o.length);r++)t(o[r])?n=o[r]:o[r].children&&e(o[r].children)}(r()(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 o,r,i="".concat(window.__ENV__QL_DIR,"/data/scripts");n.startsWith(i)&&(n=n.replace(i,""));var a=n.lastIndexOf("/");return a>=0?(r=n.slice(a+1),o=n.slice(0,a)):(r=n,o=""),[r,o]}}function m(e){try{var t=l().parseExpression(e);if(t)return t.next().toDate()}catch(e){}return null}function Z(e,t){var n=m(e);return null!=t&&t.length&&t.forEach((function(e){var t=m(e.schedule);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 a[t]}function P(){var e=document.createElement("div");e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="transparent",e.style.zIndex="9999",document.body.appendChild(e),e.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()})),document.body.style.overflow="hidden"}},69325:function(e,t,n){"use strict";var o=n(15558),r=n.n(o),i=n(67825),a=n.n(i),s=n(90228),l=n.n(s),c=n(87999),u=n.n(c),d=n(25298),g=n.n(d),p=n(17069),h=n.n(p),f=n(82092),m=n.n(f),Z=n(78078),x=n.n(Z),P=["type"],v=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g()(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()(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(x())(this.url),this.setupEventListeners(),this.startHeartbeat(),e.next=9,this.waitForClose();case 9:return this.stopHeartbeat(),this.socket=null,this.reconnectAttempts++,e.next=14,new Promise((function(e){return setTimeout(e,t.options.reconnectInterval)}));case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this.handleError(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(){return n.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.socket&&(this.socket.onopen=function(){e.state="open",e.emit("open")},this.socket.onmessage=function(t){var n=JSON.parse(t.data);e.dispatchMessage(n)},this.socket.onclose=function(){e.state="closed",e.emit("close")})}},{key:"waitForClose",value:(t=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)===x().CLOSED){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,100)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"subscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(!n.has(t)){n.add(t),this.subscriptions.set(e,n);var o={action:"subscribe",topic:e};this.send(o)}}},{key:"unsubscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(n.has(t)){n.delete(t);var o={action:"unsubscribe",topic:e};this.send(o)}}},{key:"send",value:function(e){var t;(null===(t=this.socket)||void 0===t?void 0:t.readyState)===x().OPEN&&this.socket.send(JSON.stringify(e))}},{key:"dispatchMessage",value:function(e){var t=e.type,n=a()(e,P),o=this.subscriptions.get(t)||new Set;r()(o).forEach((function(e){return e(n)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatTimeout=setInterval((function(){var t;(null===(t=e.socket)||void 0===t?void 0:t.readyState)===x().OPEN&&e.socket.send(JSON.stringify({type:"heartbeat"}))}),this.options.heartbeatInterval)}},{key:"stopHeartbeat",value:function(){this.heartbeatTimeout&&clearInterval(this.heartbeatTimeout)}},{key:"close",value:function(){this.socket&&(this.state="closed",this.stopHeartbeat(),this.socket.close(),this.emit("close"))}},{key:"handleError",value:function(e){console.error("WebSocket错误:",e),this.emit("error",e)}},{key:"on",value:function(e,t){}},{key:"emit",value:function(e,t){}}],[{key:"getInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return e.instance||(e.instance=new e(t,n)),e.instance}}]),e}();m()(v,"instance",null),t.Z=v},39817:function(){},50810:function(){}}]);
|