@whyour/qinglong 2.24.0 → 2.25.0-rc.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/cli/README.en.md +6 -6
- package/cli/README.md +6 -6
- package/package.json +1 -1
- package/sample/notify.py +78 -30
- package/static/build/api/dependence.js +52 -0
- package/static/build/api/dependence.js.map +1 -1
- package/static/build/api/health.js +0 -1
- package/static/build/api/health.js.map +1 -1
- package/static/build/api/open.js +2 -2
- package/static/build/api/open.js.map +1 -1
- package/static/build/api/user.js +0 -11
- package/static/build/api/user.js.map +1 -1
- package/static/build/config/index.js +0 -2
- package/static/build/config/index.js.map +1 -1
- package/static/build/data/open.js.map +1 -1
- package/static/build/loaders/express.js +59 -26
- package/static/build/loaders/express.js.map +1 -1
- package/static/build/loaders/initData.js +2 -1
- package/static/build/loaders/initData.js.map +1 -1
- package/static/build/services/dependence.js +57 -13
- package/static/build/services/dependence.js.map +1 -1
- package/static/build/services/env.js +13 -3
- package/static/build/services/env.js.map +1 -1
- package/static/build/services/log.js +1 -1
- package/static/build/services/log.js.map +1 -1
- package/static/build/services/open.js +10 -0
- package/static/build/services/open.js.map +1 -1
- package/static/build/shared/fileAccess.js +4 -1
- package/static/build/shared/fileAccess.js.map +1 -1
- package/static/build/shared/i18n.js +1 -0
- package/static/build/shared/i18n.js.map +1 -1
- package/static/build/shared/schemaMigrations.js +7 -0
- package/static/build/shared/schemaMigrations.js.map +1 -1
- package/static/build/shared/taskEnvName.js +79 -0
- package/static/build/shared/taskEnvName.js.map +1 -0
- package/static/build-info.json +57 -54
- package/static/dist/6212.e056fb2d.async.js +1 -0
- package/static/dist/6212.e056fb2d.async.js.gz +0 -0
- package/static/dist/{1967.3f3945d0.async.js → 6636.fed84003.async.js} +1 -1
- package/static/dist/6636.fed84003.async.js.gz +0 -0
- package/static/dist/index.html +2 -2
- package/static/dist/preload_helper.a71416e6.js +1 -0
- package/static/dist/src__pages__config__index.088ddd9d.async.js +1 -0
- package/static/dist/src__pages__config__index.088ddd9d.async.js.gz +0 -0
- package/static/dist/{src__pages__crontab__index.8aa9d297.async.js → src__pages__crontab__index.b0ae0f99.async.js} +1 -1
- package/static/dist/src__pages__crontab__index.b0ae0f99.async.js.gz +0 -0
- package/static/dist/src__pages__dependence__index.edad6a53.async.js +1 -0
- package/static/dist/src__pages__dependence__index.edad6a53.async.js.gz +0 -0
- package/static/dist/src__pages__env__index.c236a754.async.js +1 -0
- package/static/dist/src__pages__env__index.c236a754.async.js.gz +0 -0
- package/static/dist/src__pages__initialization__index.d4d89bf9.async.js +1 -0
- package/static/dist/src__pages__initialization__index.d4d89bf9.async.js.gz +0 -0
- package/static/dist/src__pages__script__editModal.785f8431.async.js +1 -0
- package/static/dist/src__pages__script__editModal.785f8431.async.js.gz +0 -0
- package/static/dist/src__pages__script__index.3e142045.async.js +1 -0
- package/static/dist/src__pages__script__index.3e142045.async.js.gz +0 -0
- package/static/dist/src__pages__setting__index.c5615182.async.js +1 -0
- package/static/dist/src__pages__setting__index.c5615182.async.js.gz +0 -0
- package/static/dist/{umi.73936e34.js → umi.cf08844a.js} +1 -1
- package/static/dist/umi.cf08844a.js.gz +0 -0
- package/version.yaml +9 -11
- package/static/dist/1967.3f3945d0.async.js.gz +0 -0
- package/static/dist/6212.30a9c190.async.js +0 -1
- package/static/dist/6212.30a9c190.async.js.gz +0 -0
- package/static/dist/preload_helper.8b8f6581.js +0 -1
- package/static/dist/src__pages__config__index.d18d8f95.async.js +0 -1
- package/static/dist/src__pages__crontab__index.8aa9d297.async.js.gz +0 -0
- package/static/dist/src__pages__dependence__index.5b7fd97d.async.js +0 -1
- package/static/dist/src__pages__dependence__index.5b7fd97d.async.js.gz +0 -0
- package/static/dist/src__pages__env__index.eddb35bf.async.js +0 -1
- package/static/dist/src__pages__env__index.eddb35bf.async.js.gz +0 -0
- package/static/dist/src__pages__initialization__index.9c1c5b76.async.js +0 -1
- package/static/dist/src__pages__initialization__index.9c1c5b76.async.js.gz +0 -0
- package/static/dist/src__pages__script__editModal.d15f8d78.async.js +0 -1
- package/static/dist/src__pages__script__editModal.d15f8d78.async.js.gz +0 -0
- package/static/dist/src__pages__script__index.96a6d30f.async.js +0 -1
- package/static/dist/src__pages__script__index.96a6d30f.async.js.gz +0 -0
- package/static/dist/src__pages__setting__index.274ad415.async.js +0 -1
- package/static/dist/src__pages__setting__index.274ad415.async.js.gz +0 -0
- package/static/dist/umi.73936e34.js.gz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[2340,6212,4736],{68125:function(e,t,n){"use strict";n.d(t,{ZP:function(){return w},qS:function(){return j},ql:function(){return h},sN:function(){return f},wv:function(){return g},zL:function(){return Z}});var a=n(90228),r=n.n(a),i=n(87999),o=n.n(i),s=n(26068),c=n.n(s),l=n(3475),u=n(33839),d=n(72317),p=n(75271),g=["starting","running","restarting"],h="qinglong-upgrade-reload",f="qinglong-upgrade-completed",m={downloading:"下载更新中...",extracting:"正在解压更新包",verifying:"正在校验更新包",dependencies:"正在准备依赖",prestarting:"正在预启动验证",repairing:"正在修复运行依赖",ready:"更新已就绪",restarting:"正在重启并更新",completed:"更新完成"};function Z(e){return"ready"===e.status?"下载完成,等待重启":"completed"===e.status?"升级成功":"failed"===e.status?"更新失败":g.includes(e.status)?["ready","completed"].includes(e.phase||"")?"正在准备更新":m[e.phase||""]||"正在准备更新":"检查更新"}var P,x,v,y,b,A,k,j=(v={job:{status:"loading"},busy:!1,connected:!0},y=new Set,b=0,A=function(e){v=c()(c()({},v),e),y.forEach((function(e){return e()}))},k=function(){var e=o()(r()().mark((function e(){var t,n,a,i,o,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=b,n=new AbortController,x=n,a=setTimeout((function(){return n.abort()}),5e3),e.prev=4,i=localStorage.getItem(l.Z.authKey),e.next=8,fetch("".concat(l.Z.apiPrefix,"system/update-status"),{cache:"no-store",headers:i?{Authorization:"Bearer ".concat(i)}:{},signal:n.signal});case 8:if((o=e.sent).ok){e.next=11;break}throw new Error("Upgrade status unavailable");case 11:return e.next=13,o.json();case 13:if(200===(s=e.sent).code&&s.data){e.next=16;break}throw new Error("Invalid upgrade status");case 16:if(y.size&&t===b&&!n.signal.aborted){e.next=18;break}return e.abrupt("return");case 18:if(A({job:s.data,connected:!0}),"completed"!==s.data.status||s.data.id!==sessionStorage.getItem(h)){e.next=24;break}return sessionStorage.setItem(f,s.data.id),sessionStorage.removeItem(h),window.location.reload(),e.abrupt("return");case 24:"completed"===s.data.status&&s.data.id===sessionStorage.getItem(f)&&(sessionStorage.removeItem(f),u.Z.success({message:d.ZP.get("升级成功"),description:d.ZP.get("已重新启动并运行新版本,无需再次重启。"),duration:8})),e.next=30;break;case 27:e.prev=27,e.t0=e.catch(4),y.size&&t===b&&x===n&&A({connected:!1});case 30:return e.prev=30,clearTimeout(a),y.size&&x===n&&(P=setTimeout(k,!v.connected||g.includes(v.job.status)?1e3:15e3)),e.finish(30);case 34:case"end":return e.stop()}}),e,null,[[4,27,30,34]])})));return function(){return e.apply(this,arguments)}}(),{getSnapshot:function(){return v},subscribe:function(e){return y.add(e),1===y.size&&k(),function(){var t;y.delete(e),y.size||(clearTimeout(P),null===(t=x)||void 0===t||t.abort(),b++)}},beginMutation:function(){return!v.busy&&(b++,A({busy:!0}),!0)},finishMutation:function(){var e;b++,null===(e=x)||void 0===e||e.abort(),x=void 0,clearTimeout(P),A({busy:!1}),y.size&&(P=setTimeout(k,1e3))},setJob:function(e){A({job:e})}});function w(){return(0,p.useSyncExternalStore)(j.subscribe,j.getSnapshot)}},29774:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var a=n(72317),r=(n(75271),n(50691)),i=n(18015),o="container___nww32",s="right___o0xXT",c="title___DHxWh",l="desc___frhI6",u=n(16483),d=n.n(u),p=n(52676),g=r.Z.Link,h=function(e){var t=e.systemInfo;return(0,p.jsxs)("div",{className:o,children:[(0,p.jsx)("img",{alt:"logo",style:{width:140,marginRight:20},src:"https://qn.whyour.cn/logo.png"}),(0,p.jsxs)("div",{className:s,children:[(0,p.jsx)("span",{className:c,children:a.ZP.get("青龙")}),(0,p.jsx)("span",{className:l,children:a.ZP.get("支持python3、javascript、shell、typescript 的定时任务管理面板")}),(0,p.jsxs)(i.Z,{children:[(0,p.jsxs)(i.Z.Item,{label:a.ZP.get("版本"),span:3,children:["develop"===(null==t?void 0:t.branch)?a.ZP.get("开发版"):a.ZP.get("正式版")," ","v",t.version]}),(0,p.jsx)(i.Z.Item,{label:a.ZP.get("更新时间"),span:3,children:d()(1e3*t.publishTime).format("YYYY-MM-DD HH:mm")}),(0,p.jsx)(i.Z.Item,{label:a.ZP.get("更新日志"),span:3,children:(0,p.jsx)(g,{href:"https://qn.whyour.cn/version.yaml?t=".concat(Date.now()),target:"_blank",children:a.ZP.get("查看")})})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)(g,{href:"https://github.com/whyour/qinglong",target:"_blank",style:{marginRight:15},children:"Github"}),(0,p.jsx)(g,{href:"https://t.me/jiao_long",target:"_blank",style:{marginRight:15},children:a.ZP.get("Telegram频道")}),(0,p.jsx)(g,{href:"https://github.com/whyour/qinglong/issues",target:"_blank",children:a.ZP.get("提交BUG")})]})]})]})}},92294:function(e,t,n){"use strict";n.r(t);var a=n(90228),r=n.n(a),i=n(26068),o=n.n(i),s=n(87999),c=n.n(s),l=n(48305),u=n.n(l),d=n(72317),p=n(75271),g=n(72338),h=n(61508),f=n(22901),m=n(17082),Z=n(35181),P=n(56212),x=n(3475),v=n(52676);t.default=function(e){var t=e.app,n=e.handleCancel,a=g.Z.useForm(),i=u()(a,1)[0],s=(0,p.useState)(!1),l=u()(s,2),y=l[0],b=l[1],A=function(){var e=c()(r()().mark((function e(a){var i,s,c,l,u;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),i=t?"put":"post",s=o()({},a),t&&(s.id=t.id),e.prev=4,e.next=7,P.W[i]("".concat(x.Z.apiPrefix,"apps"),s);case 7:c=e.sent,l=c.code,u=c.data,200===l&&(h.ZP.success(t?d.ZP.get("更新应用成功"):d.ZP.get("创建应用成功")),n(u)),b(!1),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),b(!1);case 17:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(t){return e.apply(this,arguments)}}();return(0,v.jsx)(f.Z,{title:t?d.ZP.get("编辑应用"):d.ZP.get("创建应用"),open:!0,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){i.validateFields().then((function(e){A(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return n()},confirmLoading:y,children:(0,v.jsxs)(g.Z,{form:i,layout:"vertical",name:"form_app_modal",initialValues:t,children:[(0,v.jsx)(g.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)(g.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:x.Z.scopes.map((function(e){return(0,v.jsx)(Z.Z.Option,{value:e.value,children:e.name},e.value)}))})})]})})}},73236:function(e,t,n){"use strict";n.r(t);var a=n(90228),r=n.n(a),i=n(87999),o=n.n(i),s=n(48305),c=n.n(s),l=n(3475),u=n(56212),d=n(78060),p=n.n(d),g=n(61508),h=n(22901),f=n(63505),m=n(93481),Z=n(50691),P=n(46016),x=n(75271),v=n(68125),y=n(72317),b=n(52676),A=function(e){return"".concat((e/1024/1024).toFixed(1)," MB")};t.default=function(e){var t,n=e.systemInfo,a=(0,v.ZP)(),i=a.job,s=a.busy,d=a.connected,k=(0,x.useState)(!1),j=c()(k,2),w=j[0],S=j[1],C=v.wv.includes(i.status),T="ready"===i.status,I="completed"===i.status,M=function(){var e=o()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s&&!C){e.next=2;break}return e.abrupt("return");case 2:if(v.qS.beginMutation()){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,e.next=7,u.W.put("".concat(l.Z.apiPrefix,"system/update"));case 7:if(200===(t=e.sent).code){e.next=10;break}throw new Error(t.message);case 10:v.qS.setJob(t.data),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),g.ZP.error(y.ZP.get("更新失败,请检查网络及日志或稍后再试"));case 16:return e.prev=16,v.qS.finishMutation(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=o()(r()().mark((function e(){var t,a,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.qS.beginMutation()){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,u.W.put("".concat(l.Z.apiPrefix,"system/update-check"));case 5:if(t=e.sent,a=t.code,i=t.data,200===a){e.next=10;break}throw new Error("Update check failed");case 10:h.Z.confirm({width:500,title:y.ZP.get(i.hasNewVersion?"更新可用":"已经是最新版了!"),content:i.hasNewVersion?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{children:y.ZP.get("新版本可用,当前版本",{version:i.lastVersion,current:n.version})}),(0,b.jsx)("pre",{children:(0,b.jsx)(p(),{children:i.lastLog})})]}):"".concat(y.ZP.get("青龙")," ").concat(i.lastVersion),okText:y.ZP.get(i.hasNewVersion?"下载更新":"重新下载"),cancelText:y.ZP.get("以后再说"),onOk:M}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),g.ZP.error(y.ZP.get("检查更新失败,请检查网络后重试"));case 16:return e.prev=16,v.qS.finishMutation(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[2,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=o()(r()().mark((function e(t){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.qS.beginMutation()){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,u.W.put("".concat(l.Z.apiPrefix,"update/").concat(t?"system":"reload"));case 5:if(200===(n=e.sent).code){e.next=8;break}throw new Error(n.message);case 8:t?(v.qS.setJob(n.data),sessionStorage.setItem(v.ql,n.data.id)):(g.ZP.success(y.ZP.get("系统将在30秒后自动刷新")),setTimeout((function(){return window.location.reload()}),3e4)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),g.ZP.error(y.ZP.get("升级任务启动失败,请检查日志后重试"));case 14:return e.prev=14,v.qS.finishMutation(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(t){return e.apply(this,arguments)}}(),q=y.ZP.get((0,v.zL)(i)),_="idle"!==i.status&&"loading"!==i.status,D=!C&&(0,b.jsxs)(f.Z,{wrap:!0,children:[(0,b.jsx)(m.Z,{type:"primary",loading:s,disabled:!d||"loading"===i.status,onClick:T?function(){return h.Z.confirm({title:y.ZP.get("确认重启"),content:y.ZP.get("更新已就绪,重启后应用新版本"),okText:y.ZP.get("重启并更新"),cancelText:y.ZP.get("以后再说"),onOk:function(){return B(!0)}})}:E,children:y.ZP.get(T?"重启并更新":"检查更新")}),!T&&!I&&(0,b.jsx)(m.Z,{disabled:s||!d||"loading"===i.status,onClick:function(){return B(!1)},children:y.ZP.get("重新启动")})]});return(0,b.jsxs)("div",{className:"upgrade-panel",children:[!d&&(0,b.jsx)(Z.Z.Text,{type:"warning",role:"status",children:y.ZP.get("连接已断开,正在重新连接")}),!_&&D,_&&(0,b.jsxs)("div",{className:"upgrade-status-content",role:"status","aria-live":"polite",children:[(0,b.jsxs)(Z.Z.Text,{strong:!0,children:[q,i.version?" · v".concat(i.version):""]}),(0,b.jsx)(Z.Z.Text,{type:"failed"===i.status?"danger":"secondary",children:"failed"===i.status?y.ZP.get(i.error||"更新失败,请检查网络及日志或稍后再试")||i.error:y.ZP.get(I?"已重新启动并运行新版本,无需再次重启。":T?"更新已就绪,重启后应用新版本":"更新在后台进行,可以继续使用面板")}),"downloading"===i.phase&&C&&(0,b.jsxs)("div",{className:"upgrade-progress",children:[(0,b.jsxs)("div",{className:"upgrade-progress-meta",children:[(0,b.jsx)(Z.Z.Text,{type:"secondary",children:y.ZP.get("qinglong-bundle"===i.artifact?"下载更新包":"qinglong-static"===i.artifact?"下载构建产物":"下载源码")}),(0,b.jsxs)(Z.Z.Text,{type:"secondary",children:[A(i.downloadedBytes||0),i.totalBytes?" / ".concat(A(i.totalBytes)):""]})]}),(0,b.jsx)(P.Z,{percent:null!==(t=i.percent)&&void 0!==t?t:0,showInfo:null!=i.percent,status:"active"})]}),(0,b.jsxs)("div",{className:"upgrade-actions",children:[D,(0,b.jsx)(m.Z,{type:"link",className:"upgrade-log-link",onClick:function(){return S(!0)},children:y.ZP.get("查看更新日志")})]})]}),(0,b.jsx)(h.Z,{open:w,title:y.ZP.get("更新日志"),footer:null,onCancel:function(){return S(!1)},width:700,children:(0,b.jsx)("pre",{style:{maxHeight:"60vh",overflow:"auto",whiteSpace:"pre-wrap"},children:(0,b.jsx)(p(),{children:i.log||y.ZP.get("暂无日志")})})})]})}},32250:function(e,t,n){"use strict";n.r(t);var a=n(90228),r=n.n(a),i=n(87999),o=n.n(i),s=n(48305),c=n.n(s),l=n(75271),u=n(72317),d=n(50691),p=n(61508),g=n(63505),h=n(21259),f=n(94747),m=n(56646),Z=n(17082),P=n(93481),x=n(18015),v=n(17355),y=n(47667),b=n(3475),A=n(56212),k=n(52676),j=d.Z.Paragraph,w=d.Z.Text;t.default=function(){var e=(0,l.useState)(),t=c()(e,2),n=t[0],a=t[1],i=(0,l.useState)(),s=c()(i,2),d=s[0],S=s[1],C=(0,l.useState)("direct"),T=c()(C,2),I=T[0],M=T[1],E=(0,l.useState)(2),B=c()(E,2),q=B[0],_=B[1],D=(0,l.useState)(""),G=c()(D,2),R=G[0],L=G[1],W=(0,l.useState)(!1),K=c()(W,2),N=K[0],H=K[1],z=(0,l.useState)(!1),F=c()(z,2),U=F[0],O=F[1],V=function(e){a(e);var t,n="false"===(t=e.trustProxy)||"0"===t?{mode:"direct",hops:2,custom:""}:"1"===t?{mode:"single",hops:2,custom:""}:/^\d+$/.test(t)?{mode:"hops",hops:Number(t),custom:""}:{mode:"custom",hops:2,custom:t};M(n.mode),_(n.hops),L(n.custom)},Y=function(){var e=o()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A.W.get("".concat(b.Z.apiPrefix,"system/client-ip/config"));case 2:200===(t=e.sent).code&&V(t.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var e=o()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.prev=1,e.next=4,A.W.get("".concat(b.Z.apiPrefix,"system/client-ip/diagnose"));case 4:200===(t=e.sent).code&&S(t.data);case 6:return e.prev=6,O(!1),e.finish(6);case 9:case"end":return e.stop()}}),e,null,[[1,,6,9]])})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=o()(r()().mark((function e(){var t,n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="direct"===I?"false":"single"===I?"1":"hops"===I?String(q):R.trim()){e.next=4;break}return p.ZP.error(u.ZP.get("请输入可信代理地址或网段")),e.abrupt("return");case 4:return H(!0),e.prev=5,e.next=8,A.W.put("".concat(b.Z.apiPrefix,"system/client-ip/config"),{trustProxy:t});case 8:if(200!==(n=e.sent).code){e.next=14;break}return V(n.data),p.ZP.success(u.ZP.get("更新成功")),e.next=14,Q();case 14:return e.prev=14,H(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[5,,14,17]])})));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){Y(),Q()}),[]);var J={default:u.ZP.get("默认配置"),system:u.ZP.get("系统设置"),environment:u.ZP.get("环境变量")},$={trusted:{color:"green",text:u.ZP.get("可信代理")},client:{color:"blue",text:u.ZP.get("最终客户端")},not_checked:{color:"default",text:u.ZP.get("未检查")}};return(0,k.jsx)("div",{style:{maxWidth:960,padding:"12px 0 32px"},children:(0,k.jsxs)(g.Z,{direction:"vertical",size:"large",style:{width:"100%"},children:[(0,k.jsx)(h.Z,{type:"info",showIcon:!0,message:u.ZP.get("可信代理配置说明"),description:(0,k.jsxs)("div",{children:[(0,k.jsx)(j,{children:u.ZP.get("系统从离青龙最近的一跳开始,由右向左检查代理链,并把第一个不可信地址作为客户端 IP。")}),(0,k.jsx)(j,{style:{marginBottom:0},children:u.ZP.get("代理层数只适合所有访问路径长度完全一致的部署;生产环境更推荐填写代理的固定 IP 或专用网络 CIDR。不要直接使用 true。")})]})}),"environment"===(null==n?void 0:n.source)&&(0,k.jsx)(h.Z,{type:"warning",showIcon:!0,message:u.ZP.get("当前由环境变量 QL_TRUST_PROXY 管理"),description:u.ZP.get("请修改容器环境变量并重启,系统设置不能覆盖环境变量。")}),(0,k.jsxs)("div",{children:[(0,k.jsx)(j,{strong:!0,children:u.ZP.get("Trust Proxy 自定义设置")}),(0,k.jsxs)(f.ZP.Group,{value:I,onChange:function(e){return M(e.target.value)},disabled:!(null!=n&&n.editable),optionType:"button",buttonStyle:"solid",children:[(0,k.jsx)(f.ZP.Button,{value:"direct",children:u.ZP.get("直接访问")}),(0,k.jsx)(f.ZP.Button,{value:"single",children:u.ZP.get("一层代理")}),(0,k.jsx)(f.ZP.Button,{value:"hops",children:u.ZP.get("固定多层")}),(0,k.jsx)(f.ZP.Button,{value:"custom",children:u.ZP.get("指定地址或网段")})]}),(0,k.jsxs)("div",{style:{marginTop:12},children:["hops"===I&&(0,k.jsx)(m.Z,{min:2,max:20,value:q,onChange:function(e){return _(e||2)},addonAfter:u.ZP.get("层"),disabled:!(null!=n&&n.editable)}),"custom"===I&&(0,k.jsx)(Z.Z,{style:{maxWidth:620},value:R,onChange:function(e){return L(e.target.value)},disabled:!(null!=n&&n.editable),placeholder:"loopback,172.18.0.0/16,10.20.0.8/32"})]}),(0,k.jsxs)(g.Z,{style:{marginTop:12},wrap:!0,children:[(0,k.jsx)(P.Z,{type:"primary",onClick:X,loading:N,disabled:!(null!=n&&n.editable),children:u.ZP.get("保存配置")}),(0,k.jsxs)(w,{type:"secondary",children:[u.ZP.get("当前生效值"),":",(0,k.jsx)(w,{copyable:!0,children:(null==n?void 0:n.trustProxy)||"-"}),n&&"(".concat(J[n.source],")")]})]})]}),(0,k.jsxs)("div",{children:[(0,k.jsxs)(g.Z,{style:{marginBottom:12},children:[(0,k.jsx)(j,{strong:!0,style:{marginBottom:0},children:u.ZP.get("客户端 IP 诊断")}),(0,k.jsx)(P.Z,{onClick:Q,loading:U,children:u.ZP.get("重新诊断")})]}),d&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(x.Z,{bordered:!0,size:"small",column:1,children:[(0,k.jsx)(x.Z.Item,{label:u.ZP.get("Socket 地址"),children:(0,k.jsx)(w,{copyable:!0,children:d.remoteAddress||"-"})}),(0,k.jsx)(x.Z.Item,{label:"X-Forwarded-For",children:(0,k.jsx)(w,{copyable:!0,children:d.forwardedFor.join(", ")||"-"})}),(0,k.jsx)(x.Z.Item,{label:u.ZP.get("最终客户端 IP"),children:(0,k.jsx)(w,{strong:!0,copyable:!0,children:d.clientIp||"-"})})]}),(0,k.jsx)(v.Z,{style:{marginTop:12},size:"small",pagination:!1,rowKey:function(e){return"".concat(e.hop,"-").concat(e.ip)},dataSource:d.hops,columns:[{title:u.ZP.get("距离青龙"),dataIndex:"hop",width:120,render:function(e){return"".concat(e," ").concat(u.ZP.get("跳"))}},{title:"IP",dataIndex:"ip"},{title:u.ZP.get("判定"),dataIndex:"status",width:140,render:function(e){return(0,k.jsx)(y.Z,{color:$[e].color,children:$[e].text})}}]})]})]})]})})}},53626:function(e,t,n){"use strict";n.r(t);var a=n(26068),r=n.n(a),i=n(48305),o=n.n(i),s=n(72317),c=n(75271),l=n(72338),u=n(61508),d=n(17082),p=n(93481),g=n(35181),h=n(3475),f=n(56212),m=(n(68251),n(78060)),Z=n.n(m),P=n(19334),x=n.n(P),v=n(65814),y=n(52676),b={"dependence-proxy":"dependenceProxy","node-mirror":"nodeMirror","python-mirror":"pythonMirror","linux-mirror":"linuxMirror"};t.default=function(){var e=(0,c.useState)(),t=o()(e,2),n=t[0],a=t[1],i=l.Z.useForm(),m=o()(i,1)[0],P=(0,c.useState)(""),A=o()(P,2),k=A[0],j=A[1],w=(0,c.useState)(!1),S=o()(w,2),C=S[0],T=S[1],I=(0,c.useState)("node"),M=o()(I,2),E=M[0],B=M[1],q=function(e){T(!0),j("in progress...\n"),f.W.put("".concat(h.Z.apiPrefix,"system/config/").concat(e),x()(n,b[e])).then((function(e){})).catch((function(){T(!1),j((function(e){return"".concat(e,"update mirror error")}))}))},_=function(e){T(!0),j(""),f.W.put("".concat(h.Z.apiPrefix,"system/config/").concat(e),x()(n,b[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 T(!1)}))},D=function(e){var t=e.message,n=e.status;t&&j((function(e){return"".concat(e).concat(t)})),"completed"===n&&T(!1)};return(0,c.useEffect)((function(){var e=v.Z.getInstance();return e.subscribe("updateNodeMirror",D),e.subscribe("updateLinuxMirror",D),function(){e.unsubscribe("updateNodeMirror",D),e.unsubscribe("updateLinuxMirror",D)}}),[]),(0,c.useEffect)((function(){f.W.get("".concat(h.Z.apiPrefix,"system/config")).then((function(e){var t=e.code,n=e.data;200===t&&n.info&&a(n.info)})).catch((function(e){console.log(e)}))}),[]),(0,y.jsxs)("div",{className:"dependence-config-wrapper",children:[(0,y.jsxs)(l.Z,{layout:"vertical",form:m,style:{flexShrink:0},children:[(0,y.jsx)(l.Z.Item,{label:s.ZP.get("代理"),name:"proxy",extra:s.ZP.get("代理与镜像源二选一即可"),tooltip:{title:s.ZP.get("代理地址, 支持HTTP(S)/SOCK5"),placement:"topLeft"},children:(0,y.jsxs)(d.Z.Group,{compact:!0,children:[(0,y.jsx)(d.Z,{placeholder:"http://1.1.1.1:8080",style:{width:250},value:null==n?void 0:n.dependenceProxy,onChange:function(e){a(r()(r()({},n),{},{dependenceProxy:e.target.value}))}}),(0,y.jsx)(p.Z,{type:"primary",loading:C,onClick:function(){_("dependence-proxy")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,y.jsx)(l.Z.Item,{label:s.ZP.get("Node 软件包镜像源"),name:"node",tooltip:s.ZP.get("NPM 镜像源"),children:(0,y.jsxs)(d.Z.Group,{compact:!0,children:[(0,y.jsx)(d.Z,{style:{width:250},placeholder:"https://registry.npmmirror.com",value:null==n?void 0:n.nodeMirror,onChange:function(e){a(r()(r()({},n),{},{nodeMirror:e.target.value}))}}),(0,y.jsx)(p.Z,{type:"primary",loading:C,onClick:function(){q("node-mirror")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,y.jsx)(l.Z.Item,{label:s.ZP.get("Python 软件包镜像源"),name:"python",tooltip:s.ZP.get("PyPI 镜像源"),children:(0,y.jsxs)(d.Z.Group,{compact:!0,children:[(0,y.jsx)(d.Z,{style:{width:250},placeholder:"https://pypi.doubanio.com/simple/",value:null==n?void 0:n.pythonMirror,onChange:function(e){a(r()(r()({},n),{},{pythonMirror:e.target.value}))}}),(0,y.jsx)(p.Z,{type:"primary",loading:C,onClick:function(){_("python-mirror")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,y.jsx)(l.Z.Item,{label:s.ZP.get("Linux 软件包镜像源"),name:"linux",tooltip:s.ZP.get("debian linux 镜像源"),children:(0,y.jsxs)(d.Z.Group,{compact:!0,children:[(0,y.jsx)(d.Z,{style:{width:250},placeholder:"http://mirrors.aliyun.com",value:null==n?void 0:n.linuxMirror,onChange:function(e){a(r()(r()({},n),{},{linuxMirror:e.target.value}))}}),(0,y.jsx)(p.Z,{type:"primary",loading:C,onClick:function(){q("linux-mirror")},style:{width:100},children:s.ZP.get("确认")})]})}),(0,y.jsx)(l.Z.Item,{label:s.ZP.get("清除依赖缓存"),name:"clean",tooltip:{title:s.ZP.get("清除依赖缓存"),placement:"topLeft"},children:(0,y.jsxs)(d.Z.Group,{compact:!0,children:[(0,y.jsx)(g.Z,{defaultValue:"node",style:{width:100},onChange:function(e){B(e)},options:[{label:"node",value:"node"},{label:"python3",value:"python3"}]}),(0,y.jsx)(p.Z,{type:"primary",loading:C,onClick:function(){var e;e=E,T(!0),j(""),f.W.put("".concat(h.Z.apiPrefix,"system/config/dependence-clean"),{type: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 T(!1)}))},style:{width:100},children:s.ZP.get("确认")})]})})]}),(0,y.jsx)("pre",{style:{fontFamily:"Source Code Pro",zoom:.83,maxHeight:"100%",overflowY:"auto"},children:(0,y.jsx)(Z(),{children:k})})]})}},42716:function(e,t,n){"use strict";n.r(t);var a=n(26068),r=n.n(a),i=n(15558),o=n.n(i),s=n(48305),c=n.n(s),l=n(72317),u=n(75271),d=n(50691),p=n(47667),g=n(63505),h=n(59816),f=n(22901),m=n(61508),Z=n(93481),P=n(46035),x=n(17355),v=n(3475),y=n(47508),b=n(56212),A=n(92294),k=n(28423),j=n(28068),w=n(88939),S=n(67303),C=n(59362),T=n(58045),I=n(61160),M=n(85657),E=n(29774),B=n(98783),q=(n(68251),n(30502)),_=n(76433),D=n(53626),G=n(32250),R=n(52676),L=d.Z.Text,W="demo"===window.__ENV__DeployEnv;t.default=function(){var e=(0,B.useOutletContext)(),t=e.headerStyle,n=e.isPhone,a=e.user,i=e.theme,s=e.reloadUser,d=e.reloadSystemConfig,K=e.reloadTheme,N=e.systemInfo,H=[{title:l.ZP.get("名称"),dataIndex:"name",key:"name"},{title:"Client ID",dataIndex:"client_id",key:"client_id",render:function(e,t){return(0,R.jsx)(L,{copyable:!0,children:t.client_id})}},{title:"Client Secret",dataIndex:"client_secret",key:"client_secret",render:function(e,t){return(0,R.jsx)(L,{copyable:{text:t.client_secret},children:"*******"})}},{title:l.ZP.get("权限"),dataIndex:"scopes",key:"scopes",width:500,render:function(e,t){return(0,R.jsx)("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:t.scopes.map((function(e){return(0,R.jsx)(p.Z,{style:{marginRight:0},children:v.Z.scopesMap[e]},e)}))})}},{title:l.ZP.get("操作"),key:"action",render:function(e,t,a){var r=!n;return(0,R.jsxs)(g.Z,{size:"middle",style:{paddingLeft:8},children:[(0,R.jsx)(h.Z,{title:r?l.ZP.get("编辑"):"",children:(0,R.jsx)("a",{onClick:function(){return Ce(t,a)},children:(0,R.jsx)(k.Z,{})})}),(0,R.jsx)(h.Z,{title:r?l.ZP.get("重置secret"):"",children:(0,R.jsx)("a",{onClick:function(){return Ie(t,a)},children:(0,R.jsx)(j.Z,{})})}),(0,R.jsx)(h.Z,{title:r?l.ZP.get("删除"):"",children:(0,R.jsx)("a",{onClick:function(){return Te(t,a)},children:(0,R.jsx)(w.Z,{})})})]})}}],z=(0,u.useState)(!0),F=c()(z,2),U=F[0],O=F[1],V=(0,u.useState)([]),Y=c()(V,2),Q=Y[0],X=Y[1],J=(0,u.useState)(!1),$=c()(J,2),ee=$[0],te=$[1],ne=(0,u.useState)(),ae=c()(ne,2),re=ae[0],ie=ae[1],oe=(0,u.useState)("security"),se=c()(oe,2),ce=se[0],le=se[1],ue=(0,u.useState)([]),de=c()(ue,2),pe=de[0],ge=de[1],he=(0,u.useState)([]),fe=c()(he,2),me=fe[0],Ze=fe[1],Pe=(0,u.useState)(),xe=c()(Pe,2),ve=xe[0],ye=xe[1],be=(0,u.useRef)(null),Ae=(0,u.useState)(0),ke=c()(Ae,2),je=ke[0],we=ke[1];(0,q.Z)(be,(function(e){var t,n=null===(t=e.target)||void 0===t?void 0:t.offsetHeight;n&&je!==n-101&&we(n-101)}));var Se=function(){O(!0),b.W.get("".concat(v.Z.apiPrefix,"apps")).then((function(e){var t=e.code,n=e.data;200===t&&X(n)})).finally((function(){return O(!1)}))},Ce=function(e,t){ie(e),te(!0)},Te=function(e,t){f.Z.confirm({title:l.ZP.get("确认删除"),content:(0,R.jsxs)(R.Fragment,{children:[l.ZP.get("确认删除应用")," ",(0,R.jsx)(L,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",l.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(l.ZP.get("删除成功"));var a=o()(Q);a.splice(t,1),X(a)}}))}})},Ie=function(e,t){f.Z.confirm({title:l.ZP.get("确认重置"),content:(0,R.jsxs)(R.Fragment,{children:[l.ZP.get("确认重置应用")," ",(0,R.jsx)(L,{style:{wordBreak:"break-all"},type:"warning",children:e.name})," ",l.ZP.get("的Secret吗"),(0,R.jsx)("br",{}),(0,R.jsx)(L,{type:"secondary",children:l.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(l.ZP.get("重置成功")),Me(n))}))}})},Me=function(e){var t=Q.findIndex((function(t){return t.id===e.id})),n=o()(Q);-1===t?n.push(e):n.splice(t,1,r()({},e)),X(n)},Ee=function(){b.W.get("".concat(v.Z.apiPrefix,"user/notification")).then((function(e){var t=e.code,n=e.data;200===t&&ye(n)})).catch((function(e){console.log(e)}))},Be=function(){b.W.get("".concat(v.Z.apiPrefix,"system/notify-log")).then((function(e){var t=e.code,n=e.data;200===t&&Ze(n)})).catch((function(e){console.log(e)}))};return(0,u.useEffect)((function(){W&&Se()}),[]),(0,R.jsxs)(y.ZP,{className:"ql-container-wrapper ql-container-wrapper-has-tab ql-setting-container",title:l.ZP.get("系统设置"),header:{style:t},extra:"app"===ce?[(0,R.jsx)(Z.Z,{type:"primary",onClick:function(){return ie(null),void te(!0)},children:l.ZP.get("创建应用")},"2")]:[],children:[(0,R.jsx)("div",{ref:be,style:{height:"100%"},children:(0,R.jsx)(P.Z,{style:{height:"100%"},defaultActiveKey:"security",size:"small",tabPosition:"top",onChange:function(e){le(e),"app"===e?Se():"login"===e?b.W.get("".concat(v.Z.apiPrefix,"user/login-log")).then((function(e){var t=e.code,n=e.data;200===t&&ge(n)})).catch((function(e){console.log(e)})):"notifylog"===e?Be():"notification"===e&&Ee()},destroyInactiveTabPane:!0,items:[].concat(o()(W?[]:[{key:"security",label:l.ZP.get("安全设置"),children:(0,R.jsx)(S.default,{user:a,userChange:s})}]),[{key:"app",label:l.ZP.get("应用设置"),children:(0,R.jsx)(x.Z,{columns:H,pagination:!1,dataSource:Q,rowKey:"id",size:"middle",scroll:{x:1e3,y:je},loading:U})},{key:"notification",label:l.ZP.get("通知设置"),children:(0,R.jsx)(I.default,{data:ve})},{key:"syslog",label:l.ZP.get("系统日志"),children:(0,R.jsx)(_.default,{height:je,theme:i})},{key:"login",label:l.ZP.get("登录日志"),children:(0,R.jsx)(C.default,{height:je,data:pe})},{key:"notifylog",label:l.ZP.get("通知日志"),children:(0,R.jsx)(T.default,{height:je,data:me})},{key:"client-ip",label:l.ZP.get("客户端 IP"),children:(0,R.jsx)(G.default,{})},{key:"dependence",label:l.ZP.get("依赖设置"),children:(0,R.jsx)(D.default,{})},{key:"other",label:l.ZP.get("其他设置"),children:(0,R.jsx)(M.default,{reloadSystemConfig:d,reloadTheme:K,systemInfo:N})},{key:"about",label:l.ZP.get("关于"),children:(0,R.jsx)(E.default,{systemInfo:N})}])})}),ee&&(0,R.jsx)(A.default,{handleCancel:function(e){te(!1),e&&Me(e)},app:re})]})}},59362:function(e,t,n){"use strict";n.r(t);var a=n(90228),r=n.n(a),i=n(87999),o=n.n(i),s=n(48305),c=n.n(s),l=n(72317),u=n(75271),d=n(61508),p=n(47667),g=n(44974),h=n(93481),f=n(17355),m=n(56212),Z=n(3475),P=n(16483),x=n.n(P),v=n(52676),y=function(e){return e[e["成功"]=0]="成功",e[e["失败"]=1]="失败",e}(y||{}),b=function(e){return e[e.success=0]="success",e[e.error=1]="error",e}(b||{});t.default=function(e){var t=e.data,n=e.height,a=(0,u.useState)([]),i=c()(a,2),s=i[0],P=i[1];(0,u.useEffect)((function(){m.W.get("".concat(Z.Z.apiPrefix,"user/ip-blacklist")).then((function(e){var t=e.code,n=e.data;200===t&&P(n||[])}))}),[]);var A=function(){var e=o()(r()().mark((function e(t,n){var a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=6;break}return e.next=3,m.W.delete("".concat(Z.Z.apiPrefix,"user/ip-blacklist"),{data:{ip:t}});case 3:e.t0=e.sent,e.next=9;break;case 6:return e.next=8,m.W.put("".concat(Z.Z.apiPrefix,"user/ip-blacklist"),{ip:t});case 8:e.t0=e.sent;case 9:200===(a=e.t0).code&&(P(a.data||[]),d.ZP.success(a.message));case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),k=[{title:l.ZP.get("序号"),width:90,render:function(e,t,n){return n+1}},{title:l.ZP.get("登录时间"),dataIndex:"timestamp",key:"timestamp",width:120,render:function(e,t){return x()(t.timestamp).format("YYYY-MM-DD HH:mm:ss")}},{title:l.ZP.get("登录地址"),dataIndex:"address",width:120,key:"address",render:function(e){return"内网IP"===e?l.ZP.get("内网IP"):e}},{title:l.ZP.get("登录IP"),dataIndex:"ip",width:100,key:"ip"},{title:l.ZP.get("登录设备"),dataIndex:"platform",key:"platform",width:140},{title:l.ZP.get("登录状态"),dataIndex:"status",key:"status",width:140,render:function(e,t){return(0,v.jsx)(p.Z,{color:b[t.status],style:{marginRight:0},children:l.ZP.get(y[t.status])})}},{title:l.ZP.get("操作"),key:"action",width:100,render:function(e,t){if(!t.ip||1!==t.status)return null;var n=s.includes(t.ip),a=n?"移出黑名单":"加入黑名单";return(0,v.jsx)(g.Z,{title:l.ZP.get(n?"确认移出 IP 黑名单":"确认加入 IP 黑名单"),onConfirm:function(){return A(t.ip,n)},children:(0,v.jsx)(h.Z,{type:"link",danger:!n,size:"small",children:l.ZP.get(a)})})}}];return(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(f.Z,{className:"login-log-table",columns:k,pagination:!1,dataSource:t,rowKey:function(e){return"".concat(e.ip,"-").concat(e.timestamp)},size:"middle",scroll:{x:1120,y:n}})})}},61160:function(e,t,n){"use strict";n.r(t);var a=n(26068),r=n.n(a),i=n(48305),o=n.n(i),s=n(72317),c=n(75271),l=n(35181),u=n(72338),d=n(61508),p=n(17082),g=n(93481),h=n(56212),f=n(3475),m=n(52676),Z=l.Z.Option;t.default=function(e){var t=e.data,n=(0,c.useState)(!1),a=o()(n,2),i=a[0],P=a[1],x=(0,c.useState)("closed"),v=o()(x,2),y=v[0],b=v[1],A=(0,c.useState)([]),k=o()(A,2),j=k[0],w=k[1],S=u.Z.useForm(),C=o()(S,1)[0],T=function(e){b(e);var t=f.Z.notificationModeMap[e];w(t||[])};return(0,c.useEffect)((function(){t&&t.type&&(T(t.type),C.setFieldsValue(r()({},t)))}),[t]),(0,m.jsx)("div",{children:(0,m.jsxs)(u.Z,{onFinish:function(e){P(!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 P(!1)}))},form:C,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)(l.Z,{onChange:T,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:(0,m.jsx)("span",{dangerouslySetInnerHTML:{__html:e.tip}}),rules:[{required:e.required}],style:{maxWidth:400},children:e.items?(0,m.jsx)(l.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)(p.Z.TextArea,{disabled:i,autoSize:{minRows:1,maxRows:5},placeholder:e.placeholder||"".concat(s.ZP.get("请输入")," ").concat(e.label)})},e.label)})),(0,m.jsx)(g.Z,{type:"primary",htmlType:"submit",disabled:i,children:i?s.ZP.get("测试中..."):s.ZP.get("保存")})]})})}},58045:function(e,t,n){"use strict";n.r(t);var a=n(72317),r=(n(75271),n(47667)),i=n(17355),o=n(16483),s=n.n(o),c=(n(68251),n(52676)),l={0:"成功",1:"失败"},u={0:"success",1:"error"},d=[{title:a.ZP.get("通知来源"),key:"source",width:220,render:function(e,t){return(0,c.jsxs)("span",{children:[a.ZP.get("script"===t.source?"脚本通知":"系统通知"),t.scriptName?" · ".concat(t.scriptName):"",t.taskId?" (#".concat(t.taskId,")"):""]})}},{title:a.ZP.get("序号"),width:90,render:function(e,t,n){return n+1}},{title:a.ZP.get("发送时间"),dataIndex:"timestamp",key:"timestamp",width:160,render:function(e,t){return s()(t.timestamp).format("YYYY-MM-DD HH:mm:ss")}},{title:a.ZP.get("标题"),dataIndex:"title",key:"title",width:200},{title:a.ZP.get("内容"),dataIndex:"content",key:"content",render:function(e){return e?e.length>100?e.slice(0,100)+"...":e:""}},{title:a.ZP.get("推送渠道"),dataIndex:"notifyType",key:"notifyType",width:120},{title:a.ZP.get("发送状态"),dataIndex:"status",key:"status",width:140,render:function(e,t){var n,i=null!==(n=t.status)&&void 0!==n?n:1;return(0,c.jsx)(r.Z,{color:u[i],style:{marginRight:0},children:a.ZP.get(l[i])})}}];t.default=function(e){var t=e.data,n=e.height;return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(i.Z,{className:"notify-log-table",columns:d,pagination:!1,dataSource:t,rowKey:"id",size:"middle",scroll:{x:1240,y:n}})})}},85657:function(e,t,n){"use strict";n.r(t);var a=n(26068),r=n.n(a),i=n(48305),o=n.n(i),s=n(72317),c=n(75271),l=n(72338),u=n(61508),d=n(22901),p=n(94747),g=n(17082),h=n(93481),f=n(56646),m=n(32253),Z=n(35181),P=n(6367),x=n(71571),v=n(3475),y=n(56212),b=n(73236),A=n(87105),k=(n(68251),n(79231)),j=n(84522),w=n(32916),S=n(19334),C=n.n(S),T=n(48916),I=n(97302),M=n(52676),E={"panel-title":"panelTitle","log-remove-frequency":"logRemoveFrequency","cron-concurrency":"cronConcurrency",timezone:"timezone","global-ssh-key":"globalSshKey"},B=[{value:"base",label:s.ZP.get("基础数据"),disabled:!0},{value:"config",label:s.ZP.get("配置文件")},{value:"scripts",label:s.ZP.get("脚本文件")},{value:"log",label:s.ZP.get("日志文件")},{value:"deps",label:s.ZP.get("依赖文件")},{value:"syslog",label:s.ZP.get("系统日志")},{value:"dep_cache",label:s.ZP.get("依赖缓存")},{value:"raw",label:s.ZP.get("远程脚本缓存")},{value:"repo",label:s.ZP.get("远程仓库缓存")},{value:"ssh.d",label:s.ZP.get("SSH 文件缓存")}];t.default=function(e){var t=e.systemInfo,n=e.reloadSystemConfig,a=e.reloadTheme,i=localStorage.getItem("qinglong_dark_theme")||"auto",S=(0,c.useState)(),q=o()(S,2),_=q[0],D=q[1],G=l.Z.useForm(),R=o()(G,1)[0],L=(0,c.useState)(!1),W=o()(L,2),K=W[0],N=W[1],H=(0,w.default)(s.ZP.get("上传")),z=(0,w.default)(s.ZP.get("下载")),F=(0,c.useState)(!1),U=o()(F,2),O=U[0],V=U[1],Y=(0,c.useState)(["base"]),Q=o()(Y,2),X=Q[0],J=Q[1],$=(0,c.useState)(!1),ee=o()($,2),te=ee[0],ne=ee[1],ae=(0,c.useState)([]),re=o()(ae,2),ie=re[0],oe=re[1],se=(0,c.useState)(!1),ce=o()(se,2),le=ce[0],ue=ce[1],de=x||{},pe=de.enable,ge=de.disable,he=(de.exportGeneratedCSS,de.setFetchMethod),fe=de.auto,me=function(e){y.W.put("".concat(v.Z.apiPrefix,"system/config/").concat(e),C()(_,E[e])).then((function(t){var a=t.code;t.data;200===a&&(u.ZP.success(s.ZP.get("更新成功")),"panel-title"===e&&n())})).catch((function(e){console.log(e)}))},Ze=function(){return{runningInstanceRetentionDays:(null==_?void 0:_.runningInstanceRetentionDays)||0,cronStatRetentionDays:(null==_?void 0:_.cronStatRetentionDays)||0}},Pe=function(e){if(!e)return"0 B";var t=["B","KiB","MiB","GiB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return"".concat((e/Math.pow(1024,n)).toFixed(n?1:0)," ").concat(t[n])};return(0,c.useEffect)((function(){y.W.get("".concat(v.Z.apiPrefix,"system/config")).then((function(e){var t=e.code,n=e.data;200===t&&n.info&&D(n.info)})).catch((function(e){console.log(e)}))}),[]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(l.Z,{layout:"vertical",form:R,children:[(0,M.jsx)(l.Z.Item,{label:s.ZP.get("主题"),name:"theme",initialValue:i,children:(0,M.jsxs)(p.ZP.Group,{onChange:function(e){var t=e.target.value;localStorage.setItem("qinglong_dark_theme",e.target.value),he(fetch),"dark"===t?pe({}):"light"===t?ge():fe({}),a()},value:i,optionType:"button",buttonStyle:"solid",children:[(0,M.jsx)(p.ZP.Button,{value:"light",style:{width:70,textAlign:"center"},children:s.ZP.get("亮色")}),(0,M.jsx)(p.ZP.Button,{value:"dark",style:{width:66,textAlign:"center"},children:s.ZP.get("暗色")}),(0,M.jsx)(p.ZP.Button,{value:"auto",style:{width:129,textAlign:"center"},children:s.ZP.get("跟随系统")})]})}),(0,M.jsx)(l.Z.Item,{label:s.ZP.get("面板标题"),name:"panelTitle",tooltip:s.ZP.get("自定义面板的站点标题,留空使用默认值“青龙”"),children:(0,M.jsxs)(g.Z.Group,{compact:!0,children:[(0,M.jsx)(g.Z,{style:{width:180},maxLength:100,value:(null==_?void 0:_.panelTitle)||"",placeholder:s.ZP.get("留空使用默认值“青龙”"),onChange:function(e){D(r()(r()({},_),{},{panelTitle:e.target.value}))}}),(0,M.jsx)(h.Z,{type:"primary",onClick:function(){me("panel-title")},style:{width:84},children:s.ZP.get("确认")})]})}),(0,M.jsx)(l.Z.Item,{label:s.ZP.get("日志删除频率"),name:"frequency",tooltip:s.ZP.get("每x天自动删除x天以前的日志"),children:(0,M.jsxs)(g.Z.Group,{compact:!0,children:[(0,M.jsx)(f.Z,{addonBefore:s.ZP.get("每"),addonAfter:s.ZP.get("天"),style:{width:180},placeholder:s.ZP.get("未启用"),min:0,value:null==_?void 0:_.logRemoveFrequency,onChange:function(e){D(r()(r()({},_),{},{logRemoveFrequency:e}))}}),(0,M.jsx)(h.Z,{type:"primary",onClick:function(){me("log-remove-frequency")},style:{width:84},children:s.ZP.get("确认")})]})}),(0,M.jsxs)(l.Z.Item,{label:s.ZP.get("历史数据保留与手动清理"),tooltip:s.ZP.get("保留天数为0时禁用对应清理,预览不会删除数据"),children:[(0,M.jsx)("div",{style:{marginBottom:8},children:(0,M.jsx)(f.Z,{addonBefore:s.ZP.get("运行实例"),addonAfter:s.ZP.get("天"),min:0,max:3650,value:(null==_?void 0:_.runningInstanceRetentionDays)||0,onChange:function(e){D(r()(r()({},_),{},{runningInstanceRetentionDays:e}))}})}),(0,M.jsx)("div",{style:{marginBottom:8},children:(0,M.jsx)(f.Z,{addonBefore:s.ZP.get("任务统计"),addonAfter:s.ZP.get("天"),min:0,max:3650,value:(null==_?void 0:_.cronStatRetentionDays)||0,onChange:function(e){D(r()(r()({},_),{},{cronStatRetentionDays:e}))}})}),(0,M.jsx)("div",{style:{marginBottom:8},children:(0,M.jsx)(m.Z.Group,{value:ie,options:[{label:s.ZP.get("清除 Node 依赖缓存"),value:"node"},{label:s.ZP.get("清除 Python 依赖缓存"),value:"python3"}],onChange:function(e){return oe(e)}})}),(0,M.jsx)("div",{style:{marginBottom:8},children:(0,M.jsx)(m.Z,{checked:le,onChange:function(e){return ue(e.target.checked)},children:s.ZP.get("清理后压缩数据库")})}),(0,M.jsx)(h.Z,{onClick:function(){y.W.put("".concat(v.Z.apiPrefix,"system/storage-retention/config"),Ze()).then((function(e){200===e.code&&u.ZP.success(s.ZP.get("更新成功"))}))},style:{marginRight:8},children:s.ZP.get("保存设置")}),(0,M.jsx)(h.Z,{danger:!0,loading:te,onClick:function(){ne(!0);var e=r()(r()({},Ze()),{},{dependenceCacheTypes:ie,compactDatabase:le});y.W.post("".concat(v.Z.apiPrefix,"system/storage-retention/preview"),e).then((function(t){var n=t.code,a=t.data;200===n&&d.Z.confirm({width:560,centered:!0,title:s.ZP.get("确认清理存储数据"),okText:s.ZP.get("确认清理"),cancelText:s.ZP.get("取消"),okButtonProps:{danger:!0},content:(0,M.jsxs)("div",{children:[(0,M.jsxs)("p",{children:[s.ZP.get("将删除历史运行实例"),": ",a.runningInstances]}),(0,M.jsxs)("p",{children:[s.ZP.get("将删除任务统计"),": ",a.cronStats]}),(0,M.jsxs)("p",{children:[s.ZP.get("将清除依赖缓存"),": ",a.dependenceCaches.length," (",Pe(a.dependenceCacheBytes),")"]}),a.dependenceCaches.length>0&&(0,M.jsx)("p",{children:s.ZP.get("清理依赖缓存后相关依赖需要重新安装")}),le&&(0,M.jsx)("p",{children:s.ZP.get("数据库压缩期间可能暂时阻塞请求")}),(0,M.jsx)("p",{children:s.ZP.get("此操作不可恢复,请确认已完成必要备份")})]}),onOk:function(){return ne(!0),y.W.post("".concat(v.Z.apiPrefix,"system/storage-retention/cleanup"),r()(r()({},e),{},{confirmation:"CLEAN"})).then((function(e){200===e.code&&u.ZP.success(s.ZP.get("清理完成"))})).finally((function(){return ne(!1)}))}})})).finally((function(){return ne(!1)}))},children:s.ZP.get("预览清理")})]}),(0,M.jsx)(l.Z.Item,{label:s.ZP.get("定时任务并发数"),name:"frequency",children:(0,M.jsxs)(g.Z.Group,{compact:!0,children:[(0,M.jsx)(f.Z,{style:{width:180},min:4,value:null==_?void 0:_.cronConcurrency,placeholder:s.ZP.get("默认为 CPU 个数"),onChange:function(e){D(r()(r()({},_),{},{cronConcurrency:e}))}}),(0,M.jsx)(h.Z,{type:"primary",onClick:function(){me("cron-concurrency")},style:{width:84},children:s.ZP.get("确认")})]})}),(0,M.jsx)(l.Z.Item,{label:s.ZP.get("时区"),name:"timezone",children:(0,M.jsxs)(g.Z.Group,{compact:!0,children:[(0,M.jsx)(Z.Z,{value:null==_?void 0:_.timezone,style:{width:180},onChange:function(e){D(r()(r()({},_),{},{timezone:e}))},options:I.z.map((function(e){return{value:e,label:e}})),showSearch:!0,filterOption:function(e,t){var n;return(null==t||null===(n=t.value)||void 0===n?void 0:n.toLowerCase().indexOf(e.toLowerCase()))>=0}}),(0,M.jsx)(h.Z,{type:"primary",onClick:function(){me("timezone")},style:{width:84},children:s.ZP.get("确认")})]})}),(0,M.jsxs)(l.Z.Item,{label:s.ZP.get("全局SSH私钥"),name:"globalSshKey",tooltip:s.ZP.get("用于访问所有私有仓库的全局SSH私钥"),children:[(0,M.jsx)(g.Z.Group,{compact:!0,children:(0,M.jsx)(g.Z.TextArea,{value:(null==_?void 0:_.globalSshKey)||"",style:{width:264},autoSize:{minRows:3,maxRows:8},placeholder:s.ZP.get("请输入完整的SSH私钥内容"),onChange:function(e){D(r()(r()({},_),{},{globalSshKey:e.target.value}))}})}),(0,M.jsx)(h.Z,{type:"primary",onClick:function(){me("global-ssh-key")},style:{width:264,marginTop:8},children:s.ZP.get("确认")})]}),(0,M.jsx)(l.Z.Item,{label:s.ZP.get("语言"),name:"lang",children:(0,M.jsx)(Z.Z,{defaultValue:localStorage.getItem("lang")||"",style:{width:264},onChange:function(e){var t;localStorage.setItem("lang",e);var n=e||(null===(t=navigator.language)||void 0===t?void 0:t.slice(0,2))||"zh";y.W.put("".concat(v.Z.apiPrefix,"system/config/lang"),{lang:n}).catch((function(){})),setTimeout((function(){window.location.reload()}),500)},options:[{value:"",label:s.ZP.get("跟随系统")},{value:"zh",label:"简体中文"},{value:"en",label:"English"}]})}),(0,M.jsxs)(l.Z.Item,{label:s.ZP.get("数据备份还原"),name:"frequency",children:[(0,M.jsx)(h.Z,{type:"primary",onClick:function(){J(["base"]),V(!0)},loading:K,children:K?s.ZP.get("生成数据中..."):s.ZP.get("备份")}),(0,M.jsx)(P.Z,{method:"put",showUploadList:!1,maxCount:1,action:"".concat(v.Z.apiPrefix,"system/data/import"),onChange:function(e){var t=e.file,n=e.event;null!=n&&n.percent&&H(Math.min(parseFloat(null==n?void 0:n.percent.toFixed(1)),99)),"done"===t.status&&(H(100),d.Z.confirm({width:600,maskClosable:!1,title:s.ZP.get("确认重启"),centered:!0,content:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)("div",{children:s.ZP.get("备份数据上传成功,确认覆盖数据")}),(0,M.jsxs)("div",{children:[s.ZP.get("如果恢复失败,可进入容器执行")," ql reload data"]})]}),okText:s.ZP.get("重启"),onOk:function(){y.W.put("".concat(v.Z.apiPrefix,"update/data")).then((function(){u.ZP.success({content:(0,M.jsxs)("span",{children:[s.ZP.get("系统将在"),(0,M.jsx)(j.Z,{className:"inline-countdown",format:"ss",value:Date.now()+3e4}),s.ZP.get("秒后自动刷新")]}),duration:30}),(0,T.o4)(),setTimeout((function(){window.location.reload()}),3e4)})).catch((function(e){console.log(e)}))}})),"error"===t.status&&u.ZP.error(s.ZP.get("上传失败"))},name:"data",headers:{Authorization:"Bearer ".concat(localStorage.getItem(v.Z.authKey))},children:(0,M.jsx)(h.Z,{icon:(0,M.jsx)(k.Z,{}),style:{marginLeft:8},children:s.ZP.get("还原数据")})})]}),(0,M.jsx)(l.Z.Item,{label:s.ZP.get("检查更新"),name:"update",children:(0,M.jsx)(b.default,{systemInfo:t})})]}),(0,M.jsx)(d.Z,{title:s.ZP.get("选择备份模块"),open:O,onOk:function(){N(!0),y.W.put("".concat(v.Z.apiPrefix,"system/data/export"),{type:X},{responseType:"blob",timeout:864e5,onDownloadProgress:function(e){e.progress&&z(parseFloat((100*e.progress).toFixed(1)))}}).then((function(e){(0,A.saveAs)(e,"data.tgz")})).catch((function(e){console.log(e)})).finally((function(){N(!1),V(!1)}))},onCancel:function(){return V(!1)},okText:s.ZP.get("开始备份"),cancelText:s.ZP.get("取消"),okButtonProps:{loading:K},children:(0,M.jsx)(m.Z.Group,{value:X,onChange:function(e){J(e)},style:{width:"100%",display:"flex",flexWrap:"wrap",gap:"8px 16px"},children:B.map((function(e){return(0,M.jsx)(m.Z,{value:e.value,disabled:e.disabled,style:{marginLeft:0},children:e.label},e.value)}))})})]})}},32916:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return l}});var a=n(72317),r=n(46016),i=n(22901),o=n(75271),s=n(52676),c=function(e){var t=e.percent;return(0,s.jsx)(r.Z,{style:{display:"flex",justifyContent:"center"},type:"circle",percent:t})};function l(e){var t=(0,o.useRef)();return function(n){t.current?(t.current.update({title:"".concat(e).concat(n>=100?a.ZP.get("成功"):a.ZP.get("中...")),content:(0,s.jsx)(c,{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?a.ZP.get("成功"):a.ZP.get("中...")),centered:!0,content:(0,s.jsx)(c,{percent:n}),okButtonProps:{disabled:!0}})}}},67303:function(e,t,n){"use strict";n.r(t);var a=n(48305),r=n.n(a),i=n(72317),o=n(75271),s=n(50691),c=n(61508),l=n(17082),u=n(93481),d=n(72338),p=n(19321),g=n(6367),h=n(56212),f=n(3475),m=n(98783),Z=n(63392),P=n.n(Z),x=n(34014),v=n(1371),y=n(79231),b=n(69822),A=(n(94095),n(52676)),k=s.Z.Title,j=s.Z.Link;t.default=function(e){var t=e.user,n=e.userChange,a=(0,o.useState)(!1),s=r()(a,2),Z=s[0],w=s[1],S=(0,o.useState)(),C=r()(S,2),T=C[0],I=C[1],M=(0,o.useState)(!1),E=r()(M,2),B=E[0],q=E[1],_=(0,o.useState)(),D=r()(_,2),G=D[0],R=D[1],L=(0,o.useState)(),W=r()(L,2),K=W[0],N=W[1],H=(0,o.useState)(),z=r()(H,2),F=z[0],U=z[1],O=function(){h.W.put("".concat(f.Z.apiPrefix,"user/two-factor/deactivate")).then((function(e){var t=e.code,a=e.data;200===t&&a&&(I(!1),n())})).catch((function(e){console.log(e)}))},V=function(){h.W.get("".concat(f.Z.apiPrefix,"user/two-factor/init")).then((function(e){var t=e.code,n=e.data;200===t&&R(n)})).catch((function(e){console.log(e)}))};return(0,o.useEffect)((function(){I(t&&t.twoFactorActivated),U(t.avatar&&"".concat(f.Z.apiPrefix,"static/").concat(t.avatar))}),[t]),B?(0,A.jsx)(A.Fragment,{children:G?(0,A.jsxs)("div",{children:[(0,A.jsx)(k,{level:5,children:i.ZP.get("第一步")}),i.ZP.get("下载两步验证手机应用,比如 Google Authenticator 、"),(0,A.jsx)(j,{href:"https://www.microsoft.com/en-us/security/mobile-authenticator-app",target:"_blank",children:"Microsoft Authenticator"}),"、",(0,A.jsx)(j,{href:"https://authy.com/download/",target:"_blank",children:"Authy"}),"、",(0,A.jsx)(j,{href:"https://support.1password.com/one-time-passwords/",target:"_blank",children:"1Password"}),"、",(0,A.jsx)(j,{href:"https://support.logmeininc.com/lastpass/help/lastpass-authenticator-lp030014",target:"_blank",children:"LastPass Authenticator"}),(0,A.jsx)(k,{style:{marginTop:5},level:5,children:i.ZP.get("第二步")}),i.ZP.get("使用手机应用扫描二维码,或者输入秘钥")," ",null==G?void 0:G.secret,(0,A.jsx)("div",{style:{marginTop:10},children:(0,A.jsx)(P(),{style:{border:"1px solid #21262d",borderRadius:6},includeMargin:!0,size:187,value:null==G?void 0:G.url})}),(0,A.jsx)(k,{style:{marginTop:5},level:5,children:i.ZP.get("第三步")}),i.ZP.get("输入手机应用上的6位数字"),(0,A.jsx)(l.Z,{style:{margin:"10px 0 10px 0",display:"block",maxWidth:200},value:K,onChange:function(e){return N(e.target.value)},placeholder:"123456"}),(0,A.jsx)(u.Z,{type:"primary",loading:Z,onClick:function(){w(!0),h.W.put("".concat(f.Z.apiPrefix,"user/two-factor/active"),{code:K}).then((function(e){var t=e.code,a=e.data;200===t&&(a?(c.ZP.success(i.ZP.get("激活成功")),q(!1),I(!0),n()):c.ZP.success(i.ZP.get("验证失败")))})).catch((function(e){console.log(e)})).finally((function(){return w(!1)}))},children:i.ZP.get("完成设置")})]}):(0,A.jsx)(x.Z,{})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4},children:i.ZP.get("修改用户名密码")}),(0,A.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,A.jsx)(d.Z.Item,{label:i.ZP.get("用户名"),name:"username",rules:[{required:!0}],hasFeedback:!0,style:{maxWidth:300},children:(0,A.jsx)(l.Z,{autoComplete:"username",placeholder:i.ZP.get("用户名")})}),(0,A.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,A.jsx)(l.Z,{type:"password",autoComplete:"current-password",placeholder:i.ZP.get("密码")})}),(0,A.jsx)(u.Z,{type:"primary",htmlType:"submit",children:i.ZP.get("保存")})]}),(0,A.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4,marginTop:16},children:i.ZP.get("两步验证")}),(0,A.jsx)(u.Z,{type:"primary",danger:T,onClick:function(){T?O():(V(),q(!0))},children:T?i.ZP.get("禁用"):i.ZP.get("启用")}),(0,A.jsx)("div",{style:{fontSize:18,borderBottom:"1px solid #f0f0f0",marginBottom:8,paddingBottom:4,marginTop:16},children:i.ZP.get("头像")}),(0,A.jsx)(p.C,{size:128,shape:"square",icon:(0,A.jsx)(v.Z,{}),src:F}),(0,A.jsx)(b.Z,{rotationSlider:!0,children:(0,A.jsx)(g.Z,{method:"put",showUploadList:!1,maxCount:1,action:"".concat(f.Z.apiPrefix,"user/avatar"),onChange:function(e){e.file&&e.file.response&&(U("".concat(f.Z.apiPrefix,"static/").concat(e.file.response.data)),n())},name:"avatar",headers:{Authorization:"Bearer ".concat(localStorage.getItem(f.Z.authKey))},children:(0,A.jsx)(u.Z,{icon:(0,A.jsx)(y.Z,{}),style:{marginLeft:8},children:i.ZP.get("更换头像")})})})]})}},76433:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return O}});var a=n(90228),r=n.n(a),i=n(87999),o=n.n(i),s=n(48305),c=n.n(s),l=n(72317),u=n(75271),d=n(62808),p=n(19116),g=n(61508),h=n(93481),f=n(20553),m=n(98705),Z=n(54075),P=n(2727),x=n(56212),v=n(3475),y=n(31352),b=n(67688),A=n.n(b),k=n(25298),j=n.n(k),w=n(17069),S=n.n(w),C=n(82092),T=n.n(C),I=n(18446),M=n(71529),E=/\[ℹ️info/g,B=/\[⚠️debug/g,q=/\[❌warn/g,_=/\[🐛error/g,D="system-log-info",G="system-warn-info",R="system-error-info",L="system-debug-info",W=I.lg.fromClass(function(){function e(t){j()(this,e),T()(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 M.f_,a=e.state.doc.toString();null!==(t=E.exec(a));){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}}),K=I.lg.fromClass(function(){function e(t){j()(this,e),T()(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 M.f_,a=e.state.doc.toString();null!==(t=q.exec(a));){var r=I.p.mark({class:G});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),N=I.lg.fromClass(function(){function e(t){j()(this,e),T()(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 M.f_,a=e.state.doc.toString();null!==(t=B.exec(a));){var r=I.p.mark({class:L});n.add(t.index,t.index+t[0].length,r)}return n.finish()}}]),e}(),{decorations:function(e){return e.decorations}}),H=I.lg.fromClass(function(){function e(t){j()(this,e),T()(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 M.f_,a=e.state.doc.toString();null!==(t=_.exec(a));){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}}),z=I.tk.baseTheme({".system-log-info":{color:"#2196F3"},".system-warn-info":{color:"#FFB827"},".system-error-info":{color:"#FA5151"},".system-debug-info":{color:"#009A29"}}),F=n(52676),U=p.Z.RangePicker,O=function(e){var t=e.height,n=e.theme,a=(0,u.useRef)(null),i=(0,u.useRef)(),s=(0,u.useState)(["",""]),p=c()(s,2),b=p[0],k=p[1],j=(0,u.useState)(""),w=c()(j,2),S=w[0],C=w[1],T=(0,y.Z)((function(){return x.W.get("".concat(v.Z.apiPrefix,"system/log?startTime=").concat(b[0],"&endTime=").concat(b[1],"&limit=").concat(1048576),{responseType:"blob"})}),{refreshDeps:[b],onSuccess:function(e){return o()(r()().mark((function t(){return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=C,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=T.loading,M=T.refresh,E=function(e){a.current.scrollDOM.scrollTo({top:"start"===e?0:a.current.scrollDOM.scrollHeight})};return(0,F.jsxs)("div",{style:{position:"relative"},children:[(0,F.jsxs)("div",{children:[(0,F.jsx)(U,{style:{marginBottom:12,marginRight:12},disabledDate:function(e){return e>A()()||e<A()().subtract(7,"days")},defaultValue:[A()(),A()()],onOpenChange:function(e){i.current=!!e&&["",""]},onCalendarChange:function(e,t,n){var a=n.range;i.current&&"boolean"!=typeof i.current&&("start"===a&&(i.current[0]=t[0]),"end"===a&&(i.current[1]=t[1]),i.current[0]&&i.current[1]&&k(t))}}),(0,F.jsx)(h.Z,{onClick:function(){x.W.delete("".concat(v.Z.apiPrefix,"system/log")).then((function(e){g.ZP.success(l.ZP.get("删除成功")),M()}))},children:l.ZP.get("清空日志")})]}),S?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(d.ZP,{maxHeight:"".concat(t,"px"),value:S,onCreateEditor:function(e){a.current=e},extensions:[N,H,W,K,z],readOnly:!0,theme:n.includes("dark")?"dark":"light"}),(0,F.jsxs)("div",{style:{position:"absolute",bottom:20,right:20,display:"flex",flexDirection:"column",gap:10},children:[(0,F.jsx)(h.Z,{size:"small",icon:(0,F.jsx)(Z.Z,{}),onClick:function(){E("start")}}),(0,F.jsx)(h.Z,{size:"small",icon:(0,F.jsx)(P.Z,{}),onClick:function(){E("end")}})]})]}):I?(0,F.jsx)(f.Z,{}):(0,F.jsx)(m.Z,{image:m.Z.PRESENTED_IMAGE_SIMPLE})]})}},3475:function(e,t,n){"use strict";var a=n(72317),r=window.__ENV__QlBaseUrl||"/";t.Z={siteName:a.ZP.get("青龙"),baseUrl:r,apiPrefix:"".concat(r,"api/"),authKey:"token",layouts:[{name:"primary",include:[/.*/],exclude:[/(\/(en|zh))*\/login/]}],scopes:[{name:a.ZP.get("定时任务"),value:"crons"},{name:a.ZP.get("定时任务(只读)"),value:"crons:read"},{name:a.ZP.get("环境变量"),value:"envs"},{name:a.ZP.get("环境变量(只读)"),value:"envs:read"},{name:a.ZP.get("订阅管理"),value:"subscriptions"},{name:a.ZP.get("订阅管理(只读)"),value:"subscriptions:read"},{name:a.ZP.get("配置文件"),value:"configs"},{name:a.ZP.get("配置文件(只读)"),value:"configs:read"},{name:a.ZP.get("脚本管理"),value:"scripts"},{name:a.ZP.get("脚本(只读)"),value:"scripts:read"},{name:a.ZP.get("日志管理"),value:"logs"},{name:a.ZP.get("日志管理(只读)"),value:"logs:read"},{name:a.ZP.get("依赖管理"),value:"dependencies"},{name:a.ZP.get("依赖管理(只读)"),value:"dependencies:read"},{name:a.ZP.get("系统信息"),value:"system"},{name:a.ZP.get("仪表盘"),value:"dashboard"},{name:a.ZP.get("仪表盘(只读)"),value:"dashboard:read"}],scopesMap:{crons:a.ZP.get("定时任务"),"crons:read":a.ZP.get("定时任务(只读)"),envs:a.ZP.get("环境变量"),"envs:read":a.ZP.get("环境变量(只读)"),subscriptions:a.ZP.get("订阅管理"),"subscriptions:read":a.ZP.get("订阅管理(只读)"),configs:a.ZP.get("配置文件"),"configs:read":a.ZP.get("配置文件(只读)"),scripts:a.ZP.get("脚本管理"),"scripts:read":a.ZP.get("脚本(只读)"),logs:a.ZP.get("日志管理"),"logs:read":a.ZP.get("日志管理(只读)"),dependencies:a.ZP.get("依赖管理"),"dependencies:read":a.ZP.get("依赖管理(只读)"),system:a.ZP.get("系统信息"),dashboard:a.ZP.get("仪表盘"),"dashboard:read":a.ZP.get("仪表盘(只读)")},notificationModes:[{value:"gotify",label:"Gotify"},{value:"ntfy",label:"Ntfy"},{value:"goCqHttpBot",label:"GoCqHttpBot"},{value:"serverChan",label:a.ZP.get("Server酱")},{value:"pushDeer",label:"PushDeer"},{value:"bark",label:"Bark"},{value:"telegramBot",label:a.ZP.get("Telegram机器人")},{value:"dingtalkBot",label:a.ZP.get("钉钉机器人")},{value:"weWorkBot",label:a.ZP.get("企业微信机器人")},{value:"weWorkApp",label:a.ZP.get("企业微信应用")},{value:"aibotk",label:a.ZP.get("智能微秘书")},{value:"iGot",label:"IGot"},{value:"pushPlus",label:"PushPlus"},{value:"wePlusBot",label:a.ZP.get("微加机器人")},{value:"wxPusherBot",label:"wxPusher"},{value:"wxPusherSpt",label:a.ZP.get("WxPusher(极简推送SPT-推荐)")},{value:"openiLink",label:"OpeniLink"},{value:"wpush",label:"WPUSH"},{value:"chat",label:a.ZP.get("群晖chat")},{value:"email",label:a.ZP.get("邮箱")},{value:"lark",label:a.ZP.get("飞书机器人")},{value:"pushMe",label:"PushMe"},{value:"chronocat",label:"Chronocat"},{value:"webhook",label:a.ZP.get("自定义通知")},{value:"closed",label:a.ZP.get("已关闭")}],notificationModeMap:{gotify:[{label:"gotifyUrl",tip:a.ZP.get("gotify的url地址,例如 https://push.example.de:8080"),required:!0},{label:"gotifyToken",tip:a.ZP.get("gotify的消息应用token码"),required:!0},{label:"gotifyPriority",tip:a.ZP.get("推送消息的优先级")}],ntfy:[{label:"ntfyUrl",tip:a.ZP.get("ntfy的url地址,例如 https://ntfy.sh"),required:!0},{label:"ntfyTopic",tip:a.ZP.get("ntfy应用topic"),required:!0},{label:"ntfyPriority",tip:a.ZP.get("推送消息的优先级")},{label:"ntfyToken",tip:a.ZP.get("ntfy应用token")},{label:"ntfyUsername",tip:a.ZP.get("ntfy应用用户名")},{label:"ntfyPassword",tip:a.ZP.get("ntfy应用密码")},{label:"ntfyActions",tip:a.ZP.get("ntfy用户动作")}],chat:[{label:"synologyChatUrl",tip:a.ZP.get("synologyChat的url地址"),required:!0}],goCqHttpBot:[{label:"goCqHttpBotUrl",tip:a.ZP.get("推送到个人QQ: http://127.0.0.1/send_private_msg,群:http://127.0.0.1/send_group_msg"),required:!0},{label:"goCqHttpBotToken",tip:a.ZP.get("访问密钥"),required:!0},{label:"goCqHttpBotQq",tip:a.ZP.get("如果GOBOT_URL设置 /send_private_msg 则需要填入 user_id=个人QQ 相反如果是 /send_group_msg 则需要填入 group_id=QQ群"),required:!0}],serverChan:[{label:"serverChanKey",tip:a.ZP.get("Server酱SENDKEY"),required:!0}],pushDeer:[{label:"pushDeerKey",tip:a.ZP.get("PushDeer的Key,https://github.com/easychen/pushdeer"),required:!0},{label:"pushDeerUrl",tip:a.ZP.get("PushDeer的自架API endpoint,默认是 https://api2.pushdeer.com/message/push")}],bark:[{label:"barkPush",tip:a.ZP.get("Bark的信息IP/设备码,例如:https://api.day.app/XXXXXXXX"),required:!0},{label:"barkIcon",tip:a.ZP.get("BARK推送图标,自定义推送图标 (需iOS15或以上才能显示)")},{label:"barkSound",tip:a.ZP.get("BARK推送铃声,铃声列表去APP查看复制填写")},{label:"barkGroup",tip:a.ZP.get("BARK推送消息的分组,默认为qinglong")},{label:"barkLevel",tip:a.ZP.get("BARK推送消息的时效性,默认为active")},{label:"barkUrl",tip:a.ZP.get("BARK推送消息的跳转URL")},{label:"barkArchive",tip:a.ZP.get("BARK是否保存推送消息")}],telegramBot:[{label:"telegramBotToken",tip:a.ZP.get("telegram机器人的token,例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw"),required:!0},{label:"telegramBotUserId",tip:a.ZP.get("telegram用户的id,例如:129xxx206"),required:!0},{label:"telegramBotProxyHost",tip:a.ZP.get("代理IP")},{label:"telegramBotProxyPort",tip:a.ZP.get("代理端口")},{label:"telegramBotProxyAuth",tip:a.ZP.get("telegram代理配置认证参数,用户名与密码用英文冒号连接 user:password")},{label:"telegramBotApiHost",tip:a.ZP.get("telegram api自建的反向代理地址,默认tg官方api")}],dingtalkBot:[{label:"dingtalkBotToken",tip:a.ZP.get("钉钉机器人webhook token,例如:5a544165465465645d0f31dca676e7bd07415asdasd"),required:!0},{label:"dingtalkBotSecret",tip:a.ZP.get("密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串")}],weWorkBot:[{label:"weWorkBotKey",tip:a.ZP.get("企业微信机器人的webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa"),required:!0},{label:"weWorkOrigin",tip:a.ZP.get("企业微信代理地址")}],weWorkApp:[{label:"weWorkAppKey",tip:a.ZP.get("corpid、corpsecret、touser(注:多个成员ID使用|隔开)、agentid、消息类型(选填,不填默认文本消息类型) 注意用,号隔开(英文输入法的逗号),例如:wwcfrs,B-76WERQ,qinglong,1000001,2COat"),required:!0},{label:"weWorkOrigin",tip:a.ZP.get("企业微信代理地址")}],aibotk:[{label:"aibotkKey",tip:a.ZP.get("密钥key,智能微秘书个人中心获取apikey,申请地址:https://wechat.aibotk.com/signup?from=ql"),required:!0},{label:"aibotkType",tip:a.ZP.get("发送的目标,群组或者好友"),required:!0,placeholder:a.ZP.get("请输入要发送的目标"),items:[{value:"room",label:a.ZP.get("群聊")},{value:"contact",label:a.ZP.get("好友")}]},{label:"aibotkName",tip:a.ZP.get("要发送的用户昵称或群名,如果目标是群,需要填群名,如果目标是好友,需要填好友昵称"),required:!0}],iGot:[{label:"iGotPushKey",tip:a.ZP.get("iGot的信息推送key,例如:https://push.hellyw.com/XXXXXXXX"),required:!0}],pushPlus:[{label:"pushPlusToken",tip:a.ZP.get("微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送,参考 https://www.pushplus.plus/"),required:!0},{label:"pushPlusUser",tip:a.ZP.get("一对多推送的“群组编码”(一对多推送下面->您的群组(如无则创建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)")},{label:"pushplusTemplate",tip:a.ZP.get("发送模板")},{label:"pushplusChannel",tip:a.ZP.get("发送渠道")},{label:"pushplusWebhook",tip:a.ZP.get("webhook编码")},{label:"pushplusCallbackUrl",tip:a.ZP.get("发送结果回调地址")},{label:"pushplusTo",tip:a.ZP.get("好友令牌")}],wePlusBot:[{label:"wePlusBotToken",tip:a.ZP.get("用户令牌,扫描登录后 我的—>设置->令牌 中获取,参考 https://www.weplusbot.com/"),required:!0},{label:"wePlusBotReceiver",tip:a.ZP.get("消息接收人")},{label:"wePlusBotVersion",tip:a.ZP.get("调用版本;专业版填写pro,个人版填写personal,为空默认使用专业版")}],wxPusherBot:[{label:"wxPusherBotAppToken",tip:a.ZP.get("wxPusherBot的appToken"),required:!0},{label:"wxPusherBotTopicIds",tip:a.ZP.get("wxPusherBot的topicIds"),required:!1},{label:"wxPusherBotUids",tip:a.ZP.get("wxPusherBot的uids"),required:!1}],wxPusherSpt:[{label:"wxPusherSptList",tip:a.ZP.get("wxPusherSpt的SPT"),required:!0}],wpush:[{label:"wpushApiKey",tip:a.ZP.get("WPUSH的API Key,在 https://wpush.cn/settings 获取,参考 https://wpush.cn/docs"),required:!0},{label:"wpushChannel",tip:a.ZP.get("推送渠道,支持 wechat/app/sms/mail/webhook/dingtalk/feishu/wechat_work/clawbot/qqbot,默认 wechat")},{label:"wpushTopicCode",tip:a.ZP.get("可选,Topic 广播编码;填写后按 Topic 推送,参考 https://wpush.cn/docs")}],openiLink:[{label:"openiLinkAppToken",tip:a.ZP.get("OpeniLink的app_token,在OpeniLink Hub后台安装App后获取,参考 https://openilink.com/docs/hub/apps"),required:!0},{label:"openiLinkHubUrl",tip:a.ZP.get("OpeniLink Hub地址,默认为 https://hub.openilink.com,自建Hub时填写自己的地址")},{label:"openiLinkContextToken",tip:a.ZP.get("OpeniLink的context_token,用于标识消息会话上下文,可从消息事件中获取")}],lark:[{label:"larkKey",tip:a.ZP.get("飞书群组机器人:https://www.feishu.cn/hc/zh-CN/articles/360024984973"),required:!0},{label:"larkSecret",tip:a.ZP.get("飞书群组机器人加签密钥,安全设置中开启签名校验后获得")}],email:[{label:"emailService",tip:a.ZP.get("邮箱服务名称,比如126、163、Gmail、QQ等,支持列表https://github.com/nodemailer/nodemailer/blob/master/lib/well-known/services.json"),required:!0},{label:"emailUser",tip:a.ZP.get("邮箱认证地址"),required:!0},{label:"emailPass",tip:a.ZP.get("SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定"),required:!0},{label:"emailTo",tip:a.ZP.get("收件邮箱地址,多个分号分隔,默认发送给发件邮箱地址")}],pushMe:[{label:"pushMeKey",tip:a.ZP.get("PushMe的Key,https://push.i-i.me/"),required:!0},{label:"pushMeUrl",tip:a.ZP.get("自建的PushMeServer消息接口地址,例如:http://127.0.0.1:3010,不填则使用官方消息接口"),required:!1}],chronocat:[{label:"chronocatURL",tip:a.ZP.get("Chronocat Red 服务的连接地址 https://chronocat.vercel.app/install/docker/official/"),required:!0},{label:"chronocatQQ",tip:a.ZP.get("个人:user_id=个人QQ 群则填入group_id=QQ群 多个用英文;隔开同时支持个人和群 如:user_id=xxx;group_id=xxxx;group_id=xxxxx"),required:!0},{label:"chronocatToken",tip:a.ZP.get("docker安装在持久化config目录下的chronocat.yml文件可找到"),required:!0}],webhook:[{label:"webhookMethod",tip:a.ZP.get("请求方法"),required:!0,items:[{value:"GET"},{value:"POST"},{value:"PUT"}]},{label:"webhookContentType",tip:a.ZP.get("请求头Content-Type"),required:!0,items:[{value:"text/plain"},{value:"application/json"},{value:"multipart/form-data"},{value:"application/x-www-form-urlencoded"}]},{label:"webhookUrl",tip:a.ZP.get("请求链接以http或者https开头。url或者body中必须包含$title,$content可选,对应api内容的位置"),required:!0,placeholder:"https://xxx.cn/api?content=$title\n"},{label:"webhookHeaders",tip:a.ZP.get("请求头格式Custom-Header1: Header1,多个换行分割"),placeholder:"Custom-Header1: Header1\nCustom-Header2: Header2"},{label:"webhookBody",tip:a.ZP.get("请求体格式key1: value1,多个换行分割。url或者body中必须包含$title,$content可选,对应api内容的位置"),placeholder:"key1: $title\nkey2: $content"}]},documentTitleMap:{"/login":a.ZP.get("登录"),"/initialization":a.ZP.get("初始化"),"/crontab":a.ZP.get("定时任务"),"/env":a.ZP.get("环境变量"),"/subscription":a.ZP.get("订阅管理"),"/config":a.ZP.get("配置文件"),"/script":a.ZP.get("脚本管理"),"/diff":a.ZP.get("对比工具"),"/log":a.ZP.get("日志管理"),"/setting":a.ZP.get("系统设置"),"/error":a.ZP.get("错误日志"),"/dependence":a.ZP.get("依赖管理"),"/dashboard":a.ZP.get("仪表盘")},dependenceTypes:["nodejs","python3","linux"]}},97302:function(e,t,n){"use strict";n.d(t,{eY:function(){return a},um:function(){return r},z:function(){return i}});var a=" ",r={".py":"python",".js":"javascript",".mjs":"javascript",".sh":"shell",".ts":"typescript",".ini":"ini",".json":"json"},i=["UTC","Africa/Abidjan","Africa/Accra","Africa/Addis Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar es Salaam","Africa/Djibouti","Africa/Douala","Africa/El Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La Rioja","America/Argentina/Mendoza","America/Argentina/Rio Gallegos","America/Argentina/Salta","America/Argentina/San Juan","America/Argentina/San Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa Vista","America/Bogota","America/Boise","America/Cambridge Bay","America/Campo Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Ciudad Juarez","America/Costa Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El Salvador","America/Fort Nelson","America/Fortaleza","America/Glace Bay","America/Goose Bay","America/Grand Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La Paz","America/Lima","America/Los Angeles","America/Lower Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New York","America/Nome","America/Noronha","America/North Dakota/Beulah","America/North Dakota/Center","America/North Dakota/New Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Paramaribo","America/Phoenix","America/Port of Spain","America/Port-au-Prince","America/Porto Velho","America/Puerto Rico","America/Punta Arenas","America/Rankin Inlet","America/Recife","America/Regina","America/Resolute","America/Rio Branco","America/Santarem","America/Santiago","America/Santo Domingo","America/Sao Paulo","America/Scoresbysund","America/Sitka","America/St Barthelemy","America/St Johns","America/St Kitts","America/St Lucia","America/St Thomas","America/St Vincent","America/Swift Current","America/Tegucigalpa","America/Thule","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho Chi Minh","Asia/Hong Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South Georgia","Atlantic/St Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken Hill","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Etc/GMT","Etc/GMT+1","Etc/GMT+10","Etc/GMT+11","Etc/GMT+12","Etc/GMT+2","Etc/GMT+3","Etc/GMT+4","Etc/GMT+5","Etc/GMT+6","Etc/GMT+7","Etc/GMT+8","Etc/GMT+9","Etc/GMT-1","Etc/GMT-10","Etc/GMT-11","Etc/GMT-12","Etc/GMT-13","Etc/GMT-14","Etc/GMT-2","Etc/GMT-3","Etc/GMT-4","Etc/GMT-5","Etc/GMT-6","Etc/GMT-7","Etc/GMT-8","Etc/GMT-9","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle of Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kirov","Europe/Kyiv","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kanton","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"]},56212:function(e,t,n){"use strict";n.d(t,{W:function(){return Z}});var a=n(90228),r=n.n(a),i=n(87999),o=n.n(i),s=n(72317),c=n(61508),l=n(33839),u=n(3475),d=n(98783),p=n(62664),g=n(52676);c.ZP.config({duration:2});var h=Date.now(),f=p.Z.create({timeout:6e4,params:{t:h}}),m=["".concat(u.Z.baseUrl,"api/health"),"".concat(u.Z.baseUrl,"api/user/login"),"".concat(u.Z.baseUrl,"open/auth/token"),"".concat(u.Z.baseUrl,"api/user/two-factor/login"),"".concat(u.Z.baseUrl,"api/system"),"".concat(u.Z.baseUrl,"api/user/init")];f.interceptors.request.use((function(e){var t=localStorage.getItem(u.Z.authKey);return t&&!m.includes(e.url)?(e.headers.Authorization="Bearer ".concat(t),e):e})),f.interceptors.response.use(function(){var e=o()(r()().mark((function e(t){var n,a,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}d.history.push("/error"),e.next=19;break;case 5:if(401!==n){e.next=10;break}localStorage.removeItem(u.Z.authKey),"/login"!==d.history.location.pathname&&d.history.push("/login"),e.next=19;break;case 10:return e.prev=10,200!==(a=t.data).code&&(i=a.message||a.data)&&l.Z.error({message:i,description:null!=a&&a.errors?(0,g.jsx)(g.Fragment,{children:null==a?void 0:a.errors.map((function(e){return(0,g.jsx)("div",{children:e.message})}))}):void 0}),e.abrupt("return",a);case 16:e.prev=16,e.t0=e.catch(10);case 18:case 19:return e.abrupt("return",t);case 20:case"end":return e.stop()}}),e,null,[[10,16]])})));return function(t){return e.apply(this,arguments)}}(),(function(e){if(e.response){var t=e.response.data?e.response.data.message||e.message:e.response.statusText,n=(o=e.response.data,h=(null==o||null===(p=o.errors)||void 0===p?void 0:p.map((function(e){return void 0===e.value?e.message:"".concat(e.message," (").concat(String(e.value),")")})))||[],Object.values((null==o?void 0:o.validation)||{}).forEach((function(e){var t;null!==(t=e.keys)&&void 0!==t&&t.length?e.keys.forEach((function(t){h.push(e.message?"".concat(t,": ").concat(e.message):t)})):e.message&&h.push(e.message)})),h.filter((function(e){return Boolean(e)}))),a=e.response.status;if([502,504].includes(a))d.history.push("/error");else if(401===a)localStorage.removeItem(u.Z.authKey),"/login"!==d.history.location.pathname&&(c.ZP.error(s.ZP.get("登录已过期,请重新登录")),d.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);t&&l.Z.error({message:t,description:n.length?(0,g.jsx)(g.Fragment,{children:n.map((function(e,t){return(0,g.jsx)("div",{children:e},"".concat(t,"-").concat(e))}))}):void 0})}}else console.log(e.message);var o,p,h;return Promise.reject(e)}));var Z=f},48916:function(e,t,n){"use strict";n.d(t,{DY:function(){return p},FA:function(){return h},H$:function(){return Z},I1:function(){return d},W9:function(){return l},o4:function(){return P},rS:function(){return m},w7:function(){return u},x$:function(){return g}});var a=n(15558),r=n.n(a),i=n(72317),o=n(97302),s=n(91379),c=n.n(s);function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.extraHeight,n=e.target;void 0===t&&(t=99);var a=null,r=0;(a=n||document.querySelector(".ant-table-wrapper"))&&(r=a.getBoundingClientRect().top);var i=document.body.clientHeight-r-t;return i}function u(e,t){var n,a,r=window.URL||window.webkitURL||window,i=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=r.createObjectURL(i),o.download=e,n=o,(a=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(a)}function d(e,t,n){var a=r()(e),i=[];return function e(a){if(a)for(var r=0;r<(null==a?void 0:a.length);r++){if(t(a[r]))return n?void(a[r].children?a[r].children.unshift(n):a[r].children=[n]):void a.splice(r,1);a[r].children&&(i.push(a[r].key),e(a[r].children))}}(a),a}function p(e,t){var n;return function e(a){if(a)for(var r=0;r<(null==a?void 0:a.length);r++)t(a[r])?n=a[r]:a[r].children&&e(a[r].children)}(r()(e)),n}function g(e){return[o.eY,i.ZP.get("执行结束")].some((function(t){return e.includes(t)}))}function h(e){var t=e.split(" ");if("repo"===t[1]||"raw"===t[1])return t[2];var n=t.find((function(e){return[".js",".ts",".sh",".py"].some((function(t){return e.endsWith(t)}))}));if(n){var a,r,i="".concat(window.__ENV__QL_DIR,"/data/scripts");n.startsWith(i)&&(n=n.replace(i,""));var o=n.lastIndexOf("/");return o>=0?(r=n.slice(o+1),a=n.slice(0,o)):(r=n,a=""),[r,a]}}function f(e){try{var t=c().parse(e);if(t)return t.next().toDate()}catch(e){}return null}function m(e,t){var n=f(e);return null!=t&&t.length&&t.forEach((function(e){var t=f(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.um[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"}},65814:function(e,t,n){"use strict";var a=n(15558),r=n.n(a),i=n(67825),o=n.n(i),s=n(90228),c=n.n(s),l=n(87999),u=n.n(l),d=n(25298),p=n.n(d),g=n(17069),h=n.n(g),f=n(82092),m=n.n(f),Z=n(78078),P=n.n(Z),x=n(72317),v=["type"],y=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()(c()().mark((function e(){var t=this;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.state="connecting",this.emit("connecting");case 3:if(!(this.reconnectAttempts<this.options.maxReconnectAttempts)){e.next=16;break}return this.socket=new(P())(this.url),this.setupEventListeners(),this.startHeartbeat(),e.next=9,this.waitForClose();case 9:return this.stopHeartbeat(),this.socket=null,this.reconnectAttempts++,e.next=14,new Promise((function(e){return setTimeout(e,t.options.reconnectInterval)}));case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this.handleError(e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(){return n.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;this.socket&&(this.socket.onopen=function(){e.state="open",e.emit("open")},this.socket.onmessage=function(t){var n=JSON.parse(t.data);e.dispatchMessage(n)},this.socket.onclose=function(){e.state="closed",e.emit("close")})}},{key:"waitForClose",value:(t=u()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null===(t=this.socket)||void 0===t?void 0:t.readyState)===P().CLOSED){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,100)}));case 3:e.next=0;break;case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"subscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(!n.has(t)){n.add(t),this.subscriptions.set(e,n);var a={action:"subscribe",topic:e};this.send(a)}}},{key:"unsubscribe",value:function(e,t){var n=this.subscriptions.get(e)||new Set;if(n.has(t)){n.delete(t);var a={action:"unsubscribe",topic:e};this.send(a)}}},{key:"send",value:function(e){var t;(null===(t=this.socket)||void 0===t?void 0:t.readyState)===P().OPEN&&this.socket.send(JSON.stringify(e))}},{key:"dispatchMessage",value:function(e){var t=e.type,n=o()(e,v),a=this.subscriptions.get(t)||new Set;r()(a).forEach((function(e){return e(n)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatTimeout=setInterval((function(){var t;(null===(t=e.socket)||void 0===t?void 0:t.readyState)===P().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(x.ZP.get("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()(y,"instance",null),t.Z=y},68251:function(){},16130:function(){},6057:function(){}}]);
|
|
Binary file
|