import{_ as a}from"./index101.js?v=1753954525509";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{m as t,c as s,_ as l,e as n}from"./page_layout.js?v=1753954525509";import{n as i,b as o,m as r}from"./planned.js?v=1753954525509";import{c,d}from"./public.js?v=1753954525509";import{bA as u,ay as m,c5 as p,cA as _,c1 as v,cI as f,av as g,c3 as b,aV as x,bY as y}from"./naive.js?v=1753954525509";import{k as C,P as j,e as w,r as I,n as P,G as k,U as S,V as h,Q as $,a2 as N,X as A,a1 as J,W as L,a3 as O,al as U,j as V}from"./vue.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const W={class:"p-20px h-500px"},D={class:"color-#20a53a"},E=n(C({__name:"index",props:{data:{}},setup(n){const{t:C}=j(),E=w({active:!1,time:3}),F=n,{id:G,getList:H}=F.data,Q={time:{trigger:["blur","input"],validator:(a,e)=>e<3?(B(),new Error(C("Crontab.Planned.index_91"))):(X&&(q.value=e,Y.value=100,B()),z(),!0)}},R=()=>{d({title:C("Public.Confirm.Title"),content:C("Crontab.Planned.index_26"),onConfirm:async()=>{await i({id:G}),ea()}})},T=a=>{a?(X&&B(),z(),t.success(C("Crontab.Planned.index_92"))):(B(),sessionStorage.setItem("timer".concat(G),JSON.stringify({...E,id:G})),t.success(C("Crontab.Planned.index_93")))};let X;const Y=I(100),q=I(E.time),z=()=>{X=setInterval((()=>{Y.value-=100/E.time,q.value-=1,Y.value<=0&&(Y.value=100,q.value=E.time,ea())}),1e3),sessionStorage.setItem("timer".concat(G),JSON.stringify({...E,id:G}))},B=()=>{clearInterval(X),X=void 0},K=async()=>{await o({id:G}),null==H||H()},{loading:M,setLoading:Z}=c(),aa=I("None"),ea=async()=>{Z(!0);const{message:a}=await r({id:G});s(a)&&(aa.value=a.result?a.result:"None"),Z(!1)};return ea(),P((()=>{const a=sessionStorage.getItem("timer".concat(G));if(a){const e=JSON.parse(a);E.time=e.time,q.value=e.time,E.active=e.active,z()}})),k((()=>{B()})),(t,s)=>{const n=u,i=m,o=l,r=p,c=_,d=v,C=f,j=g,w=e,I=b,P=x,k=y,F=a;return S(),h("div",W,[$(k,{class:"mb-10px"},{default:N((()=>[$(P,null,{default:N((()=>[$(i,{class:"refresh-logs-btn",onClick:ea},{default:N((()=>[A(E).active?(S(),J(n,{key:0,type:"circle",percentage:A(Y),unit:""},{default:N((()=>[L("span",D,O(A(q)),1)])),_:1},8,["percentage"])):U("",!0),V(" "+O(t.$t("Ftp.Analysis.Index_32")),1)])),_:1}),$(I,{trigger:"click",placement:"bottom",class:"min-w-250px"},{trigger:N((()=>[$(i,null,{default:N((()=>[$(o,{name:"down"})])),_:1})])),default:N((()=>[$(w,{ref:"formRef",model:A(E),rules:Q,"label-width":"120px"},{default:N((()=>[$(c,{label:t.$t("Crontab.Planned.index_89")},{default:N((()=>[$(r,{value:A(E).active,"onUpdate:value":[s[0]||(s[0]=a=>A(E).active=a),T]},null,8,["value"])])),_:1},8,["label"]),A(E).active?(S(),J(c,{key:0,label:t.$t("Crontab.Planned.index_90"),path:"time"},{default:N((()=>[$(j,null,{default:N((()=>[$(d,{class:"w-50px!",value:A(E).time,"onUpdate:value":s[1]||(s[1]=a=>A(E).time=a),"show-button":!1,placeholder:""},null,8,["value"]),$(C,null,{default:N((()=>[V(O(t.$t("Waf.Setting.config_53")),1)])),_:1})])),_:1})])),_:1},8,["label"])):U("",!0)])),_:1},8,["model"])])),_:1})])),_:1}),$(i,{class:"empty-logs-btn",onClick:R},{default:N((()=>[V(O(t.$t("Crontab.Planned.index_25")),1)])),_:1}),$(i,{onClick:K},{default:N((()=>[V(O(t.$t("Docker.LocalImage.pull.index_12")),1)])),_:1})])),_:1}),$(F,{loading:A(M),log:A(aa)},null,8,["loading","log"])])}}}),[["__scopeId","data-v-a8de5712"]]);export{E as default};
