| 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/ProfileResourceLimits-DkY60ueM.js |
import{j as o,L as h,R as d,aM as f,ba as p,aZ as y,bT as x,bV as j,bQ as b,bR as v,bS as k,U as P,d as m,s as l,bO as D}from"./index-BFGypnt-.js";const O=({profile:s})=>o.jsx(h,{to:`${d}/ui/project/${encodeURIComponent(s?.project??"default")}/profile/${encodeURIComponent(s.name)}`,onClick:n=>{n.stopPropagation()},children:o.jsx(f,{item:s})}),C=({devices:s,className:n})=>{const c=s.filter(t=>!p(t)),e={};c.forEach(t=>{if(y(t)){if(x(t))return;j(t)?e.volume=(e.volume||0)+1:e.disk=(e.disk||0)+1}else b(t)?e.gpu=(e.gpu||0)+1:v(t)?e.proxy=(e.proxy||0)+1:k(t)&&(e.other=(e.other||0)+1)});const r={volume:"Volume",disk:"Disk",gpu:"GPU",proxy:"Proxy",other:"Other"},a=["volume","disk","gpu","proxy","other"].filter(t=>e[t]>0).map(t=>{const i=e[t],g=r[t]||t;return`${i} ${P(g,i)}`});return a.length>0?o.jsx(m.List,{items:a,middot:!0,className:l("u-no-margin devices-summary-list",n),title:a.join(", ")}):"-"},R=({profile:s,className:n})=>{if(!s)return"-";const c=Object.keys(s.config).some(i=>i.startsWith("security.")),e=Object.keys(s.config).some(i=>i.startsWith("snapshots.")),r=!!(s.config["migration.stateful"]||s.config["cluster.evacuate"]),u=Object.keys(s.config).some(i=>i.startsWith("boot.")),a=D(s),t=[c&&"Security policies",e&&"Snapshots",r&&"Migration",u&&"Boot",a&&"Cloud init"].filter(Boolean);return t.length>0?o.jsx(m.List,{items:t,middot:!0,className:l("u-no-margin profile-configuration-sections",n),title:t.join(", ")}):"-"},S=({profile:s})=>s.config["limits.cpu"]||s.config["limits.memory"]?o.jsx(m.List,{items:[`CPU: ${s.config["limits.cpu"]||"-"}`,`Memory: ${s.config["limits.memory"]||"-"}`],middot:!0,className:"u-no-margin"}):o.jsx(o.Fragment,{children:"-"});export{C as D,O as P,S as a,R as b};