Server IP : 13.213.54.232 / Your IP : 216.73.216.72 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-172-31-17-110 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.1.33-67+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /snap/lxd/current/share/lxd-ui/assets/ |
Upload File : |
import{l as y,e as j,d as t,m as x,j as e,f as N,c as b,B as f,H as w,b as L,L as k,q as K}from"./index-13b2882d.js";import{f as B}from"./networks-5caac489.js";const $=()=>{const r=y(),o=j(),p=t.useNotify(),{project:s}=x();if(!s)return e.jsx(e.Fragment,{children:"Missing project"});const{data:i=[],error:l,isLoading:c}=N({queryKey:[K.networks,s],queryFn:()=>B(s)});l&&p.failure("Loading networks failed",l);const n=i.length>0,g=[{content:"Name",sortKey:"name"},{content:"Type",sortKey:"type"},{content:"Managed",sortKey:"managed"},{content:"IPV4",className:"u-align--right"},{content:"IPV6"},{content:"Description",sortKey:"description"},{content:"Used by",sortKey:"usedBy",className:"u-align--right"},{content:"State",sortKey:"state"},{"aria-label":"Actions",className:"u-align--right"}],h=i.map(a=>{var d,m,u;return{columns:[{content:e.jsx(b,{to:`/ui/project/${s}/networks/detail/${a.name}`,children:a.name}),role:"rowheader","aria-label":"Name"},{content:a.type,role:"rowheader","aria-label":"Type"},{content:a.managed?"Yes":"No",role:"rowheader","aria-label":"Managed"},{content:a.config["ipv4.address"],className:"u-align--right",role:"rowheader","aria-label":"IPV4"},{content:a.config["ipv6.address"],role:"rowheader","aria-label":"IPV6"},{content:a.description,role:"rowheader","aria-label":"Description"},{content:((d=a.used_by)==null?void 0:d.length)??"0",role:"rowheader",className:"u-align--right","aria-label":"Used by"},{content:a.status,role:"rowheader","aria-label":"State"},{content:e.jsx(e.Fragment,{}),role:"rowheader",className:"u-align--right","aria-label":"Actions"}],sortData:{name:a.name.toLowerCase(),type:a.type,managed:a.managed,description:(m=a.description)==null?void 0:m.toLowerCase(),state:a.status,usedBy:((u=a.used_by)==null?void 0:u.length)??0}}});return e.jsx(e.Fragment,{children:e.jsxs(f,{title:e.jsx(w,{href:`${r}/explanation/networks/`,title:"Learn more about networking",children:"Networks"}),controls:e.jsxs(e.Fragment,{children:[n&&e.jsx(t.Button,{className:"u-no-margin--bottom",onClick:()=>o(`/ui/project/${s}/networks/map`),children:"See map"}),e.jsx(t.Button,{appearance:"positive",className:"u-no-margin--bottom",onClick:()=>o(`/ui/project/${s}/networks/create`),children:"Create network"})]}),children:[e.jsx(L,{}),e.jsxs(t.Row,{children:[n&&e.jsx(t.MainTable,{headers:g,rows:h,paginate:30,responsive:!0,sortable:!0,className:"u-table-layout--auto",emptyStateMsg:c?e.jsx(k,{text:"Loading networks..."}):"No data to display"}),!c&&!n&&e.jsxs(t.EmptyState,{className:"empty-state",image:e.jsx(t.Icon,{className:"empty-state-icon",name:"connected"}),title:"No networks found",children:[e.jsx("p",{children:"There are no networks in this project."}),e.jsx("p",{children:e.jsxs("a",{href:`${r}/explanation/networks/`,target:"_blank",rel:"noreferrer",children:["Learn more about networks",e.jsx(t.Icon,{className:"external-link-icon",name:"external-link"})]})})]})]})]})})};export{$ as default};