import{an as a,V as e,P as t,M as l,p as s,B as n,j as u,$ as i,_ as o}from"./utils-lib.js?v=1761009159";import{c as r,r as m,e as d,v as p,x as c,y as _,B as v,z as f,Q as b,C as g,A as j,bO as y,bN as h,G as w}from"./base-lib.js?v=1761009159";import{_ as k}from"./index119.js?v=1761009159";import{ar as V,as as x,at as q,au as C}from"./config.js?v=1761009159";import{u as B}from"./column.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const z={class:"p-2rem"},H={class:"p-[2rem]"},I={class:"p-[2rem]"},P={class:"flex justify-end mt-[1rem]"},U=o(r({__name:"migrate-history",setup(o){const r=m(!1),U=m(""),A=m(!1),G=m({}),M=m({}),N=async a=>{const e=await t({loading:"正在获取迁移日志，请稍后...",request:V({timestamp:M.value.timestamp})});U.value=e.data.data,a&&l.success("日志刷新成功")},O=()=>{n({value:"目标服务器信息：".concat(G.value.panel_info.panel_url,"\n登录账号：").concat(G.value.panel_info.username,"\n登录密码：").concat(G.value.panel_info.password)})},{BtTable:Q,refresh:R}=a({request:async()=>{const a=await t({loading:"正在获取迁移历史，请稍后...",request:x()});return{data:a.data,total:a.data.length}},columns:[{label:"迁移时间",render:a=>d("span",null,[e(a.timestamp)])},{label:"服务器IP",prop:"migrate_ip"},B([{title:"日志",onClick:a=>{r.value=!0,M.value=a,N()}},{title:"信息",onClick:a=>{A.value=!0,M.value=a,(async()=>{const{data:a}=await t({loading:"正在获取迁移详情，请稍后...",request:q({timestamp:M.value.timestamp})});G.value.name=a.data.task_info.task_name,G.value.ip=a.data.server_ip,G.value.user=a.data.ssh_user,G.value.pass=a.data.password,G.value.start_time=a.data.start_time,G.value.last_update=a.data.last_update,G.value.panel_info=a.data.task_info.panel_info})()}},{title:"删除",onClick:a=>{M.value=a,(async()=>{await s({title:"删除迁移历史",content:"是否删除迁移历史？",type:"calc"}),await t({loading:"正在删除迁移历史，请稍后...",request:C({timestamp:M.value.timestamp}),message:!0}),R()})()}}])]});return(a,e)=>{const t=k,l=u,s=y,n=h,o=w,m=i;return p(),c("div",z,[d(_(Q),{"max-height":400}),d(l,{modelValue:_(r),"onUpdate:modelValue":e[0]||(e[0]=a=>b(r)?r.value=a:null),area:54,title:"【".concat(_(M).migrate_ip,"】迁移日志")},{default:v(()=>[f("div",H,[d(t,{content:_(U),isHtml:!0,"full-screen":{title:"全屏查看服务日志",onRefresh:()=>N(!0)},class:"h-41rem"},null,8,["content","full-screen"])])]),_:1},8,["modelValue","title"]),d(l,{modelValue:_(A),"onUpdate:modelValue":e[1]||(e[1]=a=>b(A)?A.value=a:null),area:48,title:"详情信息"},{default:v(()=>[f("div",I,[d(n,{title:!1,column:1,size:"small",border:"",class:"table-descriptions"},{default:v(()=>[d(s,{label:"名称："},{default:v(()=>[g(j(_(G).name),1)]),_:1}),d(s,{label:"服务器："},{default:v(()=>{var a;return[g(j((null==(a=_(G).panel_info)?void 0:a.panel_url)||"--"),1)]}),_:1}),d(s,{label:"用户："},{default:v(()=>{var a;return[g(j((null==(a=_(G).panel_info)?void 0:a.username)||"--"),1)]}),_:1}),d(s,{label:"密码："},{default:v(()=>{var a;return[g(j((null==(a=_(G).panel_info)?void 0:a.password)||"--"),1)]}),_:1}),d(s,{label:"开始时间："},{default:v(()=>[g(j(_(G).start_time),1)]),_:1}),d(s,{label:"最后更新时间："},{default:v(()=>[g(j(_(G).last_update),1)]),_:1})]),_:1}),f("div",P,[d(o,{type:"default",onClick:O},{default:v(()=>e[2]||(e[2]=[g("复制服务器信息",-1)])),_:1,__:[2]})]),d(m,{options:[{content:"迁移进度请在新服务器中的[面板设置] - [备份还原]中查看"}],class:"mt-[1rem]"})])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-0ccb0b48"]]);export{U as default};
