import{_ as b,i as h,q as w,c as y,d as k,f as s,w as r,g as t,P as v,F as L,aJ as x,aK as V,K as d}from"./index-ojdwC1S2.js";import{C as N}from"./index-C7fHbZKd.js";import"./index-SLHq6L4P.js";import{P}from"./index-B4IFiRFq.js";import{C as T}from"./index-DA2qx-GP.js";const U={__name:"index",setup(F){const l=h.global.t;let o=w({show:!1,niList:[],selectedValues:[],loading:!0}),u;const f=()=>{o.show=!1;const n=o.selectedValues[0];m(n)},p=()=>{o.show=!1};async function m(n){try{const{code:e,message:a}=await V({ni:n});e===200?u=d({type:"success",message:l("toolsCenter.transferSuccess"),className:"bottom-notify",position:"bottom"}):u=d({type:"danger",message:a||l("toolsCenter.transferFailed"),className:"bottom-notify",position:"bottom"})}catch(e){console.error(l("toolsCenter.transferError"),e)}}async function g(){try{o.loading=!0;const{data:n}=await x();o.niList=n.filter(e=>e[1]&&!e[0].startsWith("br")&&!e[0].startsWith("veth")).map(e=>({text:`${e[0]} —— ${e[1]}`,value:e[0]}))}catch(n){console.log("error",n)}finally{o.loading=!1}}return g(),(n,e)=>{const a=T,C=P,_=v,i=N;return k(),y(L,null,[s(i,null,{default:r(()=>[s(a,{"is-link":"",title:t(l)("toolsCenter.cameraTransfer"),onClick:e[0]||(e[0]=c=>t(o).show=!0),label:t(l)("toolsCenter.cameraTransferLabel"),icon:"exchange"},null,8,["title","label"]),s(_,{show:t(o).show,"onUpdate:show":e[2]||(e[2]=c=>t(o).show=c),"destroy-on-close":"",round:"",position:"bottom"},{default:r(()=>[s(C,{"show-toolbar":"",title:t(l)("toolsCenter.selectTransferNic"),columns:t(o).niList,loading:t(o).loading,modelValue:t(o).selectedValues,"onUpdate:modelValue":e[1]||(e[1]=c=>t(o).selectedValues=c),onConfirm:f,onCancel:p},null,8,["title","columns","loading","modelValue"])]),_:1},8,["show"])]),_:1}),s(i,null,{default:r(()=>[s(a,{"is-link":"",title:t(l)("toolsCenter.logPackaging"),label:t(l)("toolsCenter.logPackagingLabel"),icon:"send-gift-o",to:"/tools/log"},null,8,["title","label"])]),_:1}),s(i,null,{default:r(()=>[s(a,{"is-link":"",title:t(l)("toolsCenter.versionUpdate"),label:t(l)("toolsCenter.versionUpdateLabel"),icon:"description-o",to:"/tools/upgrade"},null,8,["title","label"])]),_:1}),s(i,null,{default:r(()=>[s(a,{"is-link":"",title:t(l)("toolsCenter.spaceClear"),label:t(l)("toolsCenter.spaceClearLabel"),icon:"brush-o",to:"/tools/clear"},null,8,["title","label"])]),_:1})],64)}}},q=b(U,[["__scopeId","data-v-23809bad"]]);export{q as default};
