import{M as a,l as s,x as e,a4 as l,$ as t,z as r,a2 as i,_ as n}from"./utils-lib.js?v=20260328163632";import{B as o}from"./index91.js?v=20260328163632";import{u as d}from"./index50.js?v=20260328163632";import{a2 as u,a3 as c,a4 as m,C as v}from"./wsl.js?v=20260328163632";import{r as p,k as _,o as y,J as f,V as j,_ as k,a3 as I,O as h,Y as x,N as A,j as g,Z as w}from"./base-lib.js?v=20260328163632";import{n as b,B as C}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index97.js?v=20260328163632";const{sid:q,rowData:P}=d(),M=p(!1),N=p(null),B=p([]),D=async()=>{if(!N.value)return a.error(s("请选择网络"));e({loading:s("正在加入网络，请稍后..."),request:u({container_id:P.value.Id,network_id:N.value,sid:q.value}),message:!0,success:async a=>{a.status&&(N.value="",H())}})},R=p({columns:[{title:s("IP地址"),key:"IPAddress"},{title:s("网关"),key:"Gateway"},{title:s("MAC地址"),key:"MacAddress"},l([{title:s("退出网络"),onClick:async a=>{await r({title:s("退出网络【{0}】",[a.IPAddress]),content:s("您真的要退出网络【{0}】吗？",[a.IPAddress])}),e({request:m({container_id:P.value.Id,network_id:a.NetworkID,sid:q.value}),message:!0,success:async a=>{a.status&&H()}})}}])],data:[]}),[z,G]=t(R),H=()=>{e({loading:M,request:c({container_id:P.value.Id,sid:q.value}),success:a=>{R.value.data=Array.isArray(a.data)?a.data:[]}})},J=()=>{H(),(async()=>{e({request:v({sid:q.value}),success:a=>{var s;B.value=Array.isArray(a.data)?null==(s=a.data)?void 0:s.map((a=>({label:a.Name,value:a.Id}))):[]}})})()},O=()=>{N.value=null,M.value=!1,R.value.data=[]},U=n(_({__name:"index",setup:a=>(y(J),f(O),(a,e)=>{const l=b,t=C;return j(),k(x(i),null,{"header-left":I((()=>[h(l,{value:x(N),"onUpdate:value":e[0]||(e[0]=a=>A(N)?N.value=a:null),options:x(B),placeholder:x(s)("请选择网络"),class:"!w-[200px]"},null,8,["value","options","placeholder"]),h(t,{class:"!ml-[10px]",type:"primary",onClick:x(D)},{default:I((()=>[g(w(x(s)("加入网络")),1)])),_:1},8,["onClick"])])),"header-right":I((()=>[h(x(o),{onRefresh:x(H)},null,8,["onRefresh"])])),content:I((()=>[h(x(z),{loading:x(M),"max-height":500},null,8,["loading"])])),_:1})})}),[["__scopeId","data-v-44efee9e"]]);export{U as default};
