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