11 lines
16 KiB
JavaScript
11 lines
16 KiB
JavaScript
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[294],{59419:function(k,B,t){var g=t(75782),y=t(58733),L=t(18518),s=t(50959),S=t(60061),T=t(46227),Z=t(11527),v=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],h=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],W=s.forwardRef(function(d,C){var w=d.fieldProps,I=d.children,G=d.params,H=d.proFieldProps,M=d.mode,c=d.valueEnum,E=d.request,N=d.showSearch,A=d.options,P=(0,y.Z)(d,v),j=(0,s.useContext)(S.Z);return(0,Z.jsx)(T.Z,(0,g.Z)((0,g.Z)({valueEnum:(0,L.h)(c),request:E,params:G,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,g.Z)({options:A,mode:M,showSearch:N,getPopupContainer:j.getPopupContainer},w),ref:C,proFieldProps:H},P),{},{children:I}))}),O=s.forwardRef(function(d,C){var w=d.fieldProps,I=d.children,G=d.params,H=d.proFieldProps,M=d.mode,c=d.valueEnum,E=d.request,N=d.options,A=(0,y.Z)(d,h),P=(0,g.Z)({options:N,mode:M||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},w),j=(0,s.useContext)(S.Z);return(0,Z.jsx)(T.Z,(0,g.Z)((0,g.Z)({valueEnum:(0,L.h)(c),request:E,params:G,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,g.Z)({getPopupContainer:j.getPopupContainer},P),ref:C,proFieldProps:H},A),{},{children:I}))}),D=W,b=O,i=D;i.SearchSelect=b,i.displayName="ProFormComponent",B.Z=i},66732:function(k,B,t){var g=t(75782),y=t(58733),L=t(50959),s=t(46227),S=t(11527),T=["fieldProps","proFieldProps"],Z=["fieldProps","proFieldProps"],v="text",h=function(b){var i=b.fieldProps,d=b.proFieldProps,C=(0,y.Z)(b,T);return(0,S.jsx)(s.Z,(0,g.Z)({valueType:v,fieldProps:i,filedConfig:{valueType:v},proFieldProps:d},C))},W=function(b){var i=b.fieldProps,d=b.proFieldProps,C=(0,y.Z)(b,Z);return(0,S.jsx)(s.Z,(0,g.Z)({valueType:"password",fieldProps:i,proFieldProps:d,filedConfig:{valueType:v}},C))},O=h;O.Password=W,O.displayName="ProFormComponent",B.Z=O},9750:function(k,B,t){t.r(B),t.d(B,{default:function(){return N}});var g=t(25359),y=t.n(g),L=t(49811),s=t.n(L),S=t(54306),T=t.n(S),Z=t(12472),v=t(81308),h=t(66732),W=t(75782),O=t(58733),D=t(50959),b=t(46227),i=t(11527),d=["fieldProps","min","proFieldProps","max"],C=function(P,j){var X=P.fieldProps,K=P.min,f=P.proFieldProps,m=P.max,l=(0,O.Z)(P,d);return(0,i.jsx)(b.Z,(0,W.Z)({valueType:"digit",fieldProps:(0,W.Z)({min:K,max:m},X),ref:j,filedConfig:{defaultProps:{width:"100%"}},proFieldProps:f},l))},w=D.forwardRef(C),I=w,G=t(59419),H=t(31491),M=t(26572),c=t(21362),E=t(86195),N=function(){var A=(0,D.useState)(!1),P=T()(A,2),j=P[0],X=P[1];return(0,i.jsx)(Z._z,{title:"\u57FA\u7840\u914D\u7F6E",children:(0,i.jsx)(H.Z,{children:(0,i.jsxs)(v.A,{autoFocus:!1,submitter:{render:function(f,m){return[(0,i.jsx)(M.ZP,{htmlType:"button",onClick:function(){c.ZP.info("\u5347\u7EA7\u4E2D..."),(0,E.request)("/api/storage",{method:"put",data:{"app.compiled_at":Math.random().toString(36).substring(2,12)}}).then(function(e){if(e.errors)for(var r in e.errors)c.ZP.error(e.errors[r],4);if(e.messages)for(var o in e.messages)c.ZP.success(e.messages[o],4)})},children:"\u4E00\u952E\u5347\u7EA7"},"update"),(0,i.jsx)(M.ZP,{htmlType:"button",onClick:function(){c.ZP.info("\u91CD\u542F\u4E2D..."),(0,E.request)("/api/storage",{method:"put",data:{"app.started_at":Math.random().toString(36).substring(2,12)}}).then(function(e){if(e.errors)for(var r in e.errors)c.ZP.error(e.errors[r],4);if(e.messages)for(var o in e.messages)c.ZP.success(e.messages[o],4)})},children:"\u91CD\u542F\u7A0B\u5E8F"},"reload")]}},request:s()(y()().mark(function K(){var f;return y()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,(0,E.request)("/api/storage",{params:{keys:["app.name","app.port","app.password","app.machine_id","app.started_at","app.compiled_at","app.storage","app.redis_addr","app.redis_password"].join(",")}});case 2:return f=l.sent,f.data["app.storage"]=="redis"&&X(!0),l.abrupt("return",f.data);case 5:case"end":return l.stop()}},K)})),onBlur:function(f){var m=f.target.value,l=f.target.getAttribute("id");if(l!="app.storage"){var e={};l&&(e[l]=m,(0,E.request)("/api/storage",{method:"put",data:e}).then(function(r){var o=!1;for(var a in r.errors)o=!0,r.errors[a]!="unchanged"&&c.ZP.warning(r.errors[a],4);var n=!1;for(var u in r.messages)n=!0,c.ZP.info(r.messages[u],4);if(!o)if(l=="app.port"){c.ZP.success("\u7AEF\u53E3\u4FEE\u6539\u6210\u529F\uFF0C\u5373\u5C06\u8DF3\u8F6C\u9875\u9762\uFF01",5);var $=window.location.origin,R="80",x="";if($.includes(":".concat(R,"/")))x=$.replace(":".concat(R,"/"),":".concat(m,"/"));else{var U=new URL($);U.port=m,x=U.toString()}window.location.href=x}else n||c.ZP.success("\u63D0\u4EA4\u6210\u529F\uFF01",1)}))}},children:[(0,i.jsxs)(v.A.Group,{children:[(0,i.jsx)(h.Z,{name:"app.name",label:"\u767B\u5F55\u8D26\u53F7",tooltip:"\u673A\u5668\u4EBA\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"}),(0,i.jsx)(h.Z,{width:"md",name:"app.password",label:"\u767B\u5F55\u5BC6\u7801",tooltip:"\u4E3B\u8981\u7528\u4E8E\u7BA1\u7406\u5458\u9875\u9762\u767B\u5F55"})]}),(0,i.jsxs)(v.A.Group,{children:[(0,i.jsx)(h.Z,{disabled:!0,name:"app.started_at",label:"\u542F\u52A8\u65F6\u95F4"}),(0,i.jsx)(h.Z,{disabled:!0,name:"app.compiled_at",label:"\u7F16\u8BD1\u7248\u672C"}),(0,i.jsx)(h.Z,{width:"md",name:"app.machine_id",label:"\u673A\u5668\u7801",disabled:!0})]}),(0,i.jsx)(v.A.Group,{children:(0,i.jsx)(I,{width:"sm",tooltip:"\u8BF7\u8C28\u614E\u4FEE\u6539\uFF0C\u5982\u679C\u56E0\u6B64\u65E0\u6CD5\u8BBF\u95EE\u8BF7\u91CD\u65B0\u8FD0\u884C\u7A0B\u5E8F\u5E76\u4FEE\u6539\u7AEF\u53E3\u3002",name:"app.port",label:"\u7AEF\u53E3"})}),(0,i.jsxs)(v.A.Group,{children:[(0,i.jsx)(G.Z,{fieldProps:{onChange:function(f){X(f=="redis"),(0,E.request)("/api/storage",{method:"put",data:{"app.storage":f}}).then(function(m){var l=!1;for(var e in m.errors)l=!0,c.ZP.warning(m.errors[e],4);var r=!0;for(var o in m.messages)r=!0,c.ZP.info(m.messages[o],4);!l&&!r&&c.ZP.success("\u63D0\u4EA4\u6210\u529F\uFF01",1)})}},options:[{value:"boltdb",label:"BoltDB"},{value:"redis",label:"Redis"}],name:"app.storage",label:"\u9ED8\u8BA4\u5B58\u50A8"}),j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Z,{name:"app.redis_addr",label:"Redis\u5730\u5740",placeholder:"\u8BF7\u8F93\u5165Redis\u5730\u5740"}),(0,i.jsx)(h.Z,{width:"md",name:"app.redis_password",label:"Redis\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165Redis\u5BC6\u7801"})]})]})]})})})}},31491:function(k,B,t){t.d(B,{Z:function(){return l}});var g=t(84875),y=t.n(g),L=t(65395),s=t(50959),S=t(70458),T=t(85460),Z=t(37454),v=t(53315),h=function(e,r){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(o[a[n]]=e[a[n]]);return o},O=e=>{var{prefixCls:r,className:o,hoverable:a=!0}=e,n=h(e,["prefixCls","className","hoverable"]);const{getPrefixCls:u}=s.useContext(S.E_),$=u("card",r),R=y()(`${$}-grid`,o,{[`${$}-grid-hoverable`]:a});return s.createElement("div",Object.assign({},n,{className:R}))},D=t(97624),b=t(74074),i=t(49272);const d=e=>{const{antCls:r,componentCls:o,cardHeadHeight:a,cardPaddingBase:n,cardHeadTabsMarginBottom:u}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:a,marginBottom:-1,padding:`0 ${n}px`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,background:"transparent",borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},(0,i.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},i.vS),{[`
|
|
> ${o}-typography,
|
|
> ${o}-typography-edit-content
|
|
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${r}-tabs-top`]:{clear:"both",marginBottom:u,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`}}})},C=e=>{const{cardPaddingBase:r,colorBorderSecondary:o,cardShadow:a,lineWidth:n}=e;return{width:"33.33%",padding:r,border:0,borderRadius:0,boxShadow:`
|
|
${n}px 0 0 0 ${o},
|
|
0 ${n}px 0 0 ${o},
|
|
${n}px ${n}px 0 0 ${o},
|
|
${n}px 0 0 0 ${o} inset,
|
|
0 ${n}px 0 0 ${o} inset;
|
|
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:a}}},w=e=>{const{componentCls:r,iconCls:o,cardActionsLiMargin:a,cardActionsIconSize:n,colorBorderSecondary:u}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:e.colorBgContainer,borderTop:`${e.lineWidth}px ${e.lineType} ${u}`,display:"flex",borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px `},(0,i.dF)()),{"& > li":{margin:a,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.cardActionsIconSize*2,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${r}-btn), > ${o}`]:{display:"inline-block",width:"100%",color:e.colorTextDescription,lineHeight:`${e.fontSize*e.lineHeight}px`,transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${o}`]:{fontSize:n,lineHeight:`${n*e.lineHeight}px`}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${u}`}}})},I=e=>Object.assign(Object.assign({margin:`-${e.marginXXS}px 0`,display:"flex"},(0,i.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},i.vS),"&-description":{color:e.colorTextDescription}}),G=e=>{const{componentCls:r,cardPaddingBase:o,colorFillAlter:a}=e;return{[`${r}-head`]:{padding:`0 ${o}px`,background:a,"&-title":{fontSize:e.fontSize}},[`${r}-body`]:{padding:`${e.padding}px ${o}px`}}},H=e=>{const{componentCls:r}=e;return{overflow:"hidden",[`${r}-body`]:{userSelect:"none"}}},M=e=>{const{componentCls:r,cardShadow:o,cardHeadPadding:a,colorBorderSecondary:n,boxShadowTertiary:u,cardPaddingBase:$}=e;return{[r]:Object.assign(Object.assign({},(0,i.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${r}-bordered)`]:{boxShadow:u},[`${r}-head`]:d(e),[`${r}-extra`]:{marginInlineStart:"auto",color:"",fontWeight:"normal",fontSize:e.fontSize},[`${r}-body`]:Object.assign({padding:$,borderRadius:` 0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},(0,i.dF)()),[`${r}-grid`]:C(e),[`${r}-cover`]:{"> *":{display:"block",width:"100%"},img:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`}},[`${r}-actions`]:w(e),[`${r}-meta`]:I(e)}),[`${r}-bordered`]:{border:`${e.lineWidth}px ${e.lineType} ${n}`,[`${r}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${r}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:o}},[`${r}-contain-grid`]:{[`${r}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${r}-loading) ${r}-body`]:{marginBlockStart:-e.lineWidth,marginInlineStart:-e.lineWidth,padding:0}},[`${r}-contain-tabs`]:{[`> ${r}-head`]:{[`${r}-head-title, ${r}-extra`]:{paddingTop:a}}},[`${r}-type-inner`]:G(e),[`${r}-loading`]:H(e),[`${r}-rtl`]:{direction:"rtl"}}},c=e=>{const{componentCls:r,cardPaddingSM:o,cardHeadHeightSM:a}=e;return{[`${r}-small`]:{[`> ${r}-head`]:{minHeight:a,padding:`0 ${o}px`,fontSize:e.fontSize,[`> ${r}-head-wrapper`]:{[`> ${r}-extra`]:{fontSize:e.fontSize}}},[`> ${r}-body`]:{padding:o}},[`${r}-small${r}-contain-tabs`]:{[`> ${r}-head`]:{[`${r}-head-title, ${r}-extra`]:{minHeight:a,paddingTop:0,display:"flex",alignItems:"center"}}}}};var E=(0,D.Z)("Card",e=>{const r=(0,b.TS)(e,{cardShadow:e.boxShadowCard,cardHeadHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,cardHeadHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardHeadTabsMarginBottom:-e.padding-e.lineWidth,cardActionsLiMargin:`${e.paddingSM}px 0`,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[M(r),c(r)]}),N=function(e,r){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(o[a[n]]=e[a[n]]);return o};function A(e){return e.map((o,a)=>s.createElement("li",{style:{width:`${100/e.length}%`},key:`action-${a}`},s.createElement("span",null,o)))}var j=s.forwardRef((e,r)=>{const{prefixCls:o,className:a,rootClassName:n,extra:u,headStyle:$={},bodyStyle:R={},title:x,loading:U,bordered:ee=!0,size:Y,type:V,cover:q,actions:re,tabList:J,children:_,activeTabKey:ae,defaultActiveTabKey:ie,tabBarExtraContent:se,hoverable:de,tabProps:le={}}=e,ce=N(e,["prefixCls","className","rootClassName","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:pe,direction:ue}=s.useContext(S.E_),me=z=>{var F;(F=e.onTabChange)===null||F===void 0||F.call(e,z)},ge=s.useMemo(()=>{let z=!1;return s.Children.forEach(_,F=>{F&&F.type&&F.type===O&&(z=!0)}),z},[_]),p=pe("card",o),[fe,ve]=E(p),he=s.createElement(Z.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},_),te=ae!==void 0,be=Object.assign(Object.assign({},le),{[te?"activeKey":"defaultActiveKey"]:te?ae:ie,tabBarExtraContent:se});let oe;const Q=(0,T.Z)(Y),Pe=!Q||Q==="default"?"large":Q,ne=J&&J.length?s.createElement(v.Z,Object.assign({size:Pe},be,{className:`${p}-head-tabs`,onChange:me,items:J.map(z=>{var F;return{label:z.tab,key:z.key,disabled:(F=z.disabled)!==null&&F!==void 0?F:!1}})})):null;(x||u||ne)&&(oe=s.createElement("div",{className:`${p}-head`,style:$},s.createElement("div",{className:`${p}-head-wrapper`},x&&s.createElement("div",{className:`${p}-head-title`},x),u&&s.createElement("div",{className:`${p}-extra`},u)),ne));const xe=q?s.createElement("div",{className:`${p}-cover`},q):null,ye=s.createElement("div",{className:`${p}-body`,style:R},U?he:_),$e=re&&re.length?s.createElement("ul",{className:`${p}-actions`},A(re)):null,Se=(0,L.Z)(ce,["onTabChange"]),Ce=y()(p,{[`${p}-loading`]:U,[`${p}-bordered`]:ee,[`${p}-hoverable`]:de,[`${p}-contain-grid`]:ge,[`${p}-contain-tabs`]:J&&J.length,[`${p}-${Q}`]:Q,[`${p}-type-${V}`]:!!V,[`${p}-rtl`]:ue==="rtl"},a,n,ve);return fe(s.createElement("div",Object.assign({ref:r},Se,{className:Ce}),oe,xe,ye,$e))}),X=function(e,r){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++)r.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(o[a[n]]=e[a[n]]);return o},f=e=>{const{prefixCls:r,className:o,avatar:a,title:n,description:u}=e,$=X(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:R}=s.useContext(S.E_),x=R("card",r),U=y()(`${x}-meta`,o),ee=a?s.createElement("div",{className:`${x}-meta-avatar`},a):null,Y=n?s.createElement("div",{className:`${x}-meta-title`},n):null,V=u?s.createElement("div",{className:`${x}-meta-description`},u):null,q=Y||V?s.createElement("div",{className:`${x}-meta-detail`},Y,V):null;return s.createElement("div",Object.assign({},$,{className:U}),ee,q)};const m=j;m.Grid=O,m.Meta=f;var l=m}}]);
|