import{_ as e}from"./index105.js?v=1761009159";import{b as t,N as a}from"./useMethods.js?v=1761009159";import{aP as s,ap as i,P as l,ck as n,p as o,cl as r,n as c,Q as m,cm as u,u as p,b2 as d,an as h,V as v,_ as b}from"./utils-lib.js?v=1761009159";import{c as f,a as y,u as w}from"./column.js?v=1761009159";import{o as _,r as g,c as C,w as j,aD as k,q as x,a6 as R,v as W,x as B,e as O,B as T,z as N,y as q}from"./base-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const{refs:{customLimit:L,isRefreshNetworkList:P}}=s(),A=_({isRefresh:!0}),D=g([]),E=[{active:!0,label:"添加网络",type:"button",onClick:()=>{c({component:()=>m(()=>import("./index228.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),title:"添加网络",area:58,btn:"添加"})}},{active:!1,label:"清理网络",type:"button",onClick:async()=>{try{await o({type:"calc",title:"清理网络",width:"35rem",content:"您真的要清理未使用的网络吗？"}),l({request:u(),message:!0,loading:"正在清理",success:()=>{P.value=!0}})}catch(e){}}}],H=async e=>{try{await o({type:"calc",title:"删除网络【".concat(e.name,"】"),width:"35rem",content:"您真的要删除网络【".concat(e.name,"】吗？")});const t={id:e.id};l({request:r({data:JSON.stringify(t)}),message:!0,success:()=>{P.value=!0}})}catch(t){}},I=i([{label:"删除项目",value:"delete",event:async(e,t,a,s)=>{const{label:i,value:l}=s,n=async(e,t)=>{const{id:a}=e;if("delete"===l){const e={id:a};return await r({data:JSON.stringify(e)})}};await e({title:"批量".concat(i,"网络"),content:"批量".concat(i,"已选的网络，是否继续操作！"),column:[{label:"网络名",prop:"name"},f()],onConfirm:async()=>(await t(n),P.value=!0,!1)})}}]),J=(e,t)=>{setTimeout(()=>{L.value.network||((e,t)=>{setTimeout(()=>{e.value>900?t.value.limit=20:t.value.limit=10},0)})(e,t)},0)},S={class:"relative container-table-tab"},V={class:"flex items-center"},z=b(C({__name:"index",setup(i){const{refs:{isRefreshNetworkList:o}}=s(),{mainHeight:r}=p(),{BtOperation:c}=d({options:E});j(()=>o.value,e=>{o.value&&(A.isRefresh=!0,_())});const{BtTable:m,BtPage:u,BtBatch:b,BtColumn:f,refresh:_,param:g}=h({request:e=>(async e=>{if(P.value=!1,!A.isRefresh)return{data:t({limit:e.limit,list:D.value,p:e.p})||[],total:D.value.length};A.isRefresh=!1;const a=await l({request:n(),data:Array});return D.value=a,{data:t({limit:e.limit,list:D.value,p:e.p})||[],total:D.value.length}})(e),columns:[y(),{label:"网络名",prop:"name",showOverflowTooltip:!0,minWidth:100},{label:"设备",prop:"driver",minWidth:100,isCustom:!0},{label:"ipv4网络号",prop:"subnet",minWidth:100,isCustom:!0},{label:"ipv4网关",prop:"gateway",minWidth:100,isCustom:!0},{label:"ipv6网络号",prop:"subnetv6",minWidth:100,isCustom:!1},{label:"ipv6网关",prop:"gatewayv6",minWidth:100,isCustom:!1},{label:"标签",prop:"labels",minWidth:100,showOverflowTooltip:!0,isCustom:!0,render:e=>{if(!e.labels)return k("span","");return(Object.entries(e.labels)||[]).map(e=>"".concat(e[0],":").concat(e[1])).join(",")}},{label:"创建时间",prop:"time",minWidth:100,isCustom:!0,render:e=>v(e.time)},w([{onClick:H,title:"删除"}])],extension:[I]});return x(async()=>{J(r,g)}),R(()=>{A.isRefresh=!0,D.value=[]}),(t,s)=>{const i=e;return W(),B("div",S,[O(i,null,{"header-left":T(()=>[N("div",V,[O(q(c)),N("a",{class:"ml-[1rem] bt-link",onClick:s[0]||(s[0]=e=>q(a)())},"需求反馈")])]),"header-right":T(()=>[O(q(f))]),content:T(()=>[O(q(m),{key:"NetTable","max-height":q(r)-220},null,8,["max-height"])]),"footer-left":T(()=>[O(q(b))]),"footer-right":T(()=>[O(q(u))]),popup:T(()=>s[1]||(s[1]=[])),_:1})])}}}),[["__scopeId","data-v-803a50f2"]]);export{z as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
