import{_ as t}from"./index119.js?v=1761009159";import{c as s,r as e,q as a,a6 as l,v as i,x as r,e as o,B as n,F as u,b0 as m,y as c,N as d,cb as p,cc as v,z as f}from"./base-lib.js?v=1761009159";import{jr as x,M as _,_ as g}from"./utils-lib.js?v=1761009159";import{u as j}from"./index63.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index105.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";import"./useController6.js?v=1761009159";import"./site.js?v=1761009159";import"./validator.js?v=1761009159";import"./useStore4.js?v=1761009159";const b={class:"p-[2rem] master-redis-create-log"},k=g(s({__name:"redis-create-log",props:{compData:{default:()=>({task_id:""})}},setup(s){const{isRedisRefreshList:g}=j(),k=s,w=e(""),h=["配置主Redis节点","配置从Redis节点","验证复制状态","主从配置完成"],y=e(h.map(t=>({name:t,status:"wait"}))),D=e(0);let R=null;const I={wait:()=>o("span",{class:"svgtofont-el-more-filled text-disabled mr-2px !text-large"},null),completed:()=>o("span",{class:"svgtofont-el-circle-check text-primary mr-2px !text-large"},null),failed:()=>o("span",{class:"svgtofont-el-circle-close text-dangerDark mr-2px !text-large"},null),running:()=>o("span",{class:"svgtofont-el-loading animate-spin text-supplement mr-2px !text-large"},null)},T={wait:"",completed:"完成",failed:"失败",running:"进行中"},H=async()=>{if(!k.compData.task_id)return;const{data:t}=await x({task_id:k.compData.task_id});if(!t.status)return void _.error(t.msg);const s=t.data;var e;w.value=s.logs||"",e=s.steps||[],y.value=h.map((t,s)=>{const a=e[s];return{name:t,status:(null==a?void 0:a.status)||"wait",start_time:null==a?void 0:a.start_time,completed_time:null==a?void 0:a.completed_time,updated_time:null==a?void 0:a.updated_time}});const a=y.value.findIndex(t=>"running"===t.status),l=y.value.map(t=>t.status).lastIndexOf("completed");D.value=-1!==a?a:-1!==l?l:0;const i=y.value.some(t=>"failed"===t.status);"completed"===s.status||"failed"===s.status||i?R&&(clearTimeout(R),g.value=!0,R=null):R=setTimeout(H,2e3)};return a(()=>{H()}),l(()=>{w.value="",R&&(clearTimeout(R),R=null)}),(s,e)=>{const a=t;return i(),r("div",b,[o(c(v),{direction:"vertical",space:"4rem",active:c(D)},{default:n(()=>[(i(!0),r(u,null,m(c(y),(t,s)=>{var e;return i(),d(c(p),{key:s,title:t.name,icon:I[t.status]?I[t.status]():I.wait(),description:null!=(e=T[t.status])?e:"",status:"completed"===t.status?"success":"running"===t.status?"process":"failed"===t.status?"error":"wait"},null,8,["title","icon","description","status"])}),128))]),_:1},8,["active"]),e[0]||(e[0]=f("h3",{class:"text-base mb-[1rem] mt-[1rem] color-[#666]"},"实时日志",-1)),o(a,{content:c(w),isHtml:!0,autoScroll:!0,style:{height:"14rem"}},null,8,["content"])])}}}),[["__scopeId","data-v-8388a2bd"]]);export{k as default};
