import{l as o,o as n,c as l,w as e,b as s,G as m,e as c,H as h,L as u,E as T,W as d}from"./index-4f532da6.js";import{u as f}from"./common-d4d7cfa6.js";import{_ as w}from"./_plugin-vue_export-helper-c27b6911.js";const p={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 S(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(p,[["render",S]]);export{k as W};
