| Current Path : /proc/thread-self/root/snap/lxd/current/share/lxd-ui/assets/ |
| Current File : //proc/thread-self/root/snap/lxd/current/share/lxd-ui/assets/StoragePoolRichChip-CxRTjvv2.js |
import{j as e,y as p,L as d,aM as g,d as c,cs as m,O as h,ct as x,R as S,v as j}from"./index-BFGypnt-.js";import{h as v}from"./useStoragePools-qBtKr1j9.js";import{a as L}from"./useClusterMembers-B29_ixY7.js";import{S as T}from"./StoragePoolSize-ChYxPd_8.js";const R=({poolName:t,url:a,location:n})=>{const{data:o,isLoading:l}=v(t),{data:s,isLoading:i}=L(n||"none");if(!o&&!l)return e.jsxs(e.Fragment,{children:["Storage pool ",e.jsx(p,{type:"pool",value:t,bold:!0})," not found"]});const r=[{title:"Storage pool",value:o?e.jsx(d,{to:a,onClick:u=>{u.stopPropagation()},children:e.jsx(g,{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(m,{rows:r,className:"storage-pool-rich-tooltip-table"})},O=({poolName:t,projectName:a,className:n,disabled:o,location:l})=>{const s=!h(x,"height"),i=`${S}/ui/project/${encodeURIComponent(a)}/storage/pool/${encodeURIComponent(t)}`,r=e.jsx(j,{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(R,{poolName:t,url:i,location:l}),children:r}):e.jsx(e.Fragment,{children:r})};export{O as S};