11 lines
25 KiB
JavaScript
11 lines
25 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_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(54306),_Users_a1_6_Code_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_slicedToArray_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_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__),_Users_a1_6_Code_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_1__=__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_1___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_1__),_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(81308),_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(48989),_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(40792),antd__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(79112),lodash__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(32699),lodash__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__),react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(50959),_submit__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(87474),_umijs_max__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(86195),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__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_3__.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_1___default()(matches),_step;try{var _loop=function _loop(){var match=_step.value;try{var _a=function(u){for(var n in u)u[n].dataIndex&&(u[n].key=u[n].dataIndex),u[n].key&&keys.push(u[n].key),u[n].required&&!u[n].formItemProps&&(u[n].formItemProps={rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}),u[n].columns&&(u[n].columns=_a(u[n].columns));return u},formObject=eval("(".concat(match[1],")"));(0,lodash__WEBPACK_IMPORTED_MODULE_2__.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;result.push({key:dbkey,title:"\u8C03\u8BD5\u5F00\u5173",valueType:"switch"}),keys.push(dbkey);var disable_key="plugin_disable."+props.data.id;keys.push(disable_key),(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function(){disable==null&&(0,_umijs_max__WEBPACK_IMPORTED_MODULE_5__.request)("/api/storage",{params:{keys:keys.join(",")}}).then(function(v){if(v&&v.data){var u;for(var n in v.data)v.data[n]=="false"&&(v.data[n]=!1),v.data[n]==""&&delete v.data[n];(u=formRef.current)===null||u===void 0||u.setFieldsValue(v.data),setDisable(v.data[disable_key])}})});var _useState=(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(void 0),_useState2=_Users_a1_6_Code_sillyPage_node_modules_pnpm_babel_runtime_7_21_0_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(_useState,2),disable=_useState2[0],setDisable=_useState2[1];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(antd__WEBPACK_IMPORTED_MODULE_7__.Z,{title:"\u53C2\u6570\u914D\u7F6E",open:props.open,onCancel:props.onCancel,onOk:function v(){var u,n=formRef==null||(u=formRef.current)===null||u===void 0?void 0:u.getFieldsValue();(0,_submit__WEBPACK_IMPORTED_MODULE_4__.Z)({values:n,params:{uuid:props.data.id}}).then(function(O){(O==null?void 0:O.changes[dbkey])==!0&&props.setDebug&&props.setDebug(n[dbkey]),(O==null?void 0:O.changes[disable_key])==!0&&props.setDebug&&props.setDisable(n[disable_key])}).finally(function(){props.onCancel()})},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_8__.A,{formRef,submitter:!1,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_9__.Z,{layoutType:"Embed",columns:result}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_ant_design_pro_components__WEBPACK_IMPORTED_MODULE_10__.Z,{label:"\u7981\u7528\u5F00\u5173",name:disable_key,fieldProps:{onChange:function v(u){setDisable(u)},style:{backgroundColor:disable?"red":""}}})]})})}},8928:function(v,u,n){n.r(u),n.d(u,{default:function(){return bt}});var O=n(25359),Z=n.n(O),fe=n(49811),ie=n.n(fe),W=n(54306),h=n.n(W),ge=n(83187),ve=n(79112),o=n(50959),P=n(70458),se=n(21946),Y=n(84875),j=n.n(Y),J=n(7489),Q=function(e,t){var l={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(l[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])&&(l[r[d]]=e[r[d]]);return l},F=e=>{var{prefixCls:t,className:l,color:r="blue",dot:d,pending:K=!1,position:X,label:y,children:E}=e,T=Q(e,["prefixCls","className","color","dot","pending","position","label","children"]);const{getPrefixCls:z}=o.useContext(P.E_),b=z("timeline",t),L=j()({[`${b}-item`]:!0,[`${b}-item-pending`]:K},l),x=/blue|red|green|gray/.test(r||"")?void 0:r,$=j()({[`${b}-item-head`]:!0,[`${b}-item-head-custom`]:!!d,[`${b}-item-head-${r}`]:!x});return o.createElement("li",Object.assign({},T,{className:L}),y&&o.createElement("div",{className:`${b}-item-label`},y),o.createElement("div",{className:`${b}-item-tail`}),o.createElement("div",{className:$,style:{borderColor:x,color:x}},d),o.createElement("div",{className:`${b}-item-content`},E))},N=function(e,t){var l={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(l[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])&&(l[r[d]]=e[r[d]]);return l},We=e=>{var{prefixCls:t,className:l,pending:r=!1,children:d,items:K,rootClassName:X,reverse:y=!1,direction:E,hashId:T,pendingDot:z,mode:b=""}=e,L=N(e,["prefixCls","className","pending","children","items","rootClassName","reverse","direction","hashId","pendingDot","mode"]);const x=(m,A)=>b==="alternate"?m==="right"?`${t}-item-right`:m==="left"?`${t}-item-left`:A%2===0?`${t}-item-left`:`${t}-item-right`:b==="left"?`${t}-item-left`:b==="right"?`${t}-item-right`:m==="right"?`${t}-item-right`:"",$=(0,se.Z)(K||[]),oe=typeof r=="boolean"?null:r;r&&$.push({pending:!!r,dot:z||o.createElement(J.Z,null),children:oe}),y&&$.reverse();const G=$.length,de=`${t}-item-last`,Pe=$.filter(m=>!!m).map((m,A)=>{var k;const B=A===G-2?de:"",_e=A===G-1?de:"",{className:De}=m,ue=N(m,["className"]);return o.createElement(F,Object.assign({},ue,{className:j()([De,!y&&r?B:_e,x((k=m==null?void 0:m.position)!==null&&k!==void 0?k:"",A)]),key:(m==null?void 0:m.key)||A}))}),te=$.some(m=>!!(m!=null&&m.label)),ae=j()(t,{[`${t}-pending`]:!!r,[`${t}-reverse`]:!!y,[`${t}-${b}`]:!!b&&!te,[`${t}-label`]:te,[`${t}-rtl`]:E==="rtl"},l,X,T);return o.createElement("ul",Object.assign({},L,{className:ae}),Pe)},w=n(77515);function be(e,t){return e&&Array.isArray(e)?e:(0,w.Z)(t).map(l=>{var r,d;return Object.assign({children:(d=(r=l==null?void 0:l.props)===null||r===void 0?void 0:r.children)!==null&&d!==void 0?d:""},l.props)})}var D=be,q=n(97624),Se=n(74074),ye=n(49272);const Ye=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 Je=(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[Ye(t)]}),Qe=function(e,t){var l={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(l[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])&&(l[r[d]]=e[r[d]]);return l};const Ue=e=>{const{getPrefixCls:t,direction:l}=o.useContext(P.E_),{prefixCls:r,children:d,items:K}=e,X=Qe(e,["prefixCls","children","items"]),y=t("timeline",r),[E,T]=Je(y),z=D(K,d);return E(o.createElement(We,Object.assign({},X,{prefixCls:y,direction:l,items:z,hashId:T})))};Ue.Item=F;var qe=Ue,et=qe,i=n(11527),tt=function(e){var t;return(0,i.jsx)(ve.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})})},ee=n(87474),V=n(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,Ee=n(26087),rt=function(t,l){return o.createElement(Ee.Z,(0,V.Z)((0,V.Z)({},t),{},{ref:l,icon:nt}))},it=o.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,l){return o.createElement(Ee.Z,(0,V.Z)((0,V.Z)({},t),{},{ref:l,icon:lt}))},dt=o.forwardRef(ot),_t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},ut=_t,ct=function(t,l){return o.createElement(Ee.Z,(0,V.Z)((0,V.Z)({},t),{},{ref:l,icon:ut}))},mt=o.forwardRef(ct),pt=n(12472),ft=n(37270),gt=n(50714),Oe=n(86195),vt=n(44901),ht=n(21137),I=n(4050),M=n(68243),U=n(21362),Ce="",bt=function(){var e=(0,o.useState)([]),t=h()(e,2),l=t[0],r=t[1],d=(0,Oe.useModel)("@@initialState"),K=d.refresh,X=(0,o.useState)({script:"",id:""}),y=h()(X,2),E=y[0],T=y[1],z=(0,o.useState)({id:"",messages:[]}),b=h()(z,2),L=b[0],x=b[1],$=(0,o.useState)([]),oe=h()($,2),G=oe[0],de=oe[1],Pe=(0,o.useState)([]),te=h()(Pe,2),ae=te[0],m=te[1],A=(0,o.useState)("tab1"),k=h()(A,2),B=k[0],_e=k[1],De=(0,o.useState)("\u5168\u90E8"),ue=h()(De,2),St=ue[0],yt=ue[1],Et=(0,o.useState)(0),Ke=h()(Et,2),Ie=Ke[0],Me=Ke[1],Ot=(0,o.useState)(0),ze=h()(Ot,2),xe=ze[0],$e=ze[1],Ct=(0,o.useState)(0),He=h()(Ct,2),je=He[0],Te=He[1],Pt=(0,o.useState)({}),Fe=h()(Pt,2),Dt=Fe[0],It=Fe[1],Mt=(0,o.useState)("\u5168\u90E8"),Ne=h()(Mt,2),we=Ne[0],xt=Ne[1],$t=(0,o.useState)(!1),Ve=h()($t,2),Xe=Ve[0],Le=Ve[1],jt=(0,o.useState)(""),Ge=h()(jt,2),Tt=Ge[0],Lt=Ge[1],ne=(0,o.useRef)(),ce=function(_){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,i.jsx)(vt.Z,{count:_,overflowCount:1e4,style:{marginBlockStart:-2,marginInlineStart:4,color:a?"#1890FF":"#999",backgroundColor:a?"#E6F7FF":"#eee"}})};return(0,i.jsxs)(pt._z,{children:[L.id!=""&&(0,i.jsx)(tt,{data:L,onCancel:function(){x({id:"",messages:[]})},onOk:function(){var _={};_["plugin_messages."+L.id]="",(0,ee.Z)({values:_}).finally(function(){x({id:"",messages:[]}),r(l.map(function(a){return a.id==L.id&&(a.messages=[]),a}))})}}),E.script!=""&&(0,i.jsx)(ge.Z,{data:E,open:E.script,onCancel:function(){T({script:"",id:""})},setDebug:function(_){l.map(function(a){return a.id==E.id&&(a.debug=_),a})},setDisable:function(_){l.map(function(a){return a.id==E.id&&(a.disable=_),a})}}),"\u63D2\u4EF6\u6E90\uFF1A",(0,i.jsx)(ht.Z,{title:"\u63D2\u4EF6\u6E90",value:ae,options:G,mode:"multiple",onChange:function(_){m(_.map(function(C){return{label:C,value:C}})),Le(!0);var a=ne.current;a.reloadAndRest()}}),(0,i.jsx)(ft.Z,{multipleLine:!0,menu:{activeKey:St,items:Object.entries(Dt).sort(function(p,_){return _[1]-p[1]}).map(function(p){return{key:p[0],label:(0,i.jsxs)("span",{children:[p[0],ce(p[1],p[0]==we)]})}}),onChange:function(_){yt(_),Le(!0),xt(_);var a=ne.current;a.reloadAndRest()}}}),(0,i.jsx)(gt.Rs,{actionRef:ne,toolbar:{menu:{activeKey:B,items:[{key:"tab1",label:(0,i.jsxs)("span",{children:["\u5DF2\u5B89\u88C5",ce(Ie,B==="tab1")]})},{key:"tab2",label:(0,i.jsxs)("span",{children:["\u672A\u5B89\u88C5",ce(xe,B==="tab2")]})},{key:"tab3",label:(0,i.jsxs)("span",{children:["\u53EF\u5347\u7EA7",ce(je,B==="tab3")]})}],onChange:function(_){_e(_);var a=ne.current;a.reloadAndRest()}},search:{onSearch:function(_){Lt(_);var a=ne.current;a.reloadAndRest()}}},search:{filterType:"light"},rowKey:"name",dataSource:l,request:ie()(Z()().mark(function p(){var _,a=arguments;return Z()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return _=a.length>0&&a[0]!==void 0?a[0]:{},_.activeKey=B,_.origin=ae.map(function(s){return s.value}),_.keyword=Tt,_.class=we,_.mclass=Xe?"true":"false",Ce!=""?_.init=Ce:Ce="false",c.abrupt("return",(0,Oe.request)("/api/plugins/list.json",{params:_}).then(function(s){if(Xe&&Le(!1),s!=null&&s.tab&&_e(s.tab),Object.keys(ae).length==0)if(G.length!=0)m(G);else{var S,f=Object.keys((S=s==null?void 0:s.origins)!==null&&S!==void 0?S:{}).map(function(Ae){return{label:Ae,value:Ae}});de(f),m(f)}Me(s.tab1),$e(s.tab2),Te(s.tab3),It(s.classes);var me=new Date,g=new Date(me);g.setDate(me.getDate()-1);var re="\u4ECA\u5929 ",At="\u6628\u5929 ",Bt=function(Be){var Re,Zt=(Re=s.data[Be].messages)!==null&&Re!==void 0?Re:[],Wt=Zt.sort(function(R,H){return H.unix-R.unix}),Ut=Wt.map(function(R){var H=new Date(R.unix*1e3),ke=H.toLocaleDateString(),Ze=H.toLocaleTimeString("zh-CN",{hour12:!1}),pe;return ke===me.toLocaleDateString()?pe=re+Ze:ke===g.toLocaleDateString()?pe=At+Ze:pe=H.getFullYear()+"-"+(H.getMonth()+1).toString().padStart(2,"0")+"-"+H.getDate().toString().padStart(2,"0")+" "+Ze,{color:R.class==="warn"?"yellow":"red",label:pe,children:(0,i.jsxs)(i.Fragment,{children:[R.version&&(0,i.jsx)(I.Z,{color:R.version==s.data[Be].version?"cyan":"",children:R.version}),R.content]})}});s.data[Be].messages=Ut};for(var Rt in s.data)Bt(Rt);return s}));case 8:case"end":return c.stop()}},p)})),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(_,a){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(M.Z,{size:0,children:(0,i.jsx)(I.Z,{color:a.identified?"gold":"grey",children:a.organization==""?"\u672A\u8BA4\u8BC1\u6765\u6E90":a.organization},a.organization)}),(0,i.jsx)(M.Z,{size:0,children:(0,i.jsxs)(I.Z,{color:"cyan",children:[a.downloads," \u4E0B\u8F7D"]},"downloads")}),a.module&&(0,i.jsx)(M.Z,{size:0,children:(0,i.jsx)(I.Z,{color:"purple",children:"\u6A21\u5757"},"module")}),a.web&&(0,i.jsx)(M.Z,{size:0,children:(0,i.jsx)(I.Z,{color:"brown",children:"\u7F51\u7EDC\u670D\u52A1"},"web")}),a.encrypt&&(0,i.jsx)(M.Z,{size:0,children:(0,i.jsx)(I.Z,{color:"orange",children:"\u52A0\u5BC6\u811A\u672C"},"encrypt")}),a.status==1&&(0,i.jsx)(M.Z,{size:0,children:(0,i.jsx)(I.Z,{color:"pink",onClick:function(){var c={};c["plugins."+a.id]="install",(0,ee.Z)({values:c,success:"\u64CD\u4F5C\u6210\u529F\uFF01"}).then(function(s){var S=s==null?void 0:s.errors["plugins."+a.id];if(S){U.ZP.warning(S,2);return}else Te(je-1);r(l.map(function(f){return f.id==a.id&&(f.status=2),f}))})},children:"\u5347\u7EA7"},a.status)}),a.has_form&&(0,i.jsx)(M.Z,{size:0,children:(0,i.jsx)("a",{children:(0,i.jsx)(I.Z,{color:"blue",onClick:function(){var c="plugins."+a.id;(0,Oe.request)("/api/storage",{params:{keys:[c].join(",")}}).then(function(s){s!=null&&s.data&&s.data[c]&&T({script:s.data[c],id:a.id})})},children:"\u914D\u7F6E"},a.status)})}),a.messages.length!=0&&(0,i.jsx)(M.Z,{size:0,children:(0,i.jsxs)(I.Z,{color:"red",onClick:function(){x({id:a.id,messages:a.messages,title:a.title})},children:["\u5F02\u5E38 ",a.messages.length]},"messages")}),B=="tab1"&&(0,i.jsxs)(M.Z,{children:[a.running&&(0,i.jsx)(it,{spin:!0,style:{color:"blue",opacity:.3}}),(0,i.jsx)("a",{onClick:function(){var c={};c["plugin_debug."+a.id]=!a.debug,(0,ee.Z)({values:c,success:""}).then(function(s){var S=s==null?void 0:s.errors["plugin_debug."+a.id];if(S){U.ZP.warning(S,2);return}else U.ZP.success("\u64CD\u4F5C\u6210\u529F\uFF01",1);r(l.map(function(f){return f.id==a.id&&(f.debug=!f.debug),f}))})},children:(0,i.jsx)(dt,{style:{opacity:a.debug?1:.1}})}),(0,i.jsx)("a",{style:{color:"red"},onClick:function(){var c={};c["plugin_disable."+a.id]=!a.disable,(0,ee.Z)({params:{uuid:a.id},values:c,success:""}).then(function(s){var S=s==null?void 0:s.errors["plugin_disable."+a.id];if(S){U.ZP.warning(S,2);return}else U.ZP.success("\u64CD\u4F5C\u6210\u529F\uFF01",1);r(l.map(function(f){return f.id==a.id&&(f.disable=!f.disable),f}))})},children:(0,i.jsx)(mt,{style:{opacity:a.disable?1:.1}})})]})]})},search:!1},actions:{render:function(_,a){return[(0,i.jsx)("a",{onClick:ie()(Z()().mark(function C(){var c,s,S,f;return Z()().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:c=0,s={},g.t0=a.status,g.next=g.t0===0?5:g.t0===6?8:g.t0===1||g.t0===2?9:12;break;case 5:return c=2,s["plugins."+a.id]="install",g.abrupt("break",12);case 8:return g.abrupt("return");case 9:return c=0,s["plugins."+a.id]="uninstall",g.abrupt("break",12);case 12:return g.next=14,(0,ee.Z)({values:s,success:""});case 14:if(S=g.sent,f=S==null?void 0:S.errors["plugins."+a.id],!f){g.next=21;break}return U.ZP.warning(f,2),g.abrupt("return");case 21:c==0?(Me(Ie-1),$e(xe+1),a.status==1&&Te(je-1)):(Me(Ie+1),$e(xe-1)),U.ZP.success("\u64CD\u4F5C\u6210\u529F\uFF01",1);case 23:r(l.map(function(re){return re.id==a.id&&(re.status=c),re})),K();case 25:case"end":return g.stop()}},C)})),target:"_blank",rel:"noopener noreferrer",children:a.status==0?"\u5B89\u88C5":a.status==6?"\u539F\u521B":"\u5378\u8F7D"},"link")]},search:!1}}})]})}},87474:function(v,u,n){var O=n(25359),Z=n.n(O),fe=n(49811),ie=n.n(fe),W=n(21362),h=n(86195),ge=function(){var ve=ie()(Z()().mark(function o(P){var se,Y,j,J,Q,le,F,N,he;return Z()().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return se=P.values,Y=P.loading,j=Y===void 0?"\u6B63\u5728\u63D0\u4EA4\u66F4\u6539..":Y,J=P.success,Q=J===void 0?"\u63D0\u4EA4\u6210\u529F\uFF01":J,le=P.fail,F=le===void 0?"\u63D0\u4EA4\u5931\u8D25":le,N=P.params,he=N===void 0?{}:N,j&&W.ZP.loading(j,2e4),w.abrupt("return",new Promise(function(be){(0,h.request)("/api/storage",{params:he,method:"put",data:se}).then(function(D){var q;if(W.ZP.destroy(),(D==null||(q=D.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&&h.history.replace({pathname:"/user/login"});return}D!=null&&D.success?Q&&W.ZP.success(Q,1):F&&W.ZP.warning(F,2),be(D)})}));case 3:case"end":return w.stop()}},o)}));return function(P){return ve.apply(this,arguments)}}();u.Z=ge}}]);
|