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