PageSourceSearch

https://id.movevn.com/assets/UploadMedia-bqDxAHlk.js

js movevn.com collected 2026-10-02 00:32:41 UTC 3,416 bytes, 1 lines download raw bytes

1import{j as a,B,z as F,a8 as H,a9 as z,aa as P,ab as N,ac as r,$ as O,a0 as R}from"./vendor-mui-1Pi3BFuh.js";import{E as $}from"./EnhancedTableHead-BUFi7wgS.js";import{E as w}from"./EnhancedTableToolbar-B3zFeloX.js";import{M as J}from"./ImageCell-CrraFrmp.js";import{I as W}from"./InputDragData-BOWMbqkn.js";import{N as q}from"./NavHeader-D3CJrNLB.js";import{u as G,a as K,J as Q,y as V,S as p}from"./index-BxBYWNob.js";import{u as X}from"./useToggleSelection-B5hv0vDo.js";import{a as b}from"./ErrorHandler-D0uxaT5w.js";import{d as Y,a as Z,u as ee}from"./Media-Cs8_YsNr.js";import{m as g}from"./message-ClwATxdx.js";import{a as c,L as ae}from"./vendor-react-CrXZvyk_.js";import{d as te}from"./vendor-redux-Bi3kFs4E.js";import"./Delete-CRJ2jk6I.js";import"./index-BLxIfDVv.js";import"./Home-CMDHSwXo.js";import"./vendor-utils-Bdq6QFHX.js";import"./vendor-form-Df9-JY-v.js";const se=[{id:"id",label:"ID"},{id:"thumbnail",label:"Thumbnail"},{id:"title",label:"Title"},{id:"created_at",label:"Loại"},{id:"title",label:"Dung lượng"},{id:"actions",label:"Actions"}],Se=()=>{const{t:u}=G(),[j,m]=c.useState(0),[k,x]=c.useState(!1),[o,h]=c.useState([]),[y,f]=c.useState(!1),{selected:n,toggle:C,selectAll:S,clearAll:T}=X(),{showMessage:d}=K(),{user:le}=te(e=>e.auth);function D(e){const t=e.loaded*100/e.total;m(+t.toFixed(2))}const L=e=>{e&&Array.from(e).forEach(async t=>{const s=new FormData;s.append("file",t),await M(s)})};async function M(e){try{m(0);const t=p("li_at"),s=await ee(t,e,D);if(s.error)b(s.data,d,u);else{const{data:l,error:i}=s;i||h(v=>[...v,l])}}catch{}finally{m(0)}}async function I(e){try{x(e);const t=p("li_at");(await Y(t,e)).error?d("error",g.response.error):(h(l=>l.filter(i=>i.id!=e)),d("success","File deleted successfully"))}catch{d("error",g.response.error)}finally{x(!1)}}async function A(e){try{f(!0);const t=p("li_at"),s=await Z(t,e);s.error?b(s.data,d,u):h(l=>l.filter(i=>!e.includes(i.id)))}catch{}finally{f(!1)}}const E=e=>{e.target.checked?S(o.map(s=>s.id)):T()},_=(e,t)=>{C(t)},U=e=>n.indexOf(e)!==-1;return a.jsxs("div",{children:[a.jsx(q,{title:"Upload media",breadcrumb:[{title:"Media",url:"/admin/media"},{title:"Upload media"}],backLink:"/admin/media/"}),a.jsxs(B,{children:[a.jsx(W,{setDataInput:L,progress:j}),Array.isArray(o)&&o.length?a.jsxs(F,{sx:{width:"100%",overflow:"hidden"},children:[a.jsx(H,{sx:{maxHeight:640,maxWidth:"calc(100vw - 54px)"},children:a.jsxs(z,{stickyHeader:!0,"aria-label":"sticky table",size:"medium",children:[a.jsx($,{headCells:se,numSelected:n.length,onSelectAllClick:E,rowCount:o.length}),a.jsx(P,{children:o.map((e,t)=>{const s=U(e.id),l=`enhanced-table-checkbox-${t}`;return a.jsxs(N,{hover:!0,role:"checkbox","aria-checked":s,tabIndex:-1,selected:s,sx:{cursor:"pointer"},children:[a.jsx(r,{padding:"checkbox",children:a.jsx(O,{color:"primary",checked:s,onClick:i=>_(i,e.id),inputProps:{"aria-labelledby":l}})}),a.jsx(r,{children:e.id}),a.jsx(r,{children:a.jsx(J,{data:e})}),a.jsx(r,{children:a.jsx(ae,{to:"/admin/media/"+e?.id,children:a.jsx("p",{className:"font-bold",children:e.file_name})})}),a.jsx(r,{children:a.jsx("p",{children:e.mime_type})}),a.jsx(r,{children:a.jsx("p",{children:Q(e.file_size)})}),a.jsx(r,{children:a.jsx(R,{size:"small",loading:k==e.id,onClick:()=>I(e.id),children:a.jsx(V,{})})})]},e?.id)})})]})}),n.length?a.jsx(w,{numSelected:n.length,isLoading:y,onSubmit:()=>A(n)}):""]}):null]})]})};export{Se 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.