Your IP : 216.73.216.52


Current Path : /snap/lxd/current/share/lxd-ui/assets/
Upload File :
Current File : //snap/lxd/current/share/lxd-ui/assets/useAuthGroups-D8vRxz3-.js

import{R as n,O as a,d7 as o,cH as r,d8 as u,u as c,J as p,x as h}from"./index-BsQN_SZU.js";const d=["can_delete","can_edit"],i=async e=>{const t=new URLSearchParams;return t.set("recursion","1"),r(t,e,d),fetch(`${n}/1.0/auth/groups?${t.toString()}`).then(a).then(s=>(s.metadata.map(u),s.metadata))},l=async e=>{await fetch(`${n}/1.0/auth/groups`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(a)},y=async e=>{await fetch(`${n}/1.0/auth/groups/${encodeURIComponent(e)}`,{method:"DELETE"}).then(a)},S=async e=>Promise.allSettled(e.map(async t=>y(t))).then(o),f=async e=>{await fetch(`${n}/1.0/auth/groups/${encodeURIComponent(e.name)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(a)},g=async(e,t)=>{await fetch(`${n}/1.0/auth/groups/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})}).then(a)},G=()=>{const{isFineGrained:e}=c();return p({queryKey:[h.authGroups],queryFn:async()=>i(e),enabled:e!==null})};export{f as a,l as c,S as d,g as r,G as u};