whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> //home/qbizpnmr/arif.umairtax.com/public/Documents-abT6JgfA.js
import{u as p,w as j,f as v,l as _,j as n,bq as P,dM as O,p as x,ax as u,ay as d,aT as A,dN as E,bf as m,r as w,e as y,$ as b,bu as T,dO as q,dP as F,dQ as S,dR as M,aG as D,aA as B,dS as R,bS as I,cq as K,Y as L,k as z,i as Q}from"./bundle.OlIVtvc7.js";import{D as $}from"./DataTableColumnsPicker-BAbL5ze4.js";const k=["name","linked_to","size","width","height","private","created_at"];function G(){return["name","linked_to","size","width","height","private","created_at","hash","id","type"]}function H(){var t;const[e]=p(),s=j(),{dateFormat:l}=v(),i=[{column:"name",id:"name",label:e("name")},{column:"linked_to",id:"link",label:e("linked_to"),format:o=>{if(o){const a=o.split("/")[1];return n.jsx(P,{to:o,children:e(a.slice(0,-1))})}}},{column:"size",id:"size",label:e("size"),format:o=>`${o} KB`},{column:"width",id:"width",label:e("width")},{column:"height",id:"height",label:e("height")},{column:"private",id:"is_public",label:e("private"),format:o=>e(o?"no":"yes")},{column:"created_at",id:"created_at",label:e("created_at"),format:o=>_(o,l)},{column:"hash",id:"hash",label:e("hash")},{column:"type",id:"type",label:e("type")}],c=((t=s==null?void 0:s.react_table_columns)==null?void 0:t.clientDocument)||k;return i.filter(o=>c.includes(o.column)).sort((o,a)=>c.indexOf(o.column)-c.indexOf(a.column))}/** * Invoice Ninja (https://invoiceninja.com). * * @link https://github.com/invoiceninja/invoiceninja source repository * * @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com) * * @license https://www.elastic.co/licensing/elastic-license */function U(){const[e]=p();return[{label:e("public"),value:"public",color:"white",backgroundColor:"#6B7280",queryKey:"type"},{label:e("private"),value:"private",color:"white",backgroundColor:"#93C5FD",queryKey:"type"},{label:e("image"),value:"image",color:"white",backgroundColor:"#1D4ED8",queryKey:"type"},{label:e("pdf"),value:"pdf",color:"white",backgroundColor:"#22C55E",queryKey:"type"},{label:e("other"),value:"other",color:"white",backgroundColor:"#9CA3AF",queryKey:"type"}]}function V(e){const[s]=p(),{document:l}=e,i=O(),[c,t]=x.useState(""),[o,a]=x.useState(!1),h=(f,r)=>{m.processing(),w("DELETE",y("/api/v1/documents/:id",{id:c}),{},{headers:{"X-Api-Password":f}}).then(()=>{m.success("deleted_document"),b(["clients"])}).catch(g=>{var C;((C=g.response)==null?void 0:C.status)===412&&(i(r),a(!0))})};return n.jsxs(n.Fragment,{children:[n.jsx(u,{onClick:()=>{t(l.id),a(!0)},icon:n.jsx(d,{element:A}),children:s("delete")}),n.jsx(E,{show:o,onClose:a,onSave:h})]})}function W(){const[e]=p(),s=T(),l=F(),i=(t,o)=>{m.processing(),s.fetchQuery(["/api/v1/documents",t.hash],()=>w("GET",y("/documents/:hash",{hash:t.hash}),{headers:R()},{responseType:"arraybuffer"}),{staleTime:1/0}).then(a=>{const h=new Blob([a.data],{type:a.headers["content-type"]}),f=URL.createObjectURL(h);if(o){window.open(f);return}const r=document.createElement("a");r.download=t.name,r.href=f,r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r),m.dismiss()})};return[t=>n.jsx(u,{onClick:()=>i(t,!0),icon:n.jsx(d,{element:q}),children:e("view")}),t=>!!t.is_public&&n.jsx(u,{onClick:()=>l(t.id,!1).then(()=>b(["clients"])),icon:n.jsx(d,{element:S}),children:e("set_private")}),t=>!t.is_public&&n.jsx(u,{onClick:()=>l(t.id,!0).then(()=>b(["clients"])),icon:n.jsx(d,{element:M}),children:e("set_public")}),t=>n.jsx(u,{onClick:()=>i(t,!1),icon:n.jsx(d,{element:D}),children:e("download")}),()=>n.jsx(B,{withoutPadding:!0}),t=>n.jsx(V,{document:t})]}function N(){const[e]=p(),s=i=>{m.processing(),w("POST",y("/api/v1/documents/bulk?per_page=100"),{action:"download",ids:i}).then(()=>m.success("exported_data"))};return[({selectedResources:i,setSelected:c})=>n.jsx(u,{onClick:()=>{s(i.map(({id:t})=>t)),c([])},icon:n.jsx(d,{element:D}),children:e("download")})]}function J(){const{id:e}=I(),s=K(),{isPurgeOrMergeActionCalled:l}=s,i=L(),c=U(),t=H(),o=W(),a=G(),h=N();return n.jsx(n.Fragment,{children:n.jsx(z,{resource:"document",methodType:"POST",queryIdentificator:"/api/v1/documents",endpoint:Q("/api/v1/clients/:id/documents",{id:e}),columns:t,customFilters:c,customActions:o,customBulkActions:h,customFilterPlaceholder:"type",withResourcefulActions:!0,rightSide:n.jsx($,{table:"clientDocument",columns:a,defaultColumns:k}),showEdit:()=>!1,showRestore:()=>!1,showArchive:()=>!1,showDelete:()=>!1,disableQuery:l,withoutDefaultBulkActions:!0,withoutStatusFilter:!0,hideEditableOptions:!i("edit_expense")})})}export{J as default};
Copyright ©2021 || Defacer Indonesia