PageSourceSearch

https://cloud.resilis.io/assets/storage-objects-panel-CTcbB1Zt.js

js resilis.io collected 2026-09-24 19:39:27 UTC 20,223 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-vendor-DSsww-Kv.js";import{c as D,a1 as re,cC as De,cD as Se,cE as Ce,f as ae,an as ne,S as _e,d as Fe,bc as Ee,bd as Me,ao as v,B as p,cF as V,cG as Le,A as Te,b0 as Oe,cH as $e,cn as Re,a2 as W,D as Be,h as Pe,k as Ve,n as P,ay as He,cI as ze,cJ as X,cK as Ue,cL as qe}from"./index-DAt3PBr5.js";import{S as Ae}from"./section-eyebrow-CV8sKsMi.js";import{a as x,L as Ge}from"./react-vendor-NvA41F0Y.js";import{E as Qe}from"./workspace-primitives-C1dQ4mvy.js";import{b as Ke}from"./format-DYfy5YRO.js";import{s as Ze}from"./storage-display-DlaedP4q.js";import{R as Je}from"./resource-page-skeleton-DeYwRB_q.js";import{R as We,a as Xe}from"./resource-creation-drawer-IGTtlW2D.js";import{D as Ye,a as Ie,b as et,c as tt,d as st,e as rt}from"./dialog-DrheB7Vn.js";import{I as Y}from"./input-BJ_IkYk8.js";import{L as at}from"./label-C1gC47fQ.js";import{f as oe,a as ie,g as U}from"./format-DGcDGe_R.js";import{B as I}from"./badge-BSg2mDhB.js";import{R as nt}from"./refresh-cw-BSg9mvOJ.js";import{T as q}from"./trash-2-Bw-aIahY.js";import{S as ot}from"./search-D6YPS_6q.js";import{E as it}from"./ellipsis-vertical-B_bW3UAA.js";import{S as lt,a as ct}from"./storage-workspace-primitives-BHl2wx7h.js";import{s as dt}from"./storage-routing-BuIXQg0H.js";import"./box-Bz_4p_Hp.js";import"./resource-routing-Bw1rqa1U.js";import"./database-DLIYKanj.js";import"./hard-drive-4f0MCYCf.js";import"./globe-DR5bsF4Y.js";import"./server-2fRzK74i.js";const mt=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],le=D("download",mt);const xt=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],ut=D("file",xt);const pt=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ee=D("folder-plus",pt);const ht=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],te=D("folder",ht);const ft=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ce=D("history",ft);const gt=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],de=D("share-2",gt);const jt=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],se=D("upload",jt);function yt(o,m){const[w,l]=x.useState(o);return x.useEffect(()=>{const d=setTimeout(()=>{l(o)},m);return()=>{clearTimeout(d)}},[o,m]),w}function Nt({bucketId:o,objectKey:m,onClose:w}){const{toast:l}=re(),{data:d,isLoading:g,error:j}=De(o,{key:m}),S=Se(o),C=Ce(o),_=ae(),c=ne(),O=a=>{let n;try{n=c.capture(_)}catch{return}S.mutate({key:m,versionId:a.version_id},{onSuccess:()=>{c.commit(n,()=>l({title:"Version deleted"}))},onError:()=>{c.commit(n,()=>{l({title:"Failed to delete version",variant:"destructive"})})}})},$=a=>{let n;try{n=c.capture(_)}catch{return}C.mutate({key:m,versionId:a.version_id},{onSuccess:()=>{c.commit(n,()=>l({title:"Version restored as latest"}))},onError:()=>{c.commit(n,()=>{l({title:"Failed to restore version",variant:"destructive"})})}})},M=async a=>{let n;try{n=c.capture(_);const F=await c.run(n,({scope:h,signal:N})=>V(h,o,{key:m,operation:"get",version_id:a.version_id,ttl_seconds:900},N));c.commit(n,()=>{window.open(F.url,"_blank","noopener,noreferrer")})}catch{n&&c.commit(n,()=>{l({title:"Failed to create download link",variant:"destructive"})})}},L=async a=>{let n;try{n=c.capture(_);const F=await c.run(n,({scope:h,signal:N})=>V(h,o,{key:m,operation:"get",version_id:a.version_id,ttl_seconds:3600},N));await c.run(n,()=>navigator.clipboard.writeText(F.url)),c.commit(n,()=>{l({title:"Share link copied",description:"The link expires in 1 hour."})})}catch{n&&c.commit(n,()=>{l({title:"Failed to copy share link",variant:"destructive"})})}},y=d?.versions??[];return e.jsx(_e,{open:!0,onOpenChange:a=>!a&&w(),children:e.jsxs(Fe,{className:"w-[520px] sm:max-w-[520px] overflow-y-auto",children:[e.jsxs(Ee,{className:"mb-4",children:[e.jsxs(Me,{className:"flex items-center gap-2",children:[e.jsx(ce,{className:"h-4 w-4"}),"Version History"]}),e.jsx("p",{className:"text-sm text-muted-foreground font-mono break-all",children:m})]}),g&&e.jsx("div",{className:"space-y-3",children:Array.from({length:4}).map((a,n)=>e.jsx(v,{className:"h-20 w-full rounded-none"},n))}),j&&e.jsx("p",{className:"text-sm text-destructive",children:"Failed to load versions."}),!g&&y.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No versions foun
1d."}),e.jsx("div",{className:"space-y-2",children:y.map(a=>e.jsxs("div",{className:"flex flex-col gap-1.5  border p-3 text-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.is_latest&&e.jsx(I,{variant:"secondary",className:"shrink-0 text-xs",children:"Latest"}),a.is_delete_marker&&e.jsx(I,{variant:"destructive",className:"shrink-0 text-xs",children:"Delete Marker"}),e.jsxs("span",{className:"font-mono text-xs text-muted-foreground truncate",title:a.version_id,children:[a.version_id.slice(0,20),"…"]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[!a.is_delete_marker&&e.jsx(p,{variant:"ghost",size:"icon",className:"h-7 w-7",title:"Download this version",onClick:()=>M(a),children:e.jsx(le,{className:"h-3.5 w-3.5"})}),!a.is_delete_marker&&e.jsx(p,{variant:"ghost",size:"icon",className:"h-7 w-7",title:"Copy share link (expires in 1 hour)",onClick:()=>L(a),children:e.jsx(de,{className:"h-3.5 w-3.5"})}),!a.is_delete_marker&&e.jsx(p,{variant:"ghost",size:"icon",className:"h-7 w-7",title:"Restore this version",disabled:a.is_latest||C.isPending,onClick:()=>$(a),children:e.jsx(nt,{className:"h-3.5 w-3.5"})}),e.jsx(p,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",title:"Delete this version",disabled:S.isPending,onClick:()=>O(a),children:e.jsx(q,{className:"h-3.5 w-3.5"})})]})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{children:oe(a.last_modified)}),!a.is_delete_marker&&e.jsx("span",{children:ie(a.size)})]})]},a.version_id))}),d?.is_truncated&&e.jsx("p",{className:"mt-4 text-xs text-muted-foreground text-center",children:"More versions available — pagination not yet implemented."})]})})}function vt({bucketId:o,rootLabel:m="Objects",showInlineActions:w=!0}){const[l,d]=x.useState(""),[g,j]=x.useState(""),[S,C]=x.useState(""),[_,c]=x.useState(!1),[O,$]=x.useState(!1),[M,L]=x.useState(!1),[y,a]=x.useState(null),[n,F]=x.useState(null),[h,N]=x.useState(null),H=x.useRef(null),R=x.useRef(0),A=yt(g,250),me=A?`${l}${A}`:l,{data:G,isLoading:E,error:Q}=Le(o,{prefix:me}),xe=Te(),{toast:f}=re(),b=ae(),i=ne(),z=(t=b)=>{i.commit(t,()=>{xe.invalidateQueries({queryKey:He(t,ze.buckets())})})},B=Oe({mutationFn:t=>i.run(b,({scope:s,signal:r})=>$e(s,o,t,r)),onMutate:()=>i.capture(b),onSuccess:(t,s,r)=>{i.commit(r,()=>{z(r),N(null),f({title:"Object deleted"})})},onError:(t,s,r)=>{r&&i.commit(r,()=>{f({title:"Failed to delete object",description:t.message,variant:"destructive"})})}}),ue=x.useMemo(()=>{const t=l.split("/").filter(Boolean);return t.map((s,r)=>({label:s,prefix:t.slice(0,r+1).join("/")+"/"}))},[l]),pe=x.useMemo(()=>{const t=l.split("/").filter(Boolean);return t.length<=1?"":t.slice(0,-1).join("/")+"/"},[l]),K=async(t,s)=>{let r;try{r=i.capture(b)}catch{return!1}i.commit(r,()=>$(!0));try{await i.run(r,({scope:u,signal:k})=>Promise.all(t.map(T=>X(u,o,`${s}${T.name}`,T,T.type||"application/octet-stream",k)))),i.commit(r,()=>{f({title:"Upload complete",description:`${t.length} file${t.length===1?"":"s"} uploaded.`}),z(r)})}catch(u){i.commit(r,()=>{f({title:"Upload failed",description:u instanceof Error?u.message:"Could not upload files.",variant:"destructive"})})}finally{$(!1)}return i.isCurrent(r)},he=async t=>{const s=Array.from(t.target.files??[]);s.length!==0&&await K(s,l)&&(t.target.value="")},fe=async t=>{let s;try{s=i.capture(b);const r=await i.run(s,({scope:u,signal:k})=>V(u,o,{key:t,operation:"get",ttl_seconds:900},k));i.commit(s,()=>{window.open(r.url,"_blank","noopener,noreferrer")})}catch(r){s&&i.commit(s,()=>{f({title:"Failed to create download link",description:r instanceof Error?r.message:"Could not sign object.",variant:"destructive"})})}},ge=async t=>{let s;try{s=i.capture(b);const r=await i.run(s,({scope:u,signal:k})=>V(u,o,{key:t,operation:"get",ttl_seconds:3600},k));await i.run(s,()=>navigator.clipboard.writeText(r.url)),i.commit(s,()=>{f({title:"Share link copied",description:"The link expires in 1 hour."})})}
1catch(r){s&&i.commit(s,()=>{f({title:"Failed to copy share link",description:r instanceof Error?r.message:"Could not sign object.",variant:"destructive"})})}},je=async t=>{t.preventDefault();const s=S.trim().replace(/^\/+|\/+$/g,"");if(!s)return;let r;try{r=i.capture(b);const u=`${l}${s}/`;await i.run(r,({scope:k,signal:T})=>X(k,o,u,new Blob([]),"application/x-directory",T)),i.commit(r,()=>{C(""),c(!1),z(r),f({title:"Folder created"})})}catch(u){r&&i.commit(r,()=>{f({title:"Failed to create folder",description:u instanceof Error?u.message:"Could not create folder.",variant:"destructive"})})}},ye=t=>{t.dataTransfer.types.includes("Files")&&(t.preventDefault(),R.current++,L(!0))},Ne=()=>{R.current--,R.current===0&&(L(!1),a(null))},ve=t=>{t.preventDefault()},we=t=>{t.preventDefault(),R.current=0,L(!1);const s=y??l;a(null);const r=Array.from(t.dataTransfer.files);r.length>0&&K(r,s)},be=(t,s)=>{t.preventDefault(),a(s)},ke=(t,s)=>{t.currentTarget.contains(t.relatedTarget)||y===s&&a(null)},Z=G?.common_prefixes??[],J=(G?.objects??[]).filter(t=>t.key!==l);return x.useEffect(()=>{const t=()=>c(!0),s=()=>H.current?.click();return window.addEventListener(`storage-file-browser:create-folder:${o}`,t),window.addEventListener(`storage-file-browser:upload:${o}`,s),()=>{window.removeEventListener(`storage-file-browser:create-folder:${o}`,t),window.removeEventListener(`storage-file-browser:upload:${o}`,s)}},[o]),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex min-h-11 flex-col gap-3 border-b border-mist-line px-5 py-2.5 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[e.jsx("button",{type:"button",onClick:()=>d(""),className:"font-medium uppercase text-accent-strong hover:underline",children:m}),ue.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Re,{className:"h-3.5 w-3.5"}),e.jsx("button",{type:"button",onClick:()=>d(t.prefix),className:"max-w-[12rem] truncate hover:text-foreground hover:underline",children:t.label})]},t.prefix))]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"relative min-w-0 sm:w-64",children:[e.jsx(ot,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(Y,{value:g,onChange:t=>j(t.target.value),placeholder:"Search prefix",className:"pl-9"})]}),e.jsx("input",{ref:H,type:"file",multiple:!0,className:"hidden",onChange:he}),w?e.jsxs(e.Fragment,{children:[e.jsxs(p,{variant:"outline",onClick:()=>c(!0),children:[e.jsx(ee,{className:"mr-2 h-4 w-4"}),"Create Folder"]}),e.jsxs(p,{variant:"outline",onClick:()=>H.current?.click(),disabled:O,children:[O?e.jsx(W,{className:"mr-2 h-4 w-4"}):e.jsx(se,{className:"mr-2 h-4 w-4"}),"Upload"]})]}):null]})]}),e.jsxs("div",{className:`relative overflow-hidden border border-table-border transition-colors ${M?"border-accent-strong bg-surface-primary":"bg-surface-primary"}`,onDragEnter:ye,onDragLeave:Ne,onDragOver:ve,onDrop:we,children:[M&&!y?e.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center border-2 border-dashed border-accent-strong bg-selector-surface",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-accent-strong",children:[e.jsx(se,{className:"h-8 w-8"}),e.jsx("span",{className:"text-sm font-medium",children:"Drop to upload here"})]})}):null,e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full table-fixed text-xs text-muted-foreground",children:[e.jsx("thead",{className:"bg-surface-secondary text-left",children:e.jsxs("tr",{className:"border-b border-table-border",children:[e.jsx("th",{className:"w-[48%] px-5 py-3 text-left text-xs font-medium text-muted-foreground",children:"Name"}),e.jsx("th",{className:"w-[16%] px-5 py-3 text-left text-xs font-medium text-muted-foreground",children:"Size"}),e.jsx("th",{className:"w-[12%] px-5 py-3 text-left text-xs font-medium text-muted-foreground",children:"Type"}),e.jsx("th",{className:"w-[20%] px-5 py-3 text-left text-xs font-medium text-muted-foreground",children:"Last Modified"}),e.jsx("th",{className:"w-[4%] px-5 py-4"})]})}),e.jsxs("tbody",{"aria-busy":E,className:"divide-y divide-table-border",children:[E?Array.from({length:5}).map((t,s)=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-5 py-4",children:e.jsx(v,{className:"h-5 w-full rounded-none"})}),e.jsx("td",{className:"px-5 py-4",children:e.jsx(v,{className:"h-5 w-16 rounded-none"})}),e.jsx("td",{className:"px-5 py-4",children:e.jsx(v,{className:"h-5 w-20 rounded-none"})}),e.jsx("td",{className:"px-5 py-4",children:e.jsx(v,{className:"h-5 w-28 rounded-none"})}),e.jsx("td",{className:"px-5 py-4",children:e.jsx(v,{className:"h-7 w-7 rounded-none"})})]},s)):null,!E&&l?e.jsxs("tr",{className:"cursor-pointer transition-colors hover:bg-selector-hover",onClick:()=>{d(pe),j("")},children:[e.jsx("td",{className:"px-5 py-4 text-xs font-medium",children:e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4 text-accent-strong"}),e.jsx("span",{className:"truncate",children:".."})]})}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground",children:"-"}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground",children:"Folder"}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground",children:"-"}),e.jsx("td",{className:"px-5 py-4"})]}):null,!E&&Z.map(t=>
1e.jsxs("tr",{className:`cursor-pointer transition-colors ${y===t?"bg-selector-surface":"hover:bg-selector-hover"}`,onClick:()=>{d(t),j("")},onDragEnter:s=>be(s,t),onDragLeave:s=>ke(s,t),children:[e.jsx("td",{className:"px-5 py-4 text-xs font-medium",children:e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4 text-accent-strong"}),e.jsx("span",{className:"truncate",children:U(t)}),y===t?e.jsx("span",{className:"ml-1 shrink-0 bg-selector-surface px-1.5 py-0.5 text-xs text-accent-strong",children:"Drop here"}):null]})}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground",children:"-"}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground",children:"Folder"}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground",children:"-"}),e.jsx("td",{className:"px-5 py-4"})]},t)),!E&&J.map(t=>e.jsxs("tr",{className:"transition-colors hover:bg-selector-hover",children:[e.jsx("td",{className:"px-5 py-4 text-xs font-medium",children:e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(ut,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"truncate",children:U(t.key)})]})}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground",children:ie(t.size)}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground truncate",children:t.content_type||"Object"}),e.jsx("td",{className:"px-5 py-4 text-xs text-muted-foreground",children:oe(t.last_modified)}),e.jsx("td",{className:"px-5 py-4",children:e.jsxs(Be,{children:[e.jsx(Pe,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(it,{className:"h-4 w-4"})})}),e.jsxs(Ve,{align:"end",children:[e.jsxs(P,{onClick:()=>fe(t.key),children:[e.jsx(le,{className:"h-4 w-4"}),"Download"]}),e.jsxs(P,{onClick:()=>ge(t.key),children:[e.jsx(de,{className:"h-4 w-4"}),"Share Link"]}),e.jsxs(P,{onClick:()=>F(t.key),children:[e.jsx(ce,{className:"h-4 w-4"}),"Version History"]}),e.jsxs(P,{className:"text-destructive",onClick:()=>N(t),children:[e.jsx(q,{className:"h-4 w-4"}),"Delete"]})]})]})})]},t.key))]})]})}),!E&&!Q&&Z.length===0&&J.length===0?e.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:M?"Drop files to upload":"No objects found"}):null,Q?e.jsx("div",{className:"p-4 text-sm text-destructive",children:"Failed to load objects."}):null]}),n&&e.jsx(Nt,{bucketId:o,objectKey:n,onClose:()=>F(null)}),e.jsx(Ye,{open:!!h,onOpenChange:t=>!t&&N(null),children:e.jsxs(Ie,{children:[e.jsxs(et,{children:[e.jsx(tt,{children:"Delete object"}),e.jsxs(st,{children:["Delete ",h?U(h.key):"this object"," from the bucket. This action cannot be undone."]})]}),e.jsx("div",{className:"border border-field-border bg-field-muted p-3 font-mono text-xs text-foreground",children:h?.key}),e.jsxs(rt,{children:[e.jsx(p,{variant:"outline",onClick:()=>N(null),disabled:B.isPending,children:"Cancel"}),e.jsxs(p,{variant:"destructive",onClick:()=>h&&B.mutate(h.key),disabled:!h||B.isPending,children:[B.isPending?e.jsx(W,{className:"h-4 w-4"}):e.jsx(q,{className:"h-4 w-4"}),"Delete"]})]})]})}),e.jsx(We,{description:"Create an empty prefix in the current bucket path.",eyebrow:"Storage / Objects",footer:e.jsxs(e.Fragment,{children:[e.jsx(p,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsxs(p,{form:"create-storage-folder-form",type:"submit",disabled:!S.trim(),children:[e.jsx(ee,{className:"h-4 w-4"}),"Create folder"]})]}),onOpenChange:t=>{c(t),t||C("")},open:_,title:"Create folder",children:e.jsx("form",{id:"create-storage-folder-form",onSubmit:je,className:"space-y-4",children:e.jsx(Xe,{description:"Use a short name without a leading slash.",title:"Folder identity",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(at,{htmlFor:"folder-name",children:"Folder Name"}),e.jsx(Y,{id:"folder-name",value:S,onChange:t=>C(t.target.value),placeholder:"folder-name"})]})})})})]})}function Zt({directBucket:o,resource:m}){const{data:w,isLoading:l}=Ue(m?.id??""),d=o??w,{data:g,isLoading:j}=qe(d?.id||"");return l?e.jsx(Je,{kind:"storage",tab:"objects",variant:"tab"}):d?e.jsxs(lt,{bucket:d,resource:m,showHeader:!1,children:[e.jsx(ct,{cells:[{label:"REGION",value:d.region||m?.regi
1on_code||"global",detail:"bucket placement"},{label:"ENDPOINT",value:Ze(),detail:"s3 gateway"},{label:"OBJECTS",value:j?e.jsx(v,{className:"h-5 w-16 rounded-none"}):g?.object_count??0,detail:"current prefix"},{label:"USED",value:j?e.jsx(v,{className:"h-5 w-24 rounded-none"}):Ke(g?.bytes_used),detail:"of plan limit"}]}),e.jsx("section",{className:"overflow-hidden border border-cool-border bg-surface-primary",children:e.jsx(vt,{bucketId:d.id,rootLabel:d.name})}),e.jsx("section",{className:"border border-cool-border bg-surface-primary",children:e.jsxs("div",{className:"flex min-h-14 flex-wrap items-center justify-between gap-4 px-5 py-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(Ae,{muted:!0,children:"Selected object"}),e.jsx("p",{className:"mt-1 break-words font-mono text-[11px] font-medium text-muted-foreground",children:"production · image/png · 241 KB · latest"})]}),e.jsx(p,{asChild:!0,className:"shrink-0 rounded-none",size:"sm",variant:"outline",children:e.jsx(Ge,{to:dt(d,m,"credentials"),children:"Manage object"})})]})})]}):e.jsx(Qe,{label:"No bucket found for this storage resource"})}export{Zt as StorageObjectsPanel};

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.