import{y as o,o as n,c as l,w as e,b as s,D as m,e as c,E as h,aa as u,C as T,S as d}from"./index-73815609.js";import{u as f}from"./common-382ac853.js";import{_ as w}from"./_plugin-vue_export-helper-c27b6911.js";const S={name:"WaitingForRestart",data(){return{visible:!1,startTime:-1,newStartTime:-1,status:"",cnt:0}},methods:{async check(){this.newStartTime=-1,this.startTime=f().getStartTime(),this.visible=!0,this.status="",console.log("start wfr"),setTimeout(()=>{this.timeoutInternal()},1e3)},timeoutInternal(){console.log("wfr: timeoutInternal",this.newStartTime,this.startTime),this.newStartTime===-1&&this.cnt<60&&this.visible?(this.checkStartTime(),this.cnt++,setTimeout(()=>{this.timeoutInternal()},1e3)):(this.cnt==10&&(this.status="拉取状态达到最大次数，请手动检查。"),this.cnt=0,setTimeout(()=>{this.visible=!1},1e3))},async checkStartTime(){let t=(await o.get("/api/stat/start-time",{timeout:3e3})).data.data.start_time;return console.log("wfr: checkStartTime",this.newStartTime,this.startTime),this.newStartTime!==this.startTime&&(this.newStartTime=t,console.log("wfr: restarted"),this.visible=!1,window.location.reload()),this.newStartTime}}};function p(a,t,_,g,i,V){return n(),l(d,{modelValue:i.visible,"onUpdate:modelValue":t[0]||(t[0]=r=>i.visible=r),persistent:"","max-width":"400"},{default:e(()=>[s(T,null,{default:e(()=>[s(m,null,{default:e(()=>[c("正在等待 AstrBot 重启...")]),_:1}),s(h,null,{default:e(()=>[s(u,{indeterminate:"",color:"primary"})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const k=w(S,[["render",p]]);export{k as W};
