11 lines
22 KiB
JavaScript
11 lines
22 KiB
JavaScript
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[96],{83187:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var _Users_a1_6_Code_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(54689),_Users_a1_6_Code_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_Users_a1_6_Code_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0__),_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(81308),_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(48989),antd__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(79112),lodash__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(32699),lodash__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__),react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(50959),_submit__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(87474),_umijs_max__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(86195),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(11527);__webpack_exports__.Z=function(props){for(var _props$data$script,content=(_props$data$script=props.data.script)!==null&&_props$data$script!==void 0?_props$data$script:props.editorRef.current?props.editorRef.current.getValue().replace(/\r\n/g,`
|
|
`):"",formRef=(0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(),result=[],keys=[],_i=0,_arr=[/@form\s+({[^*]+?}\n)/g,/Form\(([\s\S]+?)\)/g];_i<_arr.length;_i++){var pattern=_arr[_i],matches=content.matchAll(pattern),_iterator=_Users_a1_6_Code_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_0___default()(matches),_step;try{var _loop=function _loop(){var match=_step.value;try{var _a=function(u){for(var a in u)u[a].dataIndex&&(u[a].key=u[a].dataIndex),u[a].key&&keys.push(u[a].key),u[a].required&&!u[a].formItemProps&&(u[a].formItemProps={rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}),u[a].columns&&(u[a].columns=_a(u[a].columns));return u},formObject=eval("(".concat(match[1],")"));(0,lodash__WEBPACK_IMPORTED_MODULE_1__.isArray)(formObject)||(formObject=[formObject]),result=result.concat(formObject),keys=[],result=_a(result)}catch(v){console.log("form\u8868\u5355\u89E3\u6790\u9519\u8BEF",v)}};for(_iterator.s();!(_step=_iterator.n()).done;)_loop()}catch(v){_iterator.e(v)}finally{_iterator.f()}}var dbkey="plugin_debug."+props.data.id;return result.push({key:dbkey,title:"\u8C03\u8BD5\u5F00\u5173",valueType:"switch"}),keys.push(dbkey),(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function(){(0,_umijs_max__WEBPACK_IMPORTED_MODULE_4__.request)("/api/storage",{params:{keys:keys.join(",")}}).then(function(v){if(v&&v.data){var u;for(var a in v.data)v.data[a]=="false"&&(v.data[a]=!1),v.data[a]==""&&delete v.data[a];(u=formRef.current)===null||u===void 0||u.setFieldsValue(v.data)}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(antd__WEBPACK_IMPORTED_MODULE_6__.Z,{title:"\u53C2\u6570\u914D\u7F6E",open:props.open,onCancel:props.onCancel,onOk:function v(){var u,a=formRef==null||(u=formRef.current)===null||u===void 0?void 0:u.getFieldsValue();(0,_submit__WEBPACK_IMPORTED_MODULE_3__.Z)({values:a,params:{uuid:props.data.id}}).then(function(R){(R==null?void 0:R.changes[dbkey])==!0&&props.setDebug&&props.setDebug(a[dbkey])}).finally(function(){props.onCancel()})},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_7__.A,{formRef,submitter:!1,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_8__.Z,{layoutType:"Embed",columns:result})})})}},53385:function(v,u,a){a.r(u),a.d(u,{default:function(){return gt}});var R=a(25359),Z=a.n(R),ge=a(49811),ne=a.n(ge),W=a(54306),p=a.n(W),pe=a(83187),he=a(79112),l=a(50959),C=a(70458),re=a(21946),G=a(84875),j=a.n(G),Y=a(7489),J=function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,r=Object.getOwnPropertySymbols(e);d<r.length;d++)t.indexOf(r[d])<0&&Object.prototype.propertyIsEnumerable.call(e,r[d])&&(o[r[d]]=e[r[d]]);return o},H=e=>{var{prefixCls:t,className:o,color:r="blue",dot:d,pending:K=!1,position:w,label:y,children:E}=e,M=J(e,["prefixCls","className","color","dot","pending","position","label","children"]);const{getPrefixCls:z}=l.useContext(C.E_),h=z("timeline",t),L=j()({[`${h}-item`]:!0,[`${h}-item-pending`]:K},o),x=/blue|red|green|gray/.test(r||"")?void 0:r,$=j()({[`${h}-item-head`]:!0,[`${h}-item-head-custom`]:!!d,[`${h}-item-head-${r}`]:!x});return l.createElement("li",Object.assign({},M,{className:L}),y&&l.createElement("div",{className:`${h}-item-label`},y),l.createElement("div",{className:`${h}-item-tail`}),l.createElement("div",{className:$,style:{borderColor:x,color:x}},d),l.createElement("div",{className:`${h}-item-content`},E))},F=function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,r=Object.getOwnPropertySymbols(e);d<r.length;d++)t.indexOf(r[d])<0&&Object.prototype.propertyIsEnumerable.call(e,r[d])&&(o[r[d]]=e[r[d]]);return o},Ze=e=>{var{prefixCls:t,className:o,pending:r=!1,children:d,items:K,rootClassName:w,reverse:y=!1,direction:E,hashId:M,pendingDot:z,mode:h=""}=e,L=F(e,["prefixCls","className","pending","children","items","rootClassName","reverse","direction","hashId","pendingDot","mode"]);const x=(_,T)=>h==="alternate"?_==="right"?`${t}-item-right`:_==="left"?`${t}-item-left`:T%2===0?`${t}-item-left`:`${t}-item-right`:h==="left"?`${t}-item-left`:h==="right"?`${t}-item-right`:_==="right"?`${t}-item-right`:"",$=(0,re.Z)(K||[]),oe=typeof r=="boolean"?null:r;r&&$.push({pending:!!r,dot:z||l.createElement(Y.Z,null),children:oe}),y&&$.reverse();const V=$.length,de=`${t}-item-last`,Ce=$.filter(_=>!!_).map((_,T)=>{var X;const A=T===V-2?de:"",ce=T===V-1?de:"",{className:Pe}=_,ue=F(_,["className"]);return l.createElement(H,Object.assign({},ue,{className:j()([Pe,!y&&r?A:ce,x((X=_==null?void 0:_.position)!==null&&X!==void 0?X:"",T)]),key:(_==null?void 0:_.key)||T}))}),q=$.some(_=>!!(_!=null&&_.label)),ee=j()(t,{[`${t}-pending`]:!!r,[`${t}-reverse`]:!!y,[`${t}-${h}`]:!!h&&!q,[`${t}-label`]:q,[`${t}-rtl`]:E==="rtl"},o,w,M);return l.createElement("ul",Object.assign({},L,{className:ee}),Ce)},N=a(77515);function be(e,t){return e&&Array.isArray(e)?e:(0,N.Z)(t).map(o=>{var r,d;return Object.assign({children:(d=(r=o==null?void 0:o.props)===null||r===void 0?void 0:r.children)!==null&&d!==void 0?d:""},o.props)})}var P=be,Q=a(97624),Se=a(74074),ye=a(49272);const Je=e=>{const{componentCls:t}=e;return{[t]:Object.assign(Object.assign({},(0,ye.Wf)(e)),{margin:0,padding:0,listStyle:"none",[`${t}-item`]:{position:"relative",margin:0,paddingBottom:e.timeLineItemPaddingBottom,fontSize:e.fontSize,listStyle:"none","&-tail":{position:"absolute",insetBlockStart:e.timeLineItemHeadSize,insetInlineStart:(e.timeLineItemHeadSize-e.timeLineItemTailWidth)/2,height:`calc(100% - ${e.timeLineItemHeadSize}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px ${e.lineType} ${e.colorSplit}`},"&-pending":{[`${t}-item-head`]:{fontSize:e.fontSizeSM,backgroundColor:"transparent"},[`${t}-item-tail`]:{display:"none"}},"&-head":{position:"absolute",width:e.timeLineItemHeadSize,height:e.timeLineItemHeadSize,backgroundColor:e.colorBgContainer,border:`${e.timeLineHeadBorderWidth}px ${e.lineType} transparent`,borderRadius:"50%","&-blue":{color:e.colorPrimary,borderColor:e.colorPrimary},"&-red":{color:e.colorError,borderColor:e.colorError},"&-green":{color:e.colorSuccess,borderColor:e.colorSuccess},"&-gray":{color:e.colorTextDisabled,borderColor:e.colorTextDisabled}},"&-head-custom":{position:"absolute",insetBlockStart:e.timeLineItemHeadSize/2,insetInlineStart:e.timeLineItemHeadSize/2,width:"auto",height:"auto",marginBlockStart:0,paddingBlock:e.timeLineItemCustomHeadPaddingVertical,lineHeight:1,textAlign:"center",border:0,borderRadius:0,transform:"translate(-50%, -50%)"},"&-content":{position:"relative",insetBlockStart:-(e.fontSize*e.lineHeight-e.fontSize)+e.lineWidth,marginInlineStart:e.margin+e.timeLineItemHeadSize,marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0,wordBreak:"break-word"},"&-last":{[`> ${t}-item-tail`]:{display:"none"},[`> ${t}-item-content`]:{minHeight:e.controlHeightLG*1.2}}},[`&${t}-alternate,
|
|
&${t}-right,
|
|
&${t}-label`]:{[`${t}-item`]:{"&-tail, &-head, &-head-custom":{insetInlineStart:"50%"},"&-head":{marginInlineStart:`-${e.marginXXS}px`,"&-custom":{marginInlineStart:e.timeLineItemTailWidth/2}},"&-left":{[`${t}-item-content`]:{insetInlineStart:`calc(50% - ${e.marginXXS}px)`,width:`calc(50% - ${e.marginSM}px)`,textAlign:"start"}},"&-right":{[`${t}-item-content`]:{width:`calc(50% - ${e.marginSM}px)`,margin:0,textAlign:"end"}}}},[`&${t}-right`]:{[`${t}-item-right`]:{[`${t}-item-tail,
|
|
${t}-item-head,
|
|
${t}-item-head-custom`]:{insetInlineStart:`calc(100% - ${(e.timeLineItemHeadSize+e.timeLineItemTailWidth)/2}px)`},[`${t}-item-content`]:{width:`calc(100% - ${e.timeLineItemHeadSize+e.marginXS}px)`}}},[`&${t}-pending
|
|
${t}-item-last
|
|
${t}-item-tail`]:{display:"block",height:`calc(100% - ${e.margin}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px dotted ${e.colorSplit}`},[`&${t}-reverse
|
|
${t}-item-last
|
|
${t}-item-tail`]:{display:"none"},[`&${t}-reverse ${t}-item-pending`]:{[`${t}-item-tail`]:{insetBlockStart:e.margin,display:"block",height:`calc(100% - ${e.margin}px)`,borderInlineStart:`${e.timeLineItemTailWidth}px dotted ${e.colorSplit}`},[`${t}-item-content`]:{minHeight:e.controlHeightLG*1.2}},[`&${t}-label`]:{[`${t}-item-label`]:{position:"absolute",insetBlockStart:-(e.fontSize*e.lineHeight-e.fontSize)+e.timeLineItemTailWidth,width:`calc(50% - ${e.marginSM}px)`,textAlign:"end"},[`${t}-item-right`]:{[`${t}-item-label`]:{insetInlineStart:`calc(50% + ${e.marginSM}px)`,width:`calc(50% - ${e.marginSM}px)`,textAlign:"start"}}},"&-rtl":{direction:"rtl",[`${t}-item-head-custom`]:{transform:"translate(50%, -50%)"}}})}};var Qe=(0,Q.Z)("Timeline",e=>{const t=(0,Se.TS)(e,{timeLineItemPaddingBottom:e.padding*1.25,timeLineItemHeadSize:10,timeLineItemCustomHeadPaddingVertical:e.paddingXXS,timeLinePaddingInlineEnd:2,timeLineItemTailWidth:e.lineWidthBold,timeLineHeadBorderWidth:e.wireframe?e.lineWidthBold:e.lineWidth*3});return[Je(t)]}),ke=function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,r=Object.getOwnPropertySymbols(e);d<r.length;d++)t.indexOf(r[d])<0&&Object.prototype.propertyIsEnumerable.call(e,r[d])&&(o[r[d]]=e[r[d]]);return o};const We=e=>{const{getPrefixCls:t,direction:o}=l.useContext(C.E_),{prefixCls:r,children:d,items:K}=e,w=ke(e,["prefixCls","children","items"]),y=t("timeline",r),[E,M]=Qe(y),z=P(K,d);return E(l.createElement(Ze,Object.assign({},w,{prefixCls:y,direction:o,items:z,hashId:M})))};We.Item=H;var qe=We,et=qe,i=a(11527),tt=function(e){var t;return(0,i.jsx)(he.Z,{title:"\u5F02\u5E38\u6536\u96C6 - "+((t=e.data.title)!==null&&t!==void 0?t:""),open:e.id!="",onOk:e.onOk,onCancel:e.onCancel,okButtonProps:{danger:!0},okText:"\u6E05\u7A7A",children:(0,i.jsx)(et,{mode:"alternate",items:e.data.messages})})},se=a(87474),le=a(45645),at={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},nt=at,Ke=a(26087),rt=function(t,o){return l.createElement(Ke.Z,(0,le.Z)((0,le.Z)({},t),{},{ref:o,icon:nt}))},it=l.forwardRef(rt),st={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1a184.31 184.31 0 00-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9a184.31 184.31 0 00-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8a63 63 0 01-63 63H232a63 63 0 01-63-63c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5.2 13 .7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7a273 273 0 0022.7 49c24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2a281.38 281.38 0 00123.2-149.5A120 120 0 01836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7.4-6.4.7-12.8.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3C584 874.3 548.8 884 512 884s-72-9.7-102.9-27.8c-30.3-17.7-55.6-43-73.3-73.3A202.75 202.75 0 01308 680V412h408v268z"}}]},name:"bug",theme:"outlined"},lt=st,ot=function(t,o){return l.createElement(Ke.Z,(0,le.Z)((0,le.Z)({},t),{},{ref:o,icon:lt}))},dt=l.forwardRef(ot),ct=a(12472),ut=a(37270),_t=a(50714),Oe=a(86195),mt=a(44901),ft=a(21137),O=a(4050),I=a(68243),k=a(21362),Ee="",gt=function(){var e=(0,l.useState)([]),t=p()(e,2),o=t[0],r=t[1],d=(0,Oe.useModel)("@@initialState"),K=d.refresh,w=(0,l.useState)({script:"",id:""}),y=p()(w,2),E=y[0],M=y[1],z=(0,l.useState)({id:"",messages:[]}),h=p()(z,2),L=h[0],x=h[1],$=(0,l.useState)([]),oe=p()($,2),V=oe[0],de=oe[1],Ce=(0,l.useState)([]),q=p()(Ce,2),ee=q[0],_=q[1],T=(0,l.useState)("tab1"),X=p()(T,2),A=X[0],ce=X[1],Pe=(0,l.useState)("\u5168\u90E8"),ue=p()(Pe,2),pt=ue[0],ht=ue[1],vt=(0,l.useState)(0),ze=p()(vt,2),Ie=ze[0],xe=ze[1],bt=(0,l.useState)(0),Ue=p()(bt,2),$e=Ue[0],De=Ue[1],St=(0,l.useState)(0),He=p()(St,2),je=He[0],Me=He[1],yt=(0,l.useState)({}),Fe=p()(yt,2),Ot=Fe[0],Et=Fe[1],Ct=(0,l.useState)("\u5168\u90E8"),Ne=p()(Ct,2),we=Ne[0],Pt=Ne[1],It=(0,l.useState)(!1),Ve=p()(It,2),Xe=Ve[0],Le=Ve[1],xt=(0,l.useState)(""),Ge=p()(xt,2),$t=Ge[0],Dt=Ge[1],te=(0,l.useRef)(),_e=function(c){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,i.jsx)(mt.Z,{count:c,overflowCount:1e4,style:{marginBlockStart:-2,marginInlineStart:4,color:n?"#1890FF":"#999",backgroundColor:n?"#E6F7FF":"#eee"}})};return(0,i.jsxs)(ct._z,{children:[L.id!=""&&(0,i.jsx)(tt,{data:L,onCancel:function(){x({id:"",messages:[]})},onOk:function(){var c={};c["plugin_messages."+L.id]="",(0,se.Z)({values:c}).finally(function(){x({id:"",messages:[]}),r(o.map(function(n){return n.id==L.id&&(n.messages=[]),n}))})}}),E.script!=""&&(0,i.jsx)(pe.Z,{data:E,open:E.script,onCancel:function(){M({script:"",id:""})},setDebug:function(c){o.map(function(n){return n.id==E.id&&(n.debug=c),n})}}),"\u63D2\u4EF6\u6E90\uFF1A",(0,i.jsx)(ft.Z,{title:"\u63D2\u4EF6\u6E90",value:ee,options:V,mode:"multiple",onChange:function(c){_(c.map(function(D){return{label:D,value:D}})),Le(!0);var n=te.current;n.reloadAndRest()}}),(0,i.jsx)(ut.Z,{multipleLine:!0,menu:{activeKey:pt,items:Object.entries(Ot).sort(function(f,c){return c[1]-f[1]}).map(function(f){return{key:f[0],label:(0,i.jsxs)("span",{children:[f[0],_e(f[1],f[0]==we)]})}}),onChange:function(c){ht(c),Le(!0),Pt(c);var n=te.current;n.reloadAndRest()}}}),(0,i.jsx)(_t.Rs,{actionRef:te,toolbar:{menu:{activeKey:A,items:[{key:"tab1",label:(0,i.jsxs)("span",{children:["\u5DF2\u5B89\u88C5",_e(Ie,A==="tab1")]})},{key:"tab2",label:(0,i.jsxs)("span",{children:["\u672A\u5B89\u88C5",_e($e,A==="tab2")]})},{key:"tab3",label:(0,i.jsxs)("span",{children:["\u53EF\u5347\u7EA7",_e(je,A==="tab3")]})}],onChange:function(c){ce(c);var n=te.current;n.reloadAndRest()}},search:{onSearch:function(c){Dt(c);var n=te.current;n.reloadAndRest()}}},search:{filterType:"light"},rowKey:"name",dataSource:o,request:ne()(Z()().mark(function f(){var c,n=arguments;return Z()().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return c=n.length>0&&n[0]!==void 0?n[0]:{},c.activeKey=A,c.origin=ee.map(function(s){return s.value}),c.keyword=$t,c.class=we,c.mclass=Xe?"true":"false",Ee!=""?c.init=Ee:Ee="false",m.abrupt("return",(0,Oe.request)("/api/plugins/list.json",{params:c}).then(function(s){if(Xe&&Le(!1),s!=null&&s.tab&&ce(s.tab),Object.keys(ee).length==0)if(V.length!=0)_(V);else{var S,b=Object.keys((S=s==null?void 0:s.origins)!==null&&S!==void 0?S:{}).map(function(Te){return{label:Te,value:Te}});de(b),_(b)}xe(s.tab1),De(s.tab2),Me(s.tab3),Et(s.classes);var me=new Date,g=new Date(me);g.setDate(me.getDate()-1);var ae="\u4ECA\u5929 ",jt="\u6628\u5929 ",Mt=function(Ae){var Be,Tt=(Be=s.data[Ae].messages)!==null&&Be!==void 0?Be:[],At=Tt.sort(function(B,U){return U.unix-B.unix}),Bt=At.map(function(B){var U=new Date(B.unix*1e3),Ye=U.toLocaleDateString(),Re=U.toLocaleTimeString("zh-CN",{hour12:!1}),fe;return Ye===me.toLocaleDateString()?fe=ae+Re:Ye===g.toLocaleDateString()?fe=jt+Re:fe=U.getFullYear()+"-"+(U.getMonth()+1).toString().padStart(2,"0")+"-"+U.getDate().toString().padStart(2,"0")+" "+Re,{color:B.class==="warn"?"yellow":"red",label:fe,children:(0,i.jsxs)(i.Fragment,{children:[B.version&&(0,i.jsx)(O.Z,{color:B.version==s.data[Ae].version?"cyan":"",children:B.version}),B.content]})}});s.data[Ae].messages=Bt};for(var Lt in s.data)Mt(Lt);return s}));case 8:case"end":return m.stop()}},f)})),onDataSourceChange:r,pagination:{defaultPageSize:10,pageSizeOptions:["10","20","50","100"]},showActions:"hover",metas:{avatar:{dataIndex:"icon",search:!1},title:{dataIndex:"title",search:!1},description:{dataIndex:"description",search:!1},subTitle:{render:function(c,n){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(I.Z,{size:0,children:(0,i.jsx)(O.Z,{color:n.identified?"gold":"grey",children:n.organization==""?"\u672A\u8BA4\u8BC1\u6765\u6E90":n.organization},n.organization)}),(0,i.jsx)(I.Z,{size:0,children:(0,i.jsxs)(O.Z,{color:"cyan",children:[n.downloads," \u4E0B\u8F7D"]},"downloads")}),n.module&&(0,i.jsx)(I.Z,{size:0,children:(0,i.jsx)(O.Z,{color:"purple",children:"\u6A21\u5757"},"module")}),n.web&&(0,i.jsx)(I.Z,{size:0,children:(0,i.jsx)(O.Z,{color:"brown",children:"\u7F51\u7EDC\u670D\u52A1"},"web")}),n.encrypt&&(0,i.jsx)(I.Z,{size:0,children:(0,i.jsx)(O.Z,{color:"orange",children:"\u52A0\u5BC6\u811A\u672C"},"encrypt")}),n.status==1&&(0,i.jsx)(I.Z,{size:0,children:(0,i.jsx)("a",{children:(0,i.jsx)(O.Z,{color:"pink",onClick:function(){var m={};m["plugins."+n.id]="install",(0,se.Z)({values:m,success:"\u64CD\u4F5C\u6210\u529F\uFF01"}).then(function(s){var S=s==null?void 0:s.errors["plugins."+n.id];if(S){k.ZP.warning(S,2);return}else Me(je-1);r(o.map(function(b){return b.id==n.id&&(b.status=2),b}))})},children:"\u5347\u7EA7"},n.status)})}),n.has_form&&(0,i.jsx)(I.Z,{size:0,children:(0,i.jsx)("a",{children:(0,i.jsx)(O.Z,{color:"blue",onClick:function(){var m="plugins."+n.id;(0,Oe.request)("/api/storage",{params:{keys:[m].join(",")}}).then(function(s){s!=null&&s.data&&s.data[m]&&M({script:s.data[m],id:n.id})})},children:"\u914D\u7F6E"},n.status)})}),n.running&&(0,i.jsx)(I.Z,{size:0,children:(0,i.jsx)(O.Z,{icon:(0,i.jsx)(it,{spin:!0}),color:"processing",children:"\u8FD0\u884C\u4E2D"},"running")}),n.messages.length!=0&&(0,i.jsx)(I.Z,{size:0,children:(0,i.jsx)("a",{children:(0,i.jsxs)(O.Z,{color:"red",onClick:function(){x({id:n.id,messages:n.messages,title:n.title})},children:["\u5F02\u5E38 ",n.messages.length]},"messages")})}),A=="tab1"&&(0,i.jsx)("a",{onClick:function(){var m={};m["plugin_debug."+n.id]=!n.debug,(0,se.Z)({values:m,success:""}).then(function(s){var S=s==null?void 0:s.errors["plugin_debug."+n.id];if(S){k.ZP.warning(S,2);return}else k.ZP.success("\u64CD\u4F5C\u6210\u529F\uFF01",1);r(o.map(function(b){return b.id==n.id&&(b.debug=!b.debug),b}))})},children:(0,i.jsx)(dt,{style:{opacity:n.debug?1:.2}})})]})},search:!1},actions:{render:function(c,n){return[(0,i.jsx)("a",{onClick:ne()(Z()().mark(function D(){var m,s,S,b;return Z()().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:m=0,s={},g.t0=n.status,g.next=g.t0===0?5:g.t0===6?8:g.t0===1||g.t0===2?9:12;break;case 5:return m=2,s["plugins."+n.id]="install",g.abrupt("break",12);case 8:return g.abrupt("return");case 9:return m=0,s["plugins."+n.id]="uninstall",g.abrupt("break",12);case 12:return g.next=14,(0,se.Z)({values:s,success:""});case 14:if(S=g.sent,b=S==null?void 0:S.errors["plugins."+n.id],!b){g.next=21;break}return k.ZP.warning(b,2),g.abrupt("return");case 21:m==0?(xe(Ie-1),De($e+1),n.status==1&&Me(je-1)):(xe(Ie+1),De($e-1)),k.ZP.success("\u64CD\u4F5C\u6210\u529F\uFF01",1);case 23:r(o.map(function(ae){return ae.id==n.id&&(ae.status=m),ae})),K();case 25:case"end":return g.stop()}},D)})),target:"_blank",rel:"noopener noreferrer",children:n.status==0?"\u5B89\u88C5":n.status==6?"\u539F\u521B":"\u5378\u8F7D"},"link")]},search:!1}}})]})}},87474:function(v,u,a){var R=a(25359),Z=a.n(R),ge=a(49811),ne=a.n(ge),W=a(21362),p=a(86195),pe=function(){var he=ne()(Z()().mark(function l(C){var re,G,j,Y,J,ie,H,F,ve;return Z()().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return re=C.values,G=C.loading,j=G===void 0?"\u6B63\u5728\u63D0\u4EA4\u66F4\u6539..":G,Y=C.success,J=Y===void 0?"\u63D0\u4EA4\u6210\u529F\uFF01":Y,ie=C.fail,H=ie===void 0?"\u63D0\u4EA4\u5931\u8D25":ie,F=C.params,ve=F===void 0?{}:F,j&&W.ZP.loading(j,2e4),N.abrupt("return",new Promise(function(be){(0,p.request)("/api/storage",{params:ve,method:"put",data:re}).then(function(P){var Q;if(W.ZP.destroy(),(P==null||(Q=P.data)===null||Q===void 0?void 0:Q.isLogin)==!1){W.ZP.warning("\u767B\u5F55\u5931\u6548\uFF01",2);var Se=new URL(window.location.href).searchParams,ye=Se.get("redirect");window.location.pathname!=="/user/login"&&!ye&&p.history.replace({pathname:"/user/login"});return}P!=null&&P.success?J&&W.ZP.success(J,1):H&&W.ZP.warning(H,2),be(P)})}));case 3:case"end":return N.stop()}},l)}));return function(C){return he.apply(this,arguments)}}();u.Z=pe}}]);
|