Your IP : 216.73.216.52


Current Path : /snap/lxd/38768/share/lxd-ui/assets/
Upload File :
Current File : //snap/lxd/38768/share/lxd-ui/assets/ProjectRichChip-DZzjTfq6.js

import{ay as I,ae as S,V as C,j as t,z as b,ag as D,af as N,cJ as y,L as U,R as f,b2 as O,d as l,w as d,cL as z,H as B,cM as E}from"./index-BsQN_SZU.js";const F=({projectName:s})=>{const{data:e,isLoading:g}=I(s),{data:r,isLoading:c}=S("default",s),{hasProjectsNetworksZones:u,hasStorageBuckets:j}=C();if(!e&&!(g||c))return t.jsxs(t.Fragment,{children:["Project ",t.jsx(b,{type:"project",value:s,bold:!0})," not found"]});const h=e?.description||"-",m=r?D(r):"",p=r?N(r):"none",k=e?.config?.restricted==="true",v=e?.config?.["features.images"]==="true",P=y(e),L=e?.config?.["features.networks"]==="true",w=e?.config?.["features.networks.zones"]==="true",x=e?.config?.["features.storage.buckets"]==="true",$=e?.config?.["features.storage.volumes"]==="true",i=[];v&&i.push("Images"),P&&i.push("Profiles"),L&&i.push("Networks"),u&&w&&i.push("Network zones"),j&&x&&i.push("Storage buckets"),$&&i.push("Storage volumes");const o=[],n=[],a=[];e?.config?.["limits.instances"]&&o.push(`Instances: ${e.config["limits.instances"]}`),e?.config?.["limits.containers"]&&o.push(`Containers: ${e.config["limits.containers"]}`),e?.config?.["limits.virtual-machines"]&&o.push(`VMs: ${e.config["limits.virtual-machines"]}`),e?.config?.["limits.cpu"]&&n.push(`CPU: ${e.config["limits.cpu"]}`),e?.config?.["limits.memory"]&&n.push(`Memory: ${e.config["limits.memory"]}`),e?.config?.["limits.processes"]&&n.push(`Processes: ${e.config["limits.processes"]}`),e?.config?.["limits.disk"]&&a.push(`Disk: ${e.config["limits.disk"]}`),e?.config?.["limits.networks"]&&a.push(`Networks: ${e.config["limits.networks"]}`);const R=[{title:"Project",value:e?t.jsx(U,{to:`${f}/ui/project/${encodeURIComponent(s)}`,onClick:T=>{T.stopPropagation()},children:t.jsx(O,{item:e})}):t.jsx(l.Spinner,{}),valueTitle:s},{title:"Description",value:h,valueTitle:h},{title:"Default root storage",value:m?t.jsx(d,{type:"pool",value:m,to:`${f}/ui/project/${encodeURIComponent(s)}/storage/pool/${encodeURIComponent(m)}`}):"-",truncate:!1},{title:"Default instance network",value:p!=="none"?t.jsx(d,{type:"network",value:p,to:`${f}/ui/project/${encodeURIComponent(s)}/network/${encodeURIComponent(p)}`}):"-",truncate:!1},{title:"Isolation",value:i.length>0?t.jsx(l.List,{items:i,middot:!0,className:"u-no-margin truncated",title:i.join(", ")}):"-",valueTitle:i.length>0?i.join(", "):"-"},{title:"Restrictions",value:k?"Enabled":"Disabled"},{title:"Instance limits",value:o.length>0?t.jsx(l.List,{items:o,middot:!0,className:"u-no-margin truncated",title:o.join(", ")}):"-",valueTitle:o.length>0?o.join(", "):"-"},{title:"Compute limits",value:n.length>0?t.jsx(l.List,{items:n,middot:!0,className:"u-no-margin truncated",title:n.join(", ")}):"-",valueTitle:n.length>0?n.join(", "):"-"},{title:"Storage & Network",value:a.length>0?t.jsx(l.List,{items:a,middot:!0,className:"u-no-margin truncated",title:a.join(", ")}):"-",valueTitle:a.length>0?a.join(", "):"-"}];return t.jsx(z,{rows:R,className:"project-rich-tooltip-table"})},V=({projectName:s,urlSuffix:e="",className:g,disabled:r})=>{const c=!B(E,"height"),u=t.jsx(d,{type:"project",value:s,to:`${f}/ui/project/${encodeURIComponent(s)}${e}`,hasTitle:!c,className:g,disabled:r});return c?t.jsx(l.Tooltip,{zIndex:1e3,position:"right",message:t.jsx(F,{projectName:s}),children:u}):t.jsx(t.Fragment,{children:u})};export{V as P};