/
snap
/
lxd
/
35210
/
share
/
lxd-ui
/
assets
/
File Upload :
llllll
Current File: //snap/lxd/35210/share/lxd-ui/assets/NetworkIPAM-CgcApKRP.js
import{n as h,d as s,o as k,z as f,r as x,j as e,aX as N,R as b,e as I,q as l}from"./index-dL2n30-Z.js";import{H as g}from"./HelpLink-C3KAssP1.js";import{P as c}from"./PageHeader-5dI4zJHr.js";import{e as U}from"./networks-DWdMsnuF.js";import{U as C}from"./UsedByItem-Ber64JUd.js";import{S as R}from"./ScrollableTable-CQDmfMtz.js";const P=()=>{const p=h(),y=s.useNotify(),{project:n}=k(),{data:o=[],error:a,isLoading:m}=f({queryKey:[l.projects,n,l.networkAllocations],queryFn:async()=>U(n??"default")});if(x.useEffect(()=>{a&&y.failure("Loading network allocations failed",a)},[a]),!n)return e.jsx(e.Fragment,{children:"Missing project"});const u=[{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"}],w=o.map(t=>{var i;const d=N(t.type,[t.used_by]),j=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(C,{item:d[0],activeProject:n,type:t.type,to:j(d[0])}):t.used_by}),role:"rowheader",className:"usedBy"},{content:t.addresses,role:"cell",className:"address"},{content:e.jsx(b,{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:(i=t.network)==null?void 0:i.toLowerCase()}}});return m?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(g,{href:`${p}/howto/network_ipam/`,title:"Learn more about IPAM",children:"IP Address Management"})})})}),children:[e.jsx(I,{}),e.jsxs(s.Row,{children:[o.length>0&&e.jsx(R,{dependencies:o,tableId:"network-ipam-table",belowIds:["status-bar"],children:e.jsx(s.MainTable,{className:"network-ipam-table",id:"network-ipam-table",headers:u,rows:w,responsive:!0,sortable:!0,emptyStateMsg:"No data to display"})}),!m&&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.jsxs("a",{href:`${p}/howto/network_ipam/`,target:"_blank",rel:"noopener noreferrer",children:["Learn more about network allocations",e.jsx(s.Icon,{className:"external-link-icon",name:"external-link"})]})})]})]})]})};export{P as default};
Copyright ©2k19 -
Hexid
|
Tex7ure