PageSourceSearch

https://elypecs.com/assets/ContentsStorage-mGDN8Vx_.js

js elypecs.com collected 2026-10-08 22:44:36 UTC 9,739 bytes, 50 lines download raw bytes

1import{H as g,fH as m,x as f,r as p,d as D,b as U,fI as H,fJ as K,w as M,j as e,ai as W,J as $,V as v,aD as w,U as y,t as T,ae as z,u as G,fK as _}from"./index-BLCTUErK.js";import{M as J}from"./ManagePage-FxjHykAe.js";import{S as X}from"./Selectbox-0Y0RRiBy.js";import{U as C}from"./UsageBadge-pLzJ3U0C.js";import"./jsrsasign-zh148wpn.js";import"./videojs-youtube-Dpa2WYmJ.js";import"./zoom/videosdk-DiVEOHWa.js";import"./babylon/core-BIrqi7gl.js";import"./Page-BdNP9AtZ.js";import"./Dropdown-F9e6R45Q.js";const q=g.div`
2  ${{marginTop:"30px",height:"900px",overflow:"hidden",borderRadius:"20px","--tw-bg-opacity":"1",backgroundColor:"rgb(255 255 255 / var(--tw-bg-opacity))",paddingLeft:"40px",paddingRight:"40px",paddingTop:"40px"}}
3  ${{"@media (max-width: 1023px)":{height:"800px",borderRadius:"10px",paddingLeft:"20px",paddingRight:"20px",paddingTop:"30px"}}}
4  box-shadow: 2px 2px 10px 0 rgba(0, 0, 0, 0.16);
5`,Q=g.div`
6  ${{display:"grid",maxHeight:"766px",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",overflowY:"auto"}}
7  ${{marginRight:"-35px",paddingRight:"35px"}}
8  ${{"@media (max-width: 1023px)":{marginRight:"-12px",paddingRight:"12px"}}}
9  ${{"@media (max-width: 1023px)":{maxHeight:"644px",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",columnGap:"30px"}}}
10  ${{"@media (max-width: 673px)":{gridTemplateColumns:"repeat(1, minmax(0, 1fr))"}}}
11`,E=g.div`
12  ${{width:"100%",paddingLeft:"10px",paddingRight:"10px",paddingTop:"12px",paddingBottom:"12px"}}
13  ${{display:"flex",alignItems:"center",justifyContent:"space-between"}}
14  ${{borderBottomWidth:"1px","--tw-border-opacity":"1",borderColor:"rgb(226 226 226 / var(--tw-border-opacity))",fontSize:"14px","--tw-text-opacity":"1",color:"rgb(51 51 51 / var(--tw-text-opacity))"}}
15  ${{"@media (hover: hover)":{":hover":{"--tw-bg-opacity":"1",backgroundColor:"rgb(245 245 245 / var(--tw-bg-opacity))"}}}}
16  ${{"@media (max-width: 1023px)":{justifyContent:"flex-start",gap:"10px",paddingTop:"30px",paddingBottom:"30px"}}}
17
18  ${({isSelect:t})=>t&&{backgroundColor:"rgb(119 50 238 / 0.1)"}}
19`,Z=g(X)`
20  &.selectbox {
21    ${{width:"fit-content",borderStyle:"none"}}
22    .selectbox-input {
23      ${{gap:"4px",padding:"0"}}
24      .selectbox-icon {
25        ${{position:"static"}}
26      }
27    }
28    .selectbox-text {
29      ${{fontSize:"14px"}}
30    }
31    .menu {
32      ${{borderTopLeftRadius:"5px !important",borderTopRightRadius:"5px !important",borderTopWidth:"1px !important","--tw-border-opacity":"1 !important",borderColor:"rgb(204 204 204 / var(--tw-border-opacity)) !important",paddingBottom:"0 !important"}}
33      box-shadow: 3px 3px 10px 0 rgba(0, 0, 0, 0.16);
34
35      .menu-item {
36        ${{borderTopWidth:"0px",borderStyle:"solid !important",paddingLeft:"20px !important",paddingRight:"20px !important",fontSize:"14px !important"}}
37
38        &:not(:last-child) {
39          ${{borderBottomWidth:"1px","--tw-border-opacity":"1",borderColor:"rgb(226 226 226 / var(--tw-border-opacity))"}}
40        }
41      }
42    }
43    .dropdown-content {
44      ${{right:"0",width:"auto"}}
45    }
46  }
47`,ee=g.div`
48  ${{width:"100%",borderTopWidth:"1px",borderBottomWidth:"1px","--tw-border-opacity":"1",borderColor:"rgb(204 204 204 / var(--tw-border-opacity))",paddingTop:"5px",paddingBottom:"5px",paddingLeft:"10px"}}
49  ${{marginTop:"20px",display:"flex",alignItems:"center",justifyContent:"space-between"}}
50`,I=t=>{const{isTablet:r}=M(),o={[m.IMAGE]:e.jsx("img",{src:t.contentsValue,className:"object-contain h-full px-d2 pb-d2"}),[m.VIDEO]:e.jsx("video",{src:t.contentsValue,className:"object-contain h-full px-d2 pb-d2",autoPlay:!0,loop:!0,controls:!0}),[m.PDF]:r?e.jsx("iframe",{width:"100%",height:"100%",src:`https://docs.google.com/gview?url=${t.contentsValue}&embedded=true`}):e.jsx("embed",{type:"application/pdf",width:"100%",height:"100%",src:t.contentsValue})}[t.contentsType];return e.jsx(z,{title:t.contentsName,onClose:()=>t.onClose(!1),bodyClassName:"overflow-hidden",children:e.jsxs("div",{className:"w-full h-full flex items-center justify-center relative",children:[o,e.jsxs("div",{className:"absolute bottom-0 bg-black/80 h-11 w-full flex items-center gap-5 pl-d3 text-white text-md",children:[t.usageFlag&&e.jsx(C,{className:"!bg-transparent"}),e.jsxs("div",{children:[t.contentsVolume," MB"]}),e.jsx("div",{children:w(t.modifiedAt).format("YYYY.MM.DD")}
50)]})]})})},te=t=>{const[r,o]=p.useState(!1);return e.jsxs(E,{isSelect:t.isSelect,children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(v,{className:"!rounded-d",value:t.isSelect,disabled:t.usageFlag,onChecked:()=>t.onClick()}),e.jsx(C,{className:t.usageFlag?"":"invisible"}),e.jsxs("div",{className:"flex items-center gap-2 font-bold cursor-pointer",onClick:()=>o(!0),children:[e.jsx("img",{src:A[t.contentsType],className:"w-4 h-4"}),t.contentsName]})]}),e.jsxs("div",{className:"flex gap-d6",children:[e.jsxs("div",{children:[t.contentsVolume," MB"]}),e.jsx("div",{children:w(t.modifiedAt).format("YYYY.MM.DD")})]}),r&&e.jsx(I,{...t,onClose:i=>o(i)})]})},ae=t=>{const[r,o]=p.useState(!1);return e.jsxs(E,{isSelect:t.isSelect,children:[e.jsx(v,{className:"!rounded-d flex-none",value:t.isSelect,disabled:t.usageFlag,onChecked:()=>t.onClick()}),e.jsxs("div",{className:"flex flex-col gap-2 overflow-hidden",children:[t.usageFlag&&e.jsx(C,{className:"!px-2 !py-1 w-fit"}),e.jsxs("div",{className:"flex items-center gap-d2 font-bold",onClick:()=>o(!0),children:[e.jsx("img",{src:A[t.contentsType],className:"w-5 h-5"}),t.contentsName]}),e.jsxs("div",{className:"flex gap-d2 tablet:text-xs tablet:gap-2",children:[e.jsxs("div",{children:[t.contentsVolume," MB"]}),e.jsx("div",{children:w(t.modifiedAt).format("YYYY.MM.DD")})]})]}),r&&e.jsx(I,{...t,onClose:i=>o(i)})]})},A={[m.IMAGE]:"/manage/icon-image-pink.svg",[m.VIDEO]:"/manage/icon-video-mint.svg",[m.PDF]:"/manage/icon-pdf-purple.svg"},se=[{key:"name,ASC",text:f.t("이름순")},{key:"volume,DESC",text:f.t("용량순")},{key:"date,DESC",text:f.t("최신순")},{key:"date,ASC",text:f.t("오래된순")}],oe=1024*1024*100,ie="image/png,image/jpeg,image/jpg,video/mp4,video/mov,video/avi,video/wmv,application/pdf";function ne(t){const[r,o]=p.useState(!1),[i,d]=p.useState([]),[b,c]=p.useState(!1),x=p.useRef(null),{message:s}=D(),h=U(),F=H(t.spaceId),R=K(t.spaceId),{isTablet:S}=M(),k=t.contents.contentsStorages.filter(a=>!a.usageFlag),L=a=>{if(a.target.files&&a.target.files.length){const n=[...a.target.files],l=ie.split(",");if(n.length>10)throw Error(s("한번에 최대 10개까지만 등록할 수 있습니다."));if(n.forEach(j=>{if(!l.includes(j.type))throw Error(`${s("업로드 불가한 파일 유형이 존재합니다.")} ${s("(.png, .jpeg, .jpg, .mp4, .mov, .avi, .wmv, .pdf만 가능)")}`)}),n.reduce((j,P)=>P.size+j,0)>oe)throw Error(s("한번에 업로드되는 파일 용량은 100MB를 초과할 수 없습니다."))}},B=async a=>{try{L(a)}catch(n){return y({type:"error",message:n.message||""})}try{if(!a.target.files||!a.target.files.length)return;const n=[...a.target.files],l=new FormData;n.forEach(u=>l.append("uploadFiles",u)),c(!0),await R.mutateAsync(l),t.refetch()}catch(n){y({type:"error",message:n.message||""})}finally{x.current.value="",c(!1)}},N=(a,n)=>{n||(i.includes(a)?(d(l=>l.filter(u=>u!==a)),o(!1)):(d(l=>[...l,a]),i.length+1===k.length&&o(!0)))},V=()=>{h(T({opened:!1,meta:{}}))},Y=()=>{h(T({opened:!0,meta:{title:s("삭제 확인"),body:e.jsxs(e.Fragment,{children:[s("선택한 파일을 삭제 하시겠습니까?"),e.jsx("br",{}),s("스토리지에 저장된 파일이 영구 삭제됩니다.")]}),defaultText:s("취소"),confirmText:s("삭제"),onConfirmClick:async()=>{try{c(!0),await F.mutateAsync(i),t.refetch(),c(!1),o(!1),d([]),V()}catch(a){c(!1),y({type:"error",message:a.message||""})}}}}))},O=()=>{r?(d([]),o(!1)):(d([...k.map(a=>a.contentsKey)]),o(!0))};return e.jsxs(q,{children:[b&&e.jsx(W,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-gray-700",children:[e.jsx("span",{className:"text-gray-950 font-extrabold mr-d2",children:s("업로드 파일")}),s("총")," ",s("개",{count:t.contents.contentsCount})]}),e.jsx("input",{type:"file",ref:x,multiple:!0,hidden:!0,onChange:a=>B(a)}),e.jsxs($,{kind:"fill-gray-950",className:"w-d16 h-8 text-md !font-normal",onClick:()=>{var a;return(a=x.current)==null?void 0:a.click()},children:[e.jsx("img",{className:"w-5 h-5 mr-d1",src:"/manage/icon-file-upload.svg"}),s("파일")]})]}),e.jsxs(ee,{children:[e.jsxs("div",{className:"flex items-center text-md font-bold text-gray-800",children:[e.jsx(v,{value:r,className:"!rounded-d",onChecked:()=>O()}),e.jsxs($,{kind:"outline-gray-400",className:"w-16 h-d6 mx-4 tablet:mx-d2 tablet:!border-none tablet:w-[22px] tablet:h-[22px]",disabled:!i.length,onClick:()=>Y(),children:[e.jsx("img",{className:"w-4.5 h-4.5",src:"/icons/icon-trashcan.svg"}),!S&&s("삭제")]}),i.length>0&&s("n개 선택",{count:i.length})]}),e.jsx(Z,{title:s("등록일순"),items:se,value:t.sorted,onSelect:a=>t.setSorted(a.key)})]}),e.jsx(Q,{className:"pretty-scroll pretty-scroll-light",children:t.contents.contentsStorages.map(a=>S?e.jsx(ae,{isSelect:i.includes(a.contentsKey),onClick:()=>
50N(a.contentsKey,a.usageFlag),...a},a.contentsKey):e.jsx(te,{isSelect:i.includes(a.contentsKey),onClick:()=>N(a.contentsKey,a.usageFlag),...a},a.contentsKey))})]})}function fe(){const[t,r]=p.useState("date,DESC"),{spaceId:o}=G(),{message:i}=D(),{isLoading:d,isSuccess:b,isError:c,data:x,refetch:s}=_({spaceId:o||"",sort:t});return e.jsx(J,{title:i("콘텐츠 스토리지 관리"),className:"leading-[1.1]",isLoading:d,isError:c,children:b&&e.jsx(e.Fragment,{children:e.jsx(ne,{spaceId:o||"",sorted:t,contents:x.contents,refetch:()=>s(),setSorted:h=>r(h)})})})}export{fe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.