| Current Path : /snap/lxd/38768/share/lxd-ui/assets/ |
| Current File : //snap/lxd/38768/share/lxd-ui/assets/useVolumes-Bxw5lKYj.js |
import{dF as f,dG as h,u as l,V as i,J as c,x as r}from"./index-BsQN_SZU.js";import{h as p}from"./images-dZFGKb1g.js";import{f as g,b as S,d as F}from"./storage-volumes-CG043sqG.js";const q=async(s,e,o)=>{const a=[];return(await y(s,e,o)).forEach(t=>{if(t.content_type==="iso"){const u=p(t);a.push(u)}}),a},y=async(s,e,o)=>e?g(s,o):w(s,o),w=async(s,e)=>{const o=[],a=await f(e);return(await Promise.allSettled(a.map(async t=>S(t.name,s,e)))).forEach((t,u)=>{if(t.status==="fulfilled"){const m=a[u],V=t.value.map(d=>({...d,pool:m.name}));o.push(...V)}else throw new Error("Failed to load iso images")}),o},A=async(s,e,o)=>{const a=[];return(await y(s,e,o)).forEach(t=>{const m=["filesystem","block"].includes(t.content_type);t.type==="custom"&&m&&!h(t)&&a.push(t)}),a},I=s=>{const{isFineGrained:e}=l(),{hasStorageVolumesAll:o}=i();return c({queryKey:[r.volumes,s],queryFn:async()=>y(s,o,e)})},b=s=>{const{isFineGrained:e}=l(),{hasStorageVolumesAll:o}=i();return c({queryKey:[r.isoVolumes,s],queryFn:async()=>q(s,o,e)})},G=(s,e)=>{const{isFineGrained:o}=l(),{hasStorageVolumesAll:a}=i();return c({queryKey:[r.customVolumes,s],queryFn:async()=>A(s,a,o),...e})},L=(s,e,o,a,n)=>{const{isFineGrained:t}=l();return c({queryKey:[r.storage,s,e,o,a,n],queryFn:async()=>F(s,e,o,a,n??null,t)})};export{G as a,I as b,L as c,b as u};