import{_ as a}from"./index.js?v=1763625242172";import{p as t,_ as e,fh as s,fi as o,fj as n,fk as r,m as i,P as d,aV as l}from"./page_layout.js?v=1763625242172";import{a as m}from"./public.js?v=1763625242172";import{k as p,R as x,S as c,U as _,a4 as y,H as u,P as f,r as v,X as H,F as R,O as w,a2 as j,V as T,a3 as h,j as C,aj as k}from"./vue.js?v=1763625242172";import{aC as b}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const g=t(p({__name:"info",props:{data:{}},setup:a=>(a,t)=>(x(),c("div",{class:u(["info",a.data.type])},[t[0]||(t[0]=_("div",{class:"mark"},null,-1)),_("div",null,y("start"===a.data.type?a.data.startText:a.data.loadText+"..."),1)],2))}),[["__scopeId","data-v-186f04ad"]]),$={class:"w-466px p-16px text-[#555]"},I={class:"flex items-center text-error"},P={class:"ml-8px leading-17px"},S={class:"my-10px leading-26px"},U={class:"safe-restart"},V=t(p({__name:"index",emits:["setConfirm"],setup(a,{expose:t,emit:l}){const m=l,{t:p}=f(),u=v([{type:"start",startText:p("Home.Restart.index_7"),loadText:p("Home.Restart.index_8")},{type:"start",startText:p("Home.Restart.index_9"),loadText:p("Home.Restart.index_10")},{type:"start",startText:p("Home.Restart.index_11"),loadText:p("Home.Restart.index_11")},{type:"start",startText:p("Home.Restart.index_12"),loadText:p("Home.Restart.index_12")}]),h=()=>{setTimeout((async()=>{try{await r(),i.success(p("Home.Restart.index_13")),d()}catch(a){h()}}),1e3)};return t({onConfirm:async()=>{m("setConfirm",{loading:!0,disabled:!0});try{await(async()=>{u.value[0].type="load",await s(),u.value[0].type="done"})(),await(async()=>{u.value[1].type="load",await o(),u.value[1].type="done"})(),await(async()=>{u.value[2].type="load",await n(),u.value[2].type="done"})(),await(async()=>{u.value[3].type="load";try{await r()}finally{u.value[3].type="done"}})(),h()}catch(a){u.value.forEach((a=>{a.type="start"})),m("setConfirm",{loading:!1,disabled:!1})}}}),(a,t)=>{const s=e;return x(),c("div",$,[_("div",I,[H(s,{name:"common-ask",size:"17"}),_("span",P,y(a.$t("Home.Restart.index_5")),1)]),_("div",S,y(a.$t("Home.Restart.index_6")),1),_("div",U,[(x(!0),c(R,null,w(T(u),(a=>(x(),j(g,{key:a.startText,data:a},null,8,["data"])))),128))])])}}}),[["__scopeId","data-v-61b30d8c"]]),z={class:"flex items-center justify-center h-110px px-30px"},E=t(p({__name:"index",setup(t){const{t:e}=f(),s=v(!1),o=()=>{s.value=!0},n=()=>{m({title:e("Home.Restart.index_3"),content:e("Home.Restart.index_4"),onConfirm:async()=>{await l(!0),d(3e3)}})};return(t,e)=>{const r=b,i=a;return x(),c("div",z,[H(r,{type:"primary",onClick:o},{default:h((()=>[C(y(t.$t("Home.Restart.index_1")),1)])),_:1}),H(r,{type:"primary",class:"ml-32px",onClick:n},{default:h((()=>[C(y(t.$t("Home.Restart.index_2")),1)])),_:1}),H(i,{show:T(s),"onUpdate:show":e[0]||(e[0]=a=>k(s)?s.value=a:null),title:"Safely reboot server",footer:!0,component:V},null,8,["show"])])}}}),[["__scopeId","data-v-d341a5a3"]]);export{E as default};
