Your IP : 216.73.216.189


Current Path : /proc/thread-self/root/snap/lxd/39313/share/lxd-ui/assets/
Upload File :
Current File : //proc/thread-self/root/snap/lxd/39313/share/lxd-ui/assets/useProfiles-CErbukD2.js

import{R as s,az as r,cp as c,cq as d,u as i,ae as p,w as o}from"./index-BFGypnt-.js";const h=["can_delete","can_edit"],m=async(e,n,t)=>{const a=new URLSearchParams;return a.set("project",n),a.set("recursion","1"),c(a,t,h),fetch(`${s}/1.0/profiles/${encodeURIComponent(e)}?${a.toString()}`).then(d).then(l=>l)},f=async(e,n)=>{const t=new URLSearchParams;return t.set("recursion","1"),t.set("project",e),c(t,n,h),fetch(`${s}/1.0/profiles?${t.toString()}`).then(r).then(a=>a.metadata)},y=async(e,n)=>{const t=new URLSearchParams;t.set("project",n),await fetch(`${s}/1.0/profiles?${t.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:e}).then(r)},P=async(e,n)=>{const t=new URLSearchParams;return t.set("project",n),fetch(`${s}/1.0/profiles/${encodeURIComponent(e.name)}?${t.toString()}`,{method:"PUT",body:JSON.stringify(e),headers:{"Content-Type":"application/json","If-Match":e.etag??"invalid-etag"}}).then(r).then(a=>a)},S=async(e,n,t)=>{const a=new URLSearchParams;a.set("project",t),await fetch(`${s}/1.0/profiles/${encodeURIComponent(e)}?${a.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})}).then(r)},$=async(e,n)=>{const t=new URLSearchParams;t.set("project",n),await fetch(`${s}/1.0/profiles/${encodeURIComponent(e)}?${t.toString()}`,{method:"DELETE"}).then(r)},R=e=>{const{isFineGrained:n}=i();return p({queryKey:[o.profiles,e],queryFn:async()=>f(e,n),enabled:!!e&&n!==null})},g=(e,n,t)=>{const{isFineGrained:a}=i();return p({queryKey:[o.profiles,e,o.projects,n],queryFn:async()=>m(e,n,a),enabled:a!==null})};export{g as a,P as b,y as c,$ as d,m as f,S as r,R as u};