| Current Path : /proc/thread-self/root/snap/lxd/39313/share/lxd-ui/assets/ |
| Current File : //proc/thread-self/root/snap/lxd/39313/share/lxd-ui/assets/ProfileRichChip-XiLIeCE5.js |
import{j as t,ba as f,bh as g,v as c,R as u,T as P,cr as x,y as m,bN as L,ad as h,d as p,cs as R,O as T,ct as b}from"./index-BFGypnt-.js";import{P as C,D as k,a as w,b as I}from"./ProfileResourceLimits-DkY60ueM.js";import{a as $}from"./useProfiles-CErbukD2.js";const D=({profile:s,project:o})=>t.jsx(t.Fragment,{children:Object.values(s.devices).some(f)?t.jsx(g,{items:Object.values(s.devices).filter(f).map(e=>t.jsx(c,{type:"network",value:e.network,to:`${u}/ui/project/${encodeURIComponent(o)}/network/${encodeURIComponent(e.network)}`},e.network))}):"-"}),O=({profileName:s,projectName:o})=>{const{data:e,isLoading:r}=$(s,o),{project:i,isLoading:a}=P(),n=x(i);if(!e&&!(r||a))return t.jsxs(t.Fragment,{children:["Profile ",t.jsx(m,{type:"profile",value:s,bold:!0})," not found"]});const d=e?.description||"-",j=L(o,o==="default",e?e.used_by:[]).length,l=e?h(e):"",v=[{title:"Profile",value:e?t.jsx(C,{profile:e}):t.jsx(p.Spinner,{}),valueTitle:s},{title:"Description",value:d,valueTitle:d},{title:"Defined in",value:`${n?"Current":"Default"} project`},{title:"Root storage",value:l?t.jsx(c,{type:"pool",value:l,to:`${u}/ui/project/${encodeURIComponent(o)}/storage/pool/${encodeURIComponent(l)}`}):"-",truncate:!1,className:"storage-list"},{title:"Networks",value:e?t.jsx(D,{profile:e,project:o}):"-",truncate:!1,className:"networks-list"},{title:"Devices",value:e?t.jsx(k,{devices:Object.values(e.devices),className:"truncated"}):"-",truncate:!1},{title:"Limits",value:e?t.jsx(w,{profile:e}):"-",truncate:!1},{title:"Configuration",value:t.jsx(I,{profile:e,className:"truncated"}),truncate:!1},{title:"Used by",value:j}];return t.jsx(R,{rows:v,className:"profile-rich-tooltip-table"})},A=({profileName:s,projectName:o,className:e,disabled:r})=>{const i=!T(b,"height"),a=`${u}/ui/project/${encodeURIComponent(o)}/profile/${encodeURIComponent(s)}`,n=t.jsx(c,{type:"profile",value:s,to:a,hasTitle:!i,className:e,disabled:r});return i?t.jsx(p.Tooltip,{zIndex:1e3,position:"right",message:t.jsx(O,{profileName:s,projectName:o}),children:n}):t.jsx(t.Fragment,{children:n})};export{A as P};