import{_ as R}from"./WhiteButton.vue_vue_type_script_setup_true_lang-DlfUhvlb.js";import{r as i,A as I,J as V,l as x,D as M,o as O,c as U,a as e,n as r,t as g,K as l,at as d,b as B,w as E,f as P}from"./index-Bb2UEb_P.js";import{u as j}from"./server-KemHlIfj.js";import{_ as N}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./BlueButton.vue_vue_type_script_setup_true_lang-CY8chwQm.js";const T={class:"modal__body"},W={class:"list-item__status"},K={class:"form"},L=["disabled"],$=["disabled"],z=["disabled"],A=["disabled"],J=["disabled"],q={class:"form-input_border"},F={class:"tw-flex tw-justify-center tw-mt-4"},G={__name:"ModalWindowReloadDS",props:{data:{type:Object,default:()=>{}}},emits:["modalClose"],setup(v,{emit:_}){const n=v,c=_,y=j(),o=i(""),S=I("emitter"),u=V(),m=i(n.data?.isReloading||""),D=i(n.data?.DSOrderID||""),C=i(n.data?.OrderID||""),a=i(n.data?.SystemPower);async function p(){m.value=!0,n.data.onReloadStatusChange(!0),await y.ServerReset(D.value,o.value),S.emit("open-modal",{component:"Suspense"}),setTimeout(async()=>{k(),m.value=!1,n.data.onReloadStatusChange(!1),await u.fetchDSOrders(),u.fetchDSOrderIPMI(C.value)},1e4)}function k(){c("modalClose")}const f=b=>{b.key==="Enter"&&p()};return x(()=>{document.addEventListener("keyup",f)}),M(()=>{document.removeEventListener("keyup",f)}),(b,s)=>{const w=R;return O(),U("div",T,[s[15]||(s[15]=e("div",{class:"list-item__title"},"Питание сервера",-1)),e("div",W,[s[7]||(s[7]=e("div",{class:"list-item__status-text"},"Текущий статус",-1)),e("div",{class:r(["server-status",{"server-status-on":a.value==="on","server-status-off":a.value!=="on"}])},g(a.value==="on"?"Включен":"Выключен"),3)]),s[16]||(s[16]=e("div",{class:"list-item__subtitle"},"Выбор команды",-1)),e("form",K,[e("label",{class:r(["form-input_border",{"disabled-label":a.value==="on"}])},[l(e("input",{type:"radio",name:"Command",value:"on","onUpdate:modelValue":s[0]||(s[0]=t=>o.value=t),disabled:a.value==="on"},null,8,L),[[d,o.value]]),s[8]||(s[8]=e("span",{class:"form-input_border-content"},[e("span",{class:"form-input_border-mark"}),e("span",{class:"form-input_border-info"},[e("span",{class:"form-input_border-address"},"Включить")])],-1))],2),e("label",{class:r(["form-input_border",{"disabled-label":a.value!=="on"}])},[l(e("input",{type:"radio",name:"Command",value:"off","onUpdate:modelValue":s[1]||(s[1]=t=>o.value=t),disabled:a.value!=="on"},null,8,$),[[d,o.value]]),s[9]||(s[9]=e("span",{class:"form-input_border-content"},[e("span",{class:"form-input_border-mark"}),e("span",{class:"form-input_border-info"},[e("span",{class:"form-input_border-address"},"Выключить")])],-1))],2),e("label",{class:r(["form-input_border",{"disabled-label":a.value!=="on"}])},[l(e("input",{type:"radio",name:"Command",value:"soft","onUpdate:modelValue":s[2]||(s[2]=t=>o.value=t),disabled:a.value!=="on"},null,8,z),[[d,o.value]]),s[10]||(s[10]=e("span",{class:"form-input_border-content"},[e("span",{class:"form-input_border-mark"}),e("span",{class:"form-input_border-info"},[e("span",{class:"form-input_border-address"},"Корректно выключить")])],-1))],2),e("label",{class:r(["form-input_border",{"disabled-label":a.value!=="on"}])},[l(e("input",{type:"radio",name:"Command",value:"cycle","onUpdate:modelValue":s[3]||(s[3]=t=>o.value=t),disabled:a.value!=="on"},null,8,A),[[d,o.value]]),s[11]||(s[11]=e("span",{class:"form-input_border-content"},[e("span",{class:"form-input_border-mark"}),e("span",{class:"form-input_border-info"},[e("span",{class:"form-input_border-address"},"Выключить/включить")])],-1))],2),e("label",{class:r(["form-input_border",{"disabled-label":a.value!=="on"}])},[l(e("input",{type:"radio",name:"Command",value:"reset","onUpdate:modelValue":s[4]||(s[4]=t=>o.value=t),disabled:a.value!=="on"},null,8,J),[[d,o.value]]),s[12]||(s[12]=e("span",{class:"form-input_border-content"},[e("span",{class:"form-input_border-mark"}),e("span",{class:"form-input_border-info"},[e("span",{class:"form-input_border-address"},"Reset")])],-1))],2),e("label",q,[l(e("input",{type:"radio",name:"Command",value:"mc","onUpdate:modelValue":s[5]||(s[5]=t=>o.value=t)},null,512),[[d,o.value]]),s[13]||(s[13]=e("span",{class:"form-input_border-content"},[e("span",{class:"form-input_border-mark"}),e("span",{class:"form-input_border-info"},[e("span",{class:"form-input_border-address"},"Перезагрузить IPMI")])],-1))])]),e("div",F,[B(w,{onClick:s[6]||(s[6]=t=>p())},{default:E(()=>s[14]||(s[14]=[P("Выполнить",-1)])),_:1,__:[14]})])])}}},h=N(G,[["__scopeId","data-v-fcce7c22"]]);export{h as default};
