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