| Current Path : /snap/lxd/current/share/lxd-ui/assets/ |
| Current File : //snap/lxd/current/share/lxd-ui/assets/StoragePoolRichChip-Daex_aZU.js |
import{dC as p,D as d,j as e,z as g,L as h,b2 as m,d as c,cL as x,H as S,R as j,cM as L,w as v}from"./index-BsQN_SZU.js";import{S as T}from"./StoragePoolSize-BNbqTfwA.js";const b=({poolName:t,url:a,location:n})=>{const{data:o,isLoading:l}=p(t),{data:s,isLoading:i}=d(n||"none");if(!o&&!l)return e.jsxs(e.Fragment,{children:["Storage pool ",e.jsx(g,{type:"pool",value:t,bold:!0})," not found"]});const r=[{title:"Storage pool",value:o?e.jsx(h,{to:a,onClick:u=>{u.stopPropagation()},children:e.jsx(m,{item:{name:t}})}):e.jsx(c.Spinner,{}),valueTitle:t},{title:"Description",value:o?.description||"-",valueTitle:o?.description||"-"},{title:"Driver",value:o?.driver||"-"},{title:"Status",value:o?.status||"-"},{title:"Size",value:o?i?"-":e.jsx(T,{pool:o,member:s??void 0,hasMeterBar:!0,forceSingleLine:!0}):"-"},{title:"Used by",value:o?o.used_by?.length:"-"}];return e.jsx(x,{rows:r,className:"storage-pool-rich-tooltip-table"})},I=({poolName:t,projectName:a,className:n,disabled:o,location:l})=>{const s=!S(L,"height"),i=`${j}/ui/project/${encodeURIComponent(a)}/storage/pool/${encodeURIComponent(t)}`,r=e.jsx(v,{type:"pool",value:t,to:i,hasTitle:!s,className:n,disabled:o});return s?e.jsx(c.Tooltip,{zIndex:1e3,position:"right",message:e.jsx(b,{poolName:t,url:i,location:l}),children:r}):e.jsx(e.Fragment,{children:r})};export{I as S};