import{_ as b,i as h,q as w,c as y,d as k,f as s,w as r,g as o,P as v,F as x,aJ as L,aK as V,K as d}from"./index-CGyEz3rP.js";import{C as N}from"./index-CthiqK4N.js";import"./index-C4PqAdLn.js";import{P}from"./index-bP_OKiIY.js";import{C as T}from"./index-DnJQOoBl.js";const U={__name:"index",setup(F){const l=h.global.t;let t=w({show:!1,niList:[],selectedValues:[],loading:!0}),u;const f=()=>{t.show=!1;const n=t.selectedValues[0];p(n)},m=()=>{t.show=!1};async function p(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{t.loading=!0;const{data:n}=await L();t.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{t.loading=!1}}return g(),(n,e)=>{const a=T,_=P,C=v,i=N;return k(),y(x,null,[s(i,null,{default:r(()=>[s(a,{"is-link":"",title:o(l)("toolsCenter.cameraTransfer"),onClick:e[0]||(e[0]=c=>o(t).show=!0),label:o(l)("toolsCenter.cameraTransferLabel"),icon:"exchange"},null,8,["title","label"]),s(C,{show:o(t).show,"onUpdate:show":e[2]||(e[2]=c=>o(t).show=c),"destroy-on-close":"",round:"",position:"bottom"},{default:r(()=>[s(_,{"show-toolbar":"",title:o(l)("toolsCenter.selectTransferNic"),columns:o(t).niList,loading:o(t).loading,modelValue:o(t).selectedValues,"onUpdate:modelValue":e[1]||(e[1]=c=>o(t).selectedValues=c),onConfirm:f,onCancel:m},null,8,["title","columns","loading","modelValue"])]),_:1},8,["show"])]),_:1}),s(i,null,{default:r(()=>[s(a,{"is-link":"",title:o(l)("toolsCenter.logPackaging"),label:o(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:o(l)("toolsCenter.versionUpdate"),label:o(l)("toolsCenter.versionUpdateLabel"),icon:"description-o",to:"/tools/upgrade"},null,8,["title","label"])]),_:1}),s(i,null,{default:r(()=>[s(a,{"is-link":"",title:"空间清理",label:"清理感知主机硬盘空间",icon:"brush-o",to:"/tools/clear"})]),_:1})],64)}}},q=b(U,[["__scopeId","data-v-9a73afa6"]]);export{q as default};
