import{aa as e,l as a,a4 as t,$ as s,ac as l,A as r,a7 as o,z as i,x as n,a2 as d}from"./utils-lib.js?v=20260328163632";import{B as u}from"./index91.js?v=20260328163632";import{i as c,C as m}from"./wsl.js?v=20260328163632";import{u as v}from"./index92.js?v=20260328163632";import{u as p,d as y,a as f}from"./index50.js?v=20260328163632";import{r as k,O as b,k as h,w as g,o as _,J as w,V as j,_ as x,a3 as A,Y as C,N as I}from"./base-lib.js?v=20260328163632";const{sid:N}=p(),O=k(!1),R=k([]),P=e=>e.Id,L=k({columns:[e(),{title:a("网络名"),key:"Name"},{title:a("驱动名"),key:"Driver"},{title:a("ipv4网络号"),key:"IPv4Address",render:e=>{var a,t,s;return(null==(s=null==(t=null==(a=null==e?void 0:e.IPAM)?void 0:a.Config)?void 0:t[0])?void 0:s.Subnet)||"--"}},{title:a("ipv4网关"),key:"IPv4Gateway",render:e=>{var a,t,s;return(null==(s=null==(t=null==(a=null==e?void 0:e.IPAM)?void 0:a.Config)?void 0:t[0])?void 0:s.Gateway)||"--"}},{title:a("标签"),key:"Labels",minWidth:100,render:e=>{if(!Object.keys(e.Labels).length)return"--";return(Object.entries(e.Labels)||[]).map((e=>"".concat(e[0],":").concat(e[1]))).join(", ")}},{title:a("创建时间"),key:"Created",render:e=>y(e.Created)},t([{render:e=>"bridge"===e.Name||"host"===e.Name||"none"===e.Name?a("不可操作"):b("span",{class:"bt-link",onClick:()=>(async e=>{await i({title:a("删除网络【{0}】",[e.Name]),content:a("您真的要删除网络【{0}】吗？",[e.Name]),type:"calc"}),n({loading:a("正在删除网络，请稍后..."),request:c({network_id:e.Id,sid:N.value}),message:!0,success:z})})(e)},[a("删除")])}])],data:[]}),[B,M]=s(L),{BtOperation:S}=v({options:[{active:!0,label:a("创建网络"),onClick:()=>{r({title:a("创建网络"),area:500,showFooter:!0,component:()=>o((()=>import("./index231.js?v=20260328163632")),[],import.meta.url)})}}]}),{BtBatch:q}=l({tableRef:M,checkedRowKeys:R,options:[{label:a("删除网络"),value:"delete",event:f}]}),z=()=>{n({loading:O,request:m({sid:N.value}),success:e=>{L.value.data=Array.isArray(e.data)?e.data:[]}})},D=()=>{E(),z()},E=()=>{L.value.data=[]},G=h({__name:"index",setup(e,{expose:a}){const{isRefreshList:t}=p();return g((()=>t.value),(e=>{e&&(z(),t.value=!1)})),_(D),w(E),a({init:D}),(e,a)=>(j(),x(C(d),null,{"header-left":A((()=>[b(C(S),{class:"gap-10px"})])),"header-right":A((()=>[b(C(u),{onRefresh:C(z)},null,8,["onRefresh"])])),content:A((()=>[b(C(B),{"checked-row-keys":C(R),"onUpdate:checkedRowKeys":a[0]||(a[0]=e=>I(R)?R.value=e:null),"row-key":C(P),loading:C(O)},null,8,["checked-row-keys","row-key","loading"])])),"footer-left":A((()=>[b(C(q))])),"footer-right":A((()=>a[1]||(a[1]=[]))),_:1}))}}),K=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"}));export{z as g,K as i};
