/
snap
/
lxd
/
current
/
share
/
lxd-ui
/
assets
/
File Upload :
llllll
Current File: //snap/lxd/current/share/lxd-ui/assets/NetworkIPAM-BqcUqmB3.js
import{d as s,p as h,A as j,r as k,j as e,b0 as x,R as f,e as N,aJ as b,q as i}from"./index-B3cgCbnJ.js";import{H as I}from"./HelpLink-D9xEWgz5.js";import{P as c}from"./PageHeader-CCfZuT9z.js";import{g}from"./networks-DBYE4DQa.js";import{U}from"./UsedByItem-BtsI6fTe.js";const B=()=>{const l=s.useNotify(),{project:n}=h(),{data:o=[],error:a,isLoading:p}=j({queryKey:[i.projects,n,i.networkAllocations],queryFn:async()=>g(n??"default")});if(k.useEffect(()=>{a&&l.failure("Loading network allocations failed",a)},[a]),!n)return e.jsx(e.Fragment,{children:"Missing project"});const y=[{content:"Type",sortKey:"type",className:"type"},{content:"Used by",sortKey:"usedBy",className:"usedBy"},{content:"Address",sortKey:"address",className:"address"},{content:"Network",sortKey:"network",className:"network"},{content:"NAT",sortKey:"nat",className:"nat"},{content:"MAC address",sortKey:"hwaddress",className:"hwaddr"}],u=o.map(t=>{var m;const d=x(t.type,[t.used_by]),w=r=>t.type==="instance"?`/ui/project/${encodeURIComponent(r.project)}/instance/${encodeURIComponent(r.name)}`:t.type==="network"?`/ui/project/${encodeURIComponent(r.project)}/network/${encodeURIComponent(r.name)}`:t.type==="network-forward"?`/ui/project/${encodeURIComponent(r.project)}/network/${encodeURIComponent(r.name)}/forward`:"";return{columns:[{content:t.type,role:"cell",className:"type"},{content:e.jsx(e.Fragment,{children:d.length===1?e.jsx(U,{item:d[0],activeProject:n,type:t.type,to:w(d[0])}):t.used_by}),role:"rowheader",className:"usedBy"},{content:t.addresses,role:"cell",className:"address"},{content:e.jsx(f,{type:"network",value:t.network,to:`/ui/project/${encodeURIComponent(n)}/network/${encodeURIComponent(t.network)}`}),role:"cell",className:"network"},{content:t.nat?"Yes":"No",role:"cell",className:"nat"},{content:t.hwaddr,role:"cell",className:"hwaddr"}],sortData:{usedBy:t.used_by.toLowerCase(),address:t.addresses,type:t.type,nat:t.nat,hwaddress:t.hwaddr,network:(m=t.network)==null?void 0:m.toLowerCase()}}});return p?e.jsx(s.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0}):e.jsxs(s.CustomLayout,{header:e.jsx(c,{children:e.jsx(c.Left,{children:e.jsx(c.Title,{children:e.jsx(I,{docPath:"/howto/network_ipam/",title:"Learn more about IPAM",children:"IP Address Management"})})})}),children:[e.jsx(N,{}),e.jsxs(s.Row,{children:[o.length>0&&e.jsx(s.ScrollableTable,{dependencies:o,tableId:"network-ipam-table",belowIds:["status-bar"],children:e.jsx(s.MainTable,{className:"network-ipam-table",id:"network-ipam-table",headers:y,rows:u,responsive:!0,sortable:!0,emptyStateMsg:"No data to display"})}),!p&&o.length===0&&e.jsxs(s.EmptyState,{className:"empty-state",image:e.jsx(s.Icon,{className:"empty-state-icon",name:"exposed"}),title:"No network allocations found",children:[e.jsx("p",{children:"There are no network allocations in this project."}),e.jsx("p",{children:e.jsx(b,{docPath:"/howto/network_ipam/",hasExternalIcon:!0,children:"Learn more about network allocations"})})]})]})]})};export{B as default};
Copyright ©2k19 -
Hexid
|
Tex7ure