2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[663],{67284:function(pe,K,t){t.d(K,{Z:function(){return Y}});var n=t(66283),v=t(75271),u={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},M=u,Q=t(60101),S=function(G,$){return v.createElement(Q.Z,(0,n.Z)({},G,{ref:$,icon:M}))},J=v.forwardRef(S),Y=J},79065:function(pe,K,t){t.r(K),t.d(K,{default:function(){return y}});var n=t(48305),v=t.n(n),u=t(75271),M=t(11063),Q=t(39032),S=t(66628),J=t(74970),Y=t(87306),w=t(85106),G=t(67284),$=t(66283),k={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z"}}]},name:"logout",theme:"outlined"},q=k,b=t(60101),ce=function(m,d){return u.createElement(b.Z,(0,$.Z)({},m,{ref:d,icon:q}))},de=u.forwardRef(ce),ue=de,ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},fe=ve,se=function(m,d){return u.createElement(b.Z,(0,$.Z)({},m,{ref:d,icon:fe}))},F=u.forwardRef(se),ge=F,i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},C=i,h=function(m,d){return u.createElement(b.Z,(0,$.Z)({},m,{ref:d,icon:C}))},c=u.forwardRef(h),f=c,_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},W=_,ee=function(m,d){return u.createElement(b.Z,(0,$.Z)({},m,{ref:d,icon:W}))},V=u.forwardRef(ee),a=V,s=t(52254),e=t(52676),r=M.Z.Header,l=M.Z.Sider,p=M.Z.Content,L=function(){var m=(0,u.useState)(!1),d=v()(m,2),A=d[0],X=d[1],I=(0,u.useState)(""),P=v()(I,2),O=P[0],z=P[1],H=(0,s.useLocation)();(0,u.useEffect)(function(){var N=localStorage.getItem("isLoggedIn"),Z=localStorage.getItem("username");if(!N){Q.ZP.error("\u8BF7\u5148\u767B\u5F55\uFF01"),s.history.push("/login");return}z(Z||"")},[]);var o=function(Z){s.history.push("/".concat(Z))},B=function(){localStorage.removeItem("isLoggedIn"),localStorage.removeItem("username"),Q.ZP.success("\u5DF2\u9000\u51FA\u767B\u5F55"),s.history.push("/login")},D=(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(S.Z.Item,{icon:(0,e.jsx)(G.Z,{}),onClick:function(){return s.history.push("/profile")},children:"\u4E2A\u4EBA\u8D44\u6599"},"profile"),(0,e.jsx)(S.Z.Divider,{}),(0,e.jsx)(S.Z.Item,{icon:(0,e.jsx)(ue,{}),onClick:B,children:"\u9000\u51FA\u767B\u5F55"},"logout")]}),re=function(){var Z=H.pathname;return Z==="/images"?"images":Z==="/profile"?"profile":"images"};return(0,e.jsxs)(M.Z,{className:"main-layout",children:[(0,e.jsxs)(l,{trigger:null,collapsible:!0,collapsed:A,className:"main-sider",children:[(0,e.jsx)("div",{className:"logo",children:!A&&(0,e.jsx)("span",{children:"VDI\u7BA1\u7406\u5E73\u53F0"})}),(0,e.jsxs)(S.Z,{theme:"dark",mode:"inline",selectedKeys:[re()],onClick:function(Z){var te=Z.key;return o(te)},children:[(0,e.jsx)(S.Z.Item,{icon:(0,e.jsx)(ge,{}),children:"\u955C\u50CF\u5217\u8868"},"images"),(0,e.jsx)(S.Z.Item,{icon:(0,e.jsx)(G.Z,{}),children:"\u6211\u7684"},"profile")]})]}),(0,e.jsxs)(M.Z,{children:[(0,e.jsxs)(r,{className:"main-header",children:[(0,e.jsx)(J.ZP,{type:"text",icon:A?(0,e.jsx)(f,{}):(0,e.jsx)(a,{}),onClick:function(){return X(!A)},className:"trigger"}),(0,e.jsxs)("div",{className:"header-right",children:[(0,e.jsxs)("span",{className:"welcome-text",children:["\u6B22\u8FCE\uFF0C",O]}),(0,e.jsx)(Y.Z,{overlay:D,placement:"bottomRight",children:(0,e.jsx)(w.Z,{icon:(0,e.jsx)(G.Z,{}),className:"user-avatar"})})]})]}),(0,e.jsx)(p,{className:"main-content",children:(0,e.jsx)(s.Outlet,{})})]})]})},y=L},85106:function(pe,K,t){t.d(K,{Z:function(){return V}});var n=t(75271),v=t(82187),u=t.n(v),M=t(1728),Q=t(42684),S=t(39594),J=t(70436),Y=t(22123),w=t(44413),G=t(88198),k=n.createContext({}),q=t(89260),b=t(67083),ce=t(89348),de=t(30509);const ue=a=>{const{antCls:s,componentCls:e,iconCls:r,avatarBg:l,avatarColor:p,containerSize:L,containerSizeLG:y,containerSizeSM:g,textFontSize:m,textFontSizeLG:d,textFontSizeSM:A,borderRadius:X,borderRadiusLG:I,borderRadiusSM:P,lineWidth:O,lineType:z}=a,H=(o,B,D)=>({width:o,height:o,borderRadius:"50%",[`&${e}-square`]:{borderRadius:D},[`&${e}-icon`]:{fontSize:B,[`> ${r}`]:{margin:0}}});return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,b.Wf)(a)),{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:p,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:l,border:`${(0,q.bf)(O)} ${z} transparent`,"&-image":{background:"transparent"},[`${s}-image-img`]:{display:"block"}}),H(L,m,X)),{"&-lg":Object.assign({},H(y,d,I)),"&-sm":Object.assign({},H(g,A,P)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},ve=a=>{const{componentCls:s,groupBorderColor:e,groupOverlapping:r,groupSpace:l}=a;return{[`${s}-group`]:{display:"inline-flex",[s]:{borderColor:e},"> *:not(:first-child)":{marginInlineStart:r}},[`${s}-group-popover`]:{[`${s} + ${s}`]:{marginInlineStart:l}}}},fe=a=>{const{controlHeight:s,controlHeightLG:e,controlHeightSM:r,fontSize:l,fontSizeLG:p,fontSizeXL:L,fontSizeHeading3:y,marginXS:g,marginXXS:m,colorBorderBg:d}=a;return{containerSize:s,containerSizeLG:e,containerSizeSM:r,textFontSize:Math.round((p+L)/2),textFontSizeLG:y,textFontSizeSM:l,groupSpace:m,groupOverlapping:-g,groupBorderColor:d}};var se=(0,ce.I$)("Avatar",a=>{const{colorTextLightSolid:s,colorTextPlaceholder:e}=a,r=(0,de.IX)(a,{avatarBg:e,avatarColor:s});return[ue(r),ve(r)]},fe),F=function(a,s){var e={};for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&s.indexOf(r)<0&&(e[r]=a[r]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,r=Object.getOwnPropertySymbols(a);l<r.length;l++)s.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(a,r[l])&&(e[r[l]]=a[r[l]]);return e},i=n.forwardRef((a,s)=>{const{prefixCls:e,shape:r,size:l,src:p,srcSet:L,icon:y,className:g,rootClassName:m,style:d,alt:A,draggable:X,children:I,crossOrigin:P,gap:O=4,onError:z}=a,H=F(a,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","style","alt","draggable","children","crossOrigin","gap","onError"]),[o,B]=n.useState(1),[D,re]=n.useState(!1),[N,Z]=n.useState(!0),te=n.useRef(null),ne=n.useRef(null),oe=(0,Q.sQ)(s,te),{getPrefixCls:ae,avatar:U}=n.useContext(J.E_),R=n.useContext(k),le=()=>{if(!ne.current||!te.current)return;const j=ne.current.offsetWidth,x=te.current.offsetWidth;j!==0&&x!==0&&O*2<x&&B(x-O*2<j?(x-O*2)/j:1)};n.useEffect(()=>{re(!0)},[]),n.useEffect(()=>{Z(!0),B(1)},[p]),n.useEffect(le,[O]);const xe=()=>{(z==null?void 0:z())!==!1&&Z(!1)},E=(0,w.Z)(j=>{var x,me;return(me=(x=l!=null?l:R==null?void 0:R.size)!==null&&x!==void 0?x:j)!==null&&me!==void 0?me:"default"}),Se=Object.keys(typeof E=="object"?E||{}:{}).some(j=>["xs","sm","md","lg","xl","xxl"].includes(j)),he=(0,G.Z)(Se),Oe=n.useMemo(()=>{if(typeof E!="object")return{};const j=S.c4.find(me=>he[me]),x=E[j];return x?{width:x,height:x,fontSize:x&&(y||I)?x/2:18}:{}},[he,E]),T=ae("avatar",e),ye=(0,Y.Z)(T),[je,ze,Ne]=se(T,ye),Ze=u()({[`${T}-lg`]:E==="large",[`${T}-sm`]:E==="small"}),Ce=n.isValidElement(p),Ee=r||(R==null?void 0:R.shape)||"circle",Me=u()(T,Ze,U==null?void 0:U.className,`${T}-${Ee}`,{[`${T}-image`]:Ce||p&&N,[`${T}-icon`]:!!y},Ne,ye,g,m,ze),Ae=typeof E=="number"?{width:E,height:E,fontSize:y?E/2:18}:{};let ie;if(typeof p=="string"&&N)ie=n.createElement("img",{src:p,draggable:X,srcSet:L,onError:xe,alt:A,crossOrigin:P});else if(Ce)ie=p;else if(y)ie=y;else if(D||o!==1){const j=`scale(${o})`,x={msTransform:j,WebkitTransform:j,transform:j};ie=n.createElement(M.Z,{onResize:le},n.createElement("span",{className:`${T}-string`,ref:ne,style:Object.assign({},x)},I))}else ie=n.createElement("span",{className:`${T}-string`,style:{opacity:0},ref:ne},I);return je(n.createElement("span",Object.assign({},H,{style:Object.assign(Object.assign(Object.assign(Object.assign({},Ae),Oe),U==null?void 0:U.style),d),className:Me,ref:oe}),ie))}),C=t(81626),h=t(48349),c=t(58135);const f=a=>{const{size:s,shape:e}=n.useContext(k),r=n.useMemo(()=>({size:a.size||s,shape:a.shape||e}),[a.size,a.shape,s,e]);return n.createElement(k.Provider,{value:r},a.children)};var W=a=>{var s,e,r,l;const{getPrefixCls:p,direction:L}=n.useContext(J.E_),{prefixCls:y,className:g,rootClassName:m,style:d,maxCount:A,maxStyle:X,size:I,shape:P,maxPopoverPlacement:O,maxPopoverTrigger:z,children:H,max:o}=a,B=p("avatar",y),D=`${B}-group`,re=(0,Y.Z)(B),[N,Z,te]=se(B,re),ne=u()(D,{[`${D}-rtl`]:L==="rtl"},te,re,g,m,Z),oe=(0,C.Z)(H).map((R,le)=>(0,h.Tm)(R,{key:`avatar-key-${le}`})),ae=(o==null?void 0:o.count)||A,U=oe.length;if(ae&&ae<U){const R=oe.slice(0,ae),le=oe.slice(ae,U),xe=(o==null?void 0:o.style)||X,E=((s=o==null?void 0:o.popover)===null||s===void 0?void 0:s.trigger)||z||"hover",Se=((e=o==null?void 0:o.popover)===null||e===void 0?void 0:e.placement)||O||"top",he=Object.assign(Object.assign({content:le},o==null?void 0:o.popover),{classNames:{root:u()(`${D}-popover`,(l=(r=o==null?void 0:o.popover)===null||r===void 0?void 0:r.classNames)===null||l===void 0?void 0:l.root)},placement:Se,trigger:E});return R.push(n.createElement(c.Z,Object.assign({key:"avatar-popover-key",destroyOnHidden:!0},he),n.createElement(i,{style:xe},`+${U-ae}`))),N(n.createElement(f,{shape:P,size:I},n.createElement("div",{className:ne,style:d},R)))}return N(n.createElement(f,{shape:P,size:I},n.createElement("div",{className:ne,style:d},oe)))};const ee=i;ee.Group=W;var V=ee},11063:function(pe,K,t){t.d(K,{Z:function(){return ge}});var n=t(49744),v=t(75271),u=t(82187),M=t.n(u),Q=t(18051),S=t(70436),J=t(80720),Y=t(81626),w=t(62416);function G(i,C,h){return typeof h=="boolean"?h:i.length?!0:(0,Y.Z)(C).some(f=>f.type===w.Z)}var $=t(27302),k=function(i,C){var h={};for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&C.indexOf(c)<0&&(h[c]=i[c]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,c=Object.getOwnPropertySymbols(i);f<c.length;f++)C.indexOf(c[f])<0&&Object.prototype.propertyIsEnumerable.call(i,c[f])&&(h[c[f]]=i[c[f]]);return h};function q({suffixCls:i,tagName:C,displayName:h}){return c=>v.forwardRef((_,W)=>v.createElement(c,Object.assign({ref:W,suffixCls:i,tagName:C},_)))}const b=v.forwardRef((i,C)=>{const{prefixCls:h,suffixCls:c,className:f,tagName:_}=i,W=k(i,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:ee}=v.useContext(S.E_),V=ee("layout",h),[a,s,e]=(0,$.ZP)(V),r=c?`${V}-${c}`:V;return a(v.createElement(_,Object.assign({className:M()(h||r,f,s,e),ref:C},W)))}),ce=v.forwardRef((i,C)=>{const{direction:h}=v.useContext(S.E_),[c,f]=v.useState([]),{prefixCls:_,className:W,rootClassName:ee,children:V,hasSider:a,tagName:s,style:e}=i,r=k(i,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),l=(0,Q.Z)(r,["suffixCls"]),{getPrefixCls:p,className:L,style:y}=(0,S.dj)("layout"),g=p("layout",_),m=G(c,V,a),[d,A,X]=(0,$.ZP)(g),I=M()(g,{[`${g}-has-sider`]:m,[`${g}-rtl`]:h==="rtl"},L,W,ee,A,X),P=v.useMemo(()=>({siderHook:{addSider:O=>{f(z=>[].concat((0,n.Z)(z),[O]))},removeSider:O=>{f(z=>z.filter(H=>H!==O))}}}),[]);return d(v.createElement(J.V.Provider,{value:P},v.createElement(s,Object.assign({ref:C,className:I,style:Object.assign(Object.assign({},y),e)},l),V)))}),de=q({tagName:"div",displayName:"Layout"})(ce),ue=q({suffixCls:"header",tagName:"header",displayName:"Header"})(b),ve=q({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(b),fe=q({suffixCls:"content",tagName:"main",displayName:"Content"})(b);var se=de;const F=se;F.Header=ue,F.Footer=ve,F.Content=fe,F.Sider=w.Z,F._InternalSiderContext=w.D;var ge=F}}]);
|