import{u as n,_ as m,o as l,c,w as e,b as s,E as h,d as u,t as d,H as T,L as f,D as w,W as p}from"./index-09e73aa7.js";import{u as S}from"./common-9810ee4a.js";import{_}from"./_plugin-vue_export-helper-c27b6911.js";const g={name:"WaitingForRestart",setup(){const{t:i}=n();return{t:i}},data(){return{visible:!1,startTime:-1,newStartTime:-1,status:"",cnt:0}},methods:{async check(){this.newStartTime=-1,this.startTime=S().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.t("core.common.restart.maxRetriesReached")),this.cnt=0,setTimeout(()=>{this.visible=!1},1e3))},async checkStartTime(){let t=(await m.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 V(i,t,x,r,a,b){return l(),c(p,{modelValue:a.visible,"onUpdate:modelValue":t[0]||(t[0]=o=>a.visible=o),persistent:"","max-width":"400"},{default:e(()=>[s(w,null,{default:e(()=>[s(h,null,{default:e(()=>[u(d(r.t("core.common.restart.waiting")),1)]),_:1}),s(T,null,{default:e(()=>[s(f,{indeterminate:"",color:"primary"})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const I=_(g,[["render",V]]);export{I as W};
