@whyour/qinglong 2.21.0-7 → 2.21.0-8
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 +1 -1
- package/static/build/api/system.js +6 -7
- package/static/build/loaders/express.js +1 -6
- package/static/build/services/user.js +3 -0
- package/static/build/shared/auth.js +7 -1
- package/static/dist/3191.545ab873.async.js +1 -0
- package/static/dist/index.html +2 -2
- package/static/dist/{preload_helper.0148f907.js → preload_helper.3048fe5b.js} +1 -1
- package/static/dist/{umi.19f46d39.js → umi.a54a59f6.js} +1 -1
- package/static/dist/3191.37d489cf.async.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_whyour_qinglong=self.webpackChunk_whyour_qinglong||[]).push([[3191],{23191:function(e,t,n){"use strict";n.r(t);var l=n(335),a=n.n(l),r=n(90228),o=n.n(r),i=n(26068),s=n.n(i),c=n(87999),u=n.n(c),d=n(48305),h=n.n(d),p=n(72317),Z=n(75271),x=n(35181),g=n(72338),m=n(61508),P=n(17082),f=n(56646),v=n(45520),j=n(94747),b=n(9171),C=n(16314),w=n(3475),y=n(91379),k=n.n(y),I=n(46207),_=n.n(I),S=n(52676),R=x.Z.Option,T=/([^\/\:]+\/[^\/]+)(?=\.git)/,F=/([^\/\:]+\/[^\/\.]+)\.[a-z]+$/;t.default=function(e){var t,n=e.subscription,l=e.handleCancel,r=g.Z.useForm(),i=h()(r,1)[0],c=(0,Z.useState)(!1),d=h()(c,2),y=d[0],I=d[1],O=(0,Z.useState)((null==n?void 0:n.type)||"public-repo"),V=h()(O,2),q=V[0],A=V[1],N=(0,Z.useState)((null==n?void 0:n.schedule_type)||"crontab"),E=h()(N,2),D=E[0],z=E[1],K=(0,Z.useState)((null==n?void 0:n.pull_type)||"ssh-key"),B=h()(K,2),G=B[0],H=B[1],L=function(){var e=u()(o()().mark((function e(t){var a,r,i,c,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(!0),a=n?"put":"post",r=s()(s()({},t),{},{autoAddCron:Boolean(t.autoAddCron),autoDelCron:Boolean(t.autoDelCron)}),n&&(r.id=n.id),e.prev=4,e.next=7,C.W[a]("".concat(w.Z.apiPrefix,"subscriptions"),r);case 7:i=e.sent,c=i.code,u=i.data,200===c&&(m.ZP.success(n?p.ZP.get("更新订阅成功"):p.ZP.get("创建订阅成功")),l(u)),I(!1),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),I(!1);case 17:case"end":return e.stop()}}),e,null,[[4,14]])})));return function(t){return e.apply(this,arguments)}}(),W=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:q,l="",a="file"===n?F:T;return a.test(e)&&(l=e.match(a)[1].replaceAll("/","_").replaceAll(".","_")),t&&(l=l+"_"+t),l},$=function(e){var t=e.value,n=e.onChange,l=(0,Z.useState)("days"),a=h()(l,2),r=a[0],o=a[1],i=(0,Z.useState)(),s=h()(i,2),c=s[0],u=s[1];return(0,Z.useEffect)((function(){t&&(o(t.type),u(t.value))}),[t]),(0,S.jsxs)(P.Z.Group,{compact:!0,children:[(0,S.jsx)(f.Z,{addonBefore:p.ZP.get("每"),precision:0,min:1,value:c,style:{width:"calc(100% - 58px)"},onChange:function(e){u(e||1),e?null==n||n({type:r,value:e}):null==n||n(null)}}),(0,S.jsxs)(x.Z,{value:r,onChange:function(e){o(e),c&&c>0&&(null==n||n({type:e,value:c}))},children:[(0,S.jsx)(R,{value:"days",children:p.ZP.get("天")}),(0,S.jsx)(R,{value:"hours",children:p.ZP.get("时")}),(0,S.jsx)(R,{value:"minutes",children:p.ZP.get("分")}),(0,S.jsx)(R,{value:"seconds",children:p.ZP.get("秒")})]})]})},J=function(e){e.value,e.onChange;return"ssh-key"===e.type?(0,S.jsx)(g.Z.Item,{name:["pull_option","private_key"],label:p.ZP.get("私钥"),rules:[{required:!0}],children:(0,S.jsx)(P.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:6},placeholder:p.ZP.get("请输入私钥")})}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(g.Z.Item,{name:["pull_option","username"],label:p.ZP.get("用户名"),rules:[{required:!0}],children:(0,S.jsx)(P.Z,{placeholder:p.ZP.get("请输入认证用户名")})}),(0,S.jsx)(g.Z.Item,{name:["pull_option","password"],tooltip:p.ZP.get("Github已不支持密码认证,请使用Token方式"),label:p.ZP.get("密码/Token"),rules:[{required:!0}],children:(0,S.jsx)(P.Z,{placeholder:p.ZP.get("请输入密码或者Token")})})]})},M=(0,Z.useCallback)((function(e){var t=e.clipboardData.getData("text");if(t.startsWith("ql ")){var n=function(e){var t,n=[],l="",r=!1,o=!1,i=!1,s=a()(e);try{for(s.s();!(t=s.n()).done;){var c=t.value;if(r){if('"'===c){r=!1,i=!0;continue}l+=c}else if(o){if("'"===c){o=!1,i=!0;continue}l+=c}else'"'===c?(r=!0,i=!1):"'"===c?(o=!0,i=!1):" "===c||"\t"===c?(l||i)&&(n.push(l),l="",i=!1):(l+=c,i=!1)}}catch(e){s.e(e)}finally{s.f()}return(l||i)&&n.push(l),n}(t),l=n[1],r=n[2]||"",o=n[3]||"",s=n[4]||"",c=n[5]||"",u=n[6]||"",d=n[7]||"",h="raw"===l?"file":r.startsWith("http")?"public-repo":"private-repo";i.setFieldsValue({type:h,url:r,whitelist:o,blacklist:s,dependences:c,branch:u,extensions:d,alias:W(r,u,h)}),A(h)}}),[]),Q=(0,Z.useCallback)((function(e){var t=e.clipboardData.getData("text");(t.includes("ql repo")||t.includes("ql raw"))&&e.preventDefault()}),[]);return(0,Z.useEffect)((function(){return window.addEventListener("paste",M),function(){window.removeEventListener("paste",M)}}),[]),(0,S.jsx)(v.Z,{title:n?p.ZP.get("编辑订阅"):p.ZP.get("创建订阅"),open:!0,forceRender:!0,centered:!0,maskClosable:!1,onOk:function(){i.validateFields().then((function(e){L(e)})).catch((function(e){console.log("Validate Failed:",e)}))},onCancel:function(){return l()},confirmLoading:y,children:(0,S.jsxs)(g.Z,{form:i,name:"form_in_modal",layout:"vertical",initialValues:s()(s()({},n),(t=n,s()(s()({},t),{},{autoAddCron:!!_()(null==t?void 0:t.autoAddCron)||Boolean(null==t?void 0:t.autoAddCron),autoDelCron:!!_()(null==t?void 0:t.autoDelCron)||Boolean(null==t?void 0:t.autoDelCron)}))),children:[(0,S.jsx)(g.Z.Item,{name:"name",label:p.ZP.get("名称"),rules:[{required:!0}],children:(0,S.jsx)(P.Z,{placeholder:p.ZP.get("支持拷贝 ql repo/raw 命令,粘贴导入"),onPaste:Q})}),(0,S.jsx)(g.Z.Item,{name:"type",label:p.ZP.get("类型"),rules:[{required:!0}],initialValue:"public-repo",children:(0,S.jsxs)(j.ZP.Group,{onChange:function(e){A(e.target.value);var t=i.getFieldValue("url"),n=i.getFieldValue("branch");i.setFieldsValue({alias:W(t,n,e.target.value)}),t&&i.validateFields(["url"])},children:[(0,S.jsx)(j.ZP,{value:"public-repo",children:p.ZP.get("公开仓库")}),(0,S.jsx)(j.ZP,{value:"private-repo",children:p.ZP.get("私有仓库")}),(0,S.jsx)(j.ZP,{value:"file",children:p.ZP.get("单文件")})]})}),(0,S.jsx)(g.Z.Item,{name:"url",label:p.ZP.get("链接"),rules:[{required:!0},{pattern:"file"===q?F:T}],children:(0,S.jsx)(P.Z.TextArea,{autoSize:{minRows:1,maxRows:5},placeholder:p.ZP.get("请输入订阅链接"),onPaste:Q,onChange:function(e){var t=i.getFieldValue("branch");i.setFieldsValue({alias:W(e.target.value,t)})}})}),"file"!==q&&(0,S.jsx)(g.Z.Item,{name:"branch",label:p.ZP.get("分支"),children:(0,S.jsx)(P.Z,{placeholder:p.ZP.get("请输入分支"),onPaste:Q,onChange:function(e){var t=i.getFieldValue("url");i.setFieldsValue({alias:W(t,e.target.value)})}})}),(0,S.jsx)(g.Z.Item,{name:"alias",label:p.ZP.get("唯一值"),rules:[{required:!0,message:""}],tooltip:p.ZP.get("唯一值用于日志目录和私钥别名"),children:(0,S.jsx)(P.Z,{placeholder:p.ZP.get("自动生成"),disabled:!0})}),"private-repo"===q&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(g.Z.Item,{name:"pull_type",label:p.ZP.get("拉取方式"),initialValue:"ssh-key",rules:[{required:!0}],children:(0,S.jsxs)(j.ZP.Group,{onChange:function(e){H(e.target.value)},children:[(0,S.jsx)(j.ZP,{value:"ssh-key",children:p.ZP.get("私钥")}),(0,S.jsx)(j.ZP,{value:"user-pwd",children:p.ZP.get("用户名密码/Token")})]})}),(0,S.jsx)(J,{type:G})]}),(0,S.jsx)(g.Z.Item,{name:"schedule_type",label:p.ZP.get("定时类型"),initialValue:"crontab",rules:[{required:!0}],children:(0,S.jsxs)(j.ZP.Group,{onChange:function(e){z(e.target.value),i.setFieldsValue({schedule:""})},children:[(0,S.jsx)(j.ZP,{value:"crontab",children:"crontab"}),(0,S.jsx)(j.ZP,{value:"interval",children:"interval"})]})}),(0,S.jsx)(g.Z.Item,{name:"crontab"===D?"schedule":"interval_schedule",label:p.ZP.get("定时规则"),rules:[{required:!0},{validator:function(e,t){try{return"interval"===D||!t||k().parse(t).hasNext()?Promise.resolve():Promise.reject(p.ZP.get("Subscription表达式格式有误"))}catch(e){return Promise.reject(p.ZP.get("Subscription表达式格式有误"))}}}],children:"interval"===D?(0,S.jsx)($,{}):(0,S.jsx)(P.Z,{onPaste:Q,placeholder:p.ZP.get("秒(可选) 分 时 天 月 周")})}),"file"!==q&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(g.Z.Item,{name:"whitelist",label:p.ZP.get("白名单"),tooltip:p.ZP.get("多个关键词竖线分割,支持正则表达式"),children:(0,S.jsx)(P.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:p.ZP.get("请输入脚本筛选白名单关键词,多个关键词竖线分割"),onPaste:Q})}),(0,S.jsx)(g.Z.Item,{name:"blacklist",label:p.ZP.get("黑名单"),tooltip:p.ZP.get("多个关键词竖线分割,支持正则表达式"),children:(0,S.jsx)(P.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:p.ZP.get("请输入脚本筛选黑名单关键词,多个关键词竖线分割"),onPaste:Q})}),(0,S.jsx)(g.Z.Item,{name:"dependences",label:p.ZP.get("依赖文件"),tooltip:p.ZP.get("多个关键词竖线分割,支持正则表达式"),children:(0,S.jsx)(P.Z.TextArea,{rows:4,autoSize:{minRows:1,maxRows:5},placeholder:p.ZP.get("请输入脚本依赖文件关键词,多个关键词竖线分割"),onPaste:Q})}),(0,S.jsx)(g.Z.Item,{name:"extensions",label:p.ZP.get("文件后缀"),tooltip:p.ZP.get("仓库需要拉取的文件后缀,多个后缀空格分隔,默认使用配置文件中的RepoFileExtensions"),children:(0,S.jsx)(P.Z,{onPaste:Q,placeholder:p.ZP.get("请输入文件后缀")})}),(0,S.jsx)(g.Z.Item,{name:"sub_before",label:p.ZP.get("执行前"),tooltip:p.ZP.get("运行订阅前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js"),children:(0,S.jsx)(P.Z.TextArea,{onPaste:Q,rows:4,autoSize:{minRows:1,maxRows:5},placeholder:p.ZP.get("请输入运行订阅前要执行的命令")})}),(0,S.jsx)(g.Z.Item,{name:"sub_after",label:p.ZP.get("执行后"),tooltip:p.ZP.get("运行订阅后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js"),children:(0,S.jsx)(P.Z.TextArea,{onPaste:Q,rows:4,autoSize:{minRows:1,maxRows:5},placeholder:p.ZP.get("请输入运行订阅后要执行的命令")})})]}),(0,S.jsx)(g.Z.Item,{name:"proxy",label:p.ZP.get("代理"),tooltip:p.ZP.get("公开仓库支持HTTP/SOCK5代理,私有仓库支持SOCK5代理"),children:(0,S.jsx)(P.Z,{onPaste:Q,placeholder:"private-repo"===q?"SOCK5代理,例如 IP:PORT":"HTTP/SOCK5代理,例如 http://127.0.0.1:1080"})}),(0,S.jsxs)(g.Z.Item,{style:{marginBottom:0},className:"inline-form-item",children:[(0,S.jsx)(g.Z.Item,{name:"autoAddCron",label:p.ZP.get("自动添加任务"),valuePropName:"checked",initialValue:!0,children:(0,S.jsx)(b.Z,{})}),(0,S.jsx)(g.Z.Item,{name:"autoDelCron",label:p.ZP.get("自动删除任务"),valuePropName:"checked",initialValue:!0,children:(0,S.jsx)(b.Z,{})})]})]})})}},9171:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var l=n(2053),a=n(57904),r=n(24727),o=n(82187),i=n.n(o),s=n(99459),c=n(58006),u=n(75271),d=n(6522),h=n(1260),p=u.forwardRef((function(e,t){var n,l=e.prefixCls,r=void 0===l?"rc-switch":l,o=e.className,p=e.checked,Z=e.defaultChecked,x=e.disabled,g=e.loadingIcon,m=e.checkedChildren,P=e.unCheckedChildren,f=e.onClick,v=e.onChange,j=e.onKeyDown,b=(0,c.Z)(e,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),C=(0,d.Z)(!1,{value:p,defaultValue:Z}),w=(0,s.Z)(C,2),y=w[0],k=w[1];function I(e,t){var n=y;return x||(k(n=e),null==v||v(n,t)),n}var _=i()(r,o,(n={},(0,a.Z)(n,"".concat(r,"-checked"),y),(0,a.Z)(n,"".concat(r,"-disabled"),x),n));return u.createElement("button",Object.assign({},b,{type:"button",role:"switch","aria-checked":y,disabled:x,className:_,ref:t,onKeyDown:function(e){e.which===h.Z.LEFT?I(!1,e):e.which===h.Z.RIGHT&&I(!0,e),null==j||j(e)},onClick:function(e){var t=I(!y,e);null==f||f(t,e)}}),g,u.createElement("span",{className:"".concat(r,"-inner")},y?m:P))}));p.displayName="Switch";var Z=p,x=n(96820),g=n(30107),m=n(38470),P=n(74244),f=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(l=Object.getOwnPropertySymbols(e);a<l.length;a++)t.indexOf(l[a])<0&&Object.prototype.propertyIsEnumerable.call(e,l[a])&&(n[l[a]]=e[l[a]])}return n},v=u.forwardRef((function(e,t){var n=e.prefixCls,o=e.size,s=e.disabled,c=e.loading,d=e.className,h=void 0===d?"":d,p=f(e,["prefixCls","size","disabled","loading","className"]),v=u.useContext(x.E_),j=v.getPrefixCls,b=v.direction,C=u.useContext(m.Z),w=u.useContext(g.Z),y=(null!=s?s:w)||c,k=j("switch",n),I=u.createElement("div",{className:"".concat(k,"-handle")},c&&u.createElement(r.Z,{className:"".concat(k,"-loading-icon")})),_=i()((0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(k,"-small"),"small"===(o||C)),"".concat(k,"-loading"),c),"".concat(k,"-rtl"),"rtl"===b),h);return u.createElement(P.Z,{insertExtraNode:!0},u.createElement(Z,(0,l.Z)({},p,{prefixCls:k,className:_,disabled:y,ref:t,loadingIcon:I})))}));v.__ANT_SWITCH=!0;var j=v},46207:function(e){e.exports=function(e){return null==e}}}]);
|