import{c as x,l as $,fJ as B,fK as I,fL as L,fM as h,m as M,f as C,x as N,h as P,b6 as V}from"./index-BTglIPU2.js?v=1773287522785";import{k as f,$ as n,Z as _,L as j,_ as o,aa as r,R as S,r as b,a0 as p,F as q,P as z,a8 as E,S as g,a9 as H,j as T,X as F}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{B as W}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const D=f({__name:"info",props:{data:{}},setup(y){return(a,s)=>(n(),_("div",{class:j(["info",a.data.type])},[s[0]||(s[0]=o("div",{class:"mark"},null,-1)),o("div",null,r(a.data.type==="start"?a.data.startText:a.data.loadText+"..."),1)],2))}}),J=x(D,[["__scopeId","data-v-186f04ad"]]),K={class:"w-466px p-16px text-[#555]"},U={class:"flex items-center text-error"},X={class:"ml-8px leading-17px"},Z={class:"my-10px leading-26px"},A={class:"safe-restart"},G=f({__name:"index",emits:["setConfirm"],setup(y,{expose:a,emit:s}){const i=s,{t:e}=S(),t=b([{type:"start",startText:e("Home.Restart.index_7"),loadText:e("Home.Restart.index_8")},{type:"start",startText:e("Home.Restart.index_9"),loadText:e("Home.Restart.index_10")},{type:"start",startText:e("Home.Restart.index_11"),loadText:e("Home.Restart.index_11")},{type:"start",startText:e("Home.Restart.index_12"),loadText:e("Home.Restart.index_12")}]),l=async()=>{t.value[0].type="load",await B(),t.value[0].type="done"},d=async()=>{t.value[1].type="load",await I(),t.value[1].type="done"},m=async()=>{t.value[2].type="load",await L(),t.value[2].type="done"},u=async()=>{t.value[3].type="load";try{await h()}finally{t.value[3].type="done"}},v=()=>{setTimeout(async()=>{try{await h(),M.success(e("Home.Restart.index_13")),C()}catch(c){v()}},1e3)};return a({onConfirm:async()=>{i("setConfirm",{loading:!0,disabled:!0});try{await l(),await d(),await m(),await u(),v()}catch(c){t.value.forEach(R=>{R.type="start"}),i("setConfirm",{loading:!1,disabled:!1})}}}),(c,R)=>{const k=$;return n(),_("div",K,[o("div",U,[p(k,{name:"common-ask",size:"17"}),o("span",X,r(c.$t("Home.Restart.index_5")),1)]),o("div",Z,r(c.$t("Home.Restart.index_6")),1),o("div",A,[(n(!0),_(q,null,z(g(t),w=>(n(),E(J,{key:w.startText,data:w},null,8,["data"]))),128))])])}}}),O=x(G,[["__scopeId","data-v-61b30d8c"]]),Q={class:"flex items-center justify-center h-110px px-30px"},Y=f({__name:"index",setup(y){const{t:a}=S(),s=b(!1),i=()=>{s.value=!0},e=()=>{P({title:a("Home.Restart.index_3"),content:a("Home.Restart.index_4"),onConfirm:async()=>{await V(!0),C(3e3)}})};return(t,l)=>{const d=W,m=N;return n(),_("div",Q,[p(d,{type:"primary",onClick:i},{default:H(()=>[T(r(t.$t("Home.Restart.index_1")),1)]),_:1}),p(d,{type:"primary",class:"ml-32px",onClick:e},{default:H(()=>[T(r(t.$t("Home.Restart.index_2")),1)]),_:1}),p(m,{show:g(s),"onUpdate:show":l[0]||(l[0]=u=>F(s)?s.value=u:null),title:"Safely reboot server",footer:!0,component:O},null,8,["show"])])}}}),nt=x(Y,[["__scopeId","data-v-d341a5a3"]]);export{nt as default};
