HEX
Server: nginx/1.28.3
System: Linux ip-172-31-12-242 6.17.0-1007-aws #7~24.04.1-Ubuntu SMP Thu Jan 22 21:04:49 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/server/panel/BTPanel/static/js/index22.js
import{e as A,_ as L,w as B,f as pe,a0 as de,n as me,k as E,o as _e,M as P,c as be,c_ as fe,d2 as ge,d3 as ve,d4 as ye,K as ke}from"./utils-lib.js?v=1777008528";import{_ as Ce}from"./index206.js?v=1777008528";import{_ as he}from"./index118.js?v=1777008528";import{_ as Te}from"./index217.js?v=1777008528";import{_ as we}from"./index131.js?v=1777008528";import{B as Se}from"./index152.js?v=1777008528";import{c as X,r,H as Y,j,k as Z,e as o,v as m,J as ee,p as s,aF as xe,z as te,ba as Ee,K as Oe,aJ as De,aI as Ve,g as $e,x,o as Re,I as qe,C as Be,q as h,y as Ae,Q as Le,aV as Pe}from"./base-lib.js?v=1777008528";import{f as Ne,h as Ie,m as je,r as Me,i as H,j as ae,k as Fe,l as Ue,n as se,o as Je,p as We,q as ze,t as He,u as Ke,v as Ge,w as Qe,x as Xe,y as Ye,z as Ze}from"./useController25.js?v=1777008528";import{e as et,f as tt,y as at,aI as oe,g as st,d as ot,b as nt}from"./index3.js?v=1777008528";const lt=X({__name:"index",emits:["upload-success"],setup(e,{expose:a,emit:t}){const i=pe(),c=t,b=r(),g=window.location.protocol+"//"+window.location.host+"/crontab?action=import_crontab_from_json",u=Y({overwrite:1}),v=r([]),V=[".json"].join(","),$=async(l,w,O)=>{var S,W,z;if(l.status===!1){i.error(l.msg);return}else{let N=[];(S=l.successful_tasks)==null||S.forEach(C=>{N.push({name:C,status:1,msg:"导入成功"})}),(W=l.failed_tasks)==null||W.forEach(C=>{N.push({name:C,status:0,msg:"导入失败"})}),(z=l.skipped_tasks)==null||z.forEach(C=>{N.push({name:C,status:2,msg:"重复任务已跳过"})}),await A({title:"导入计划任务结果",area:42,component:()=>L(()=>import("./index127.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),compData:{resultData:N,autoTitle:l.msg,resultColumn:[{label:"计划任务名称",prop:"name"},{label:"操作结果",align:"right",render:C=>xe("span",{class:C.status===1?"text-primary":C.status===0?"text-danger":""},C.msg)}]}})}c("upload-success")},d=()=>{i.error("导入失败")},T={"x-http-token":window.vite_public_request_token},y=async l=>{l.value=l;const w=await B({type:"check",title:"提示",content:"是否继续将文件中的数据导入到现有计划任务中?",check:{content:"跳过重复计划任务",value:!0,onConfirm:O=>{u.overwrite=O?1:0}}});return w&&!u.overwrite&&await B({icon:"warning",title:"提示",content:"导入重复的任务可能会导致系统服务异常,请谨慎操作!"}),w},p=async(l,w)=>{v.value=w},k=(l,w,O)=>{v.value=O.map(S=>(S.uid===w.uid&&(S.percentage=l.percent),S))};return a({open:()=>{b.value.$el.click()},fileData:u}),(l,w)=>{const O=te,S=Ee;return j(),Z("div",null,[o(S,{class:"upload-demo",ref:"upload",name:"file",data:()=>s(u),action:g,headers:T,accept:s(V),"on-error":d,multiple:!1,"show-file-list":!1,"auto-upload":!0,"on-success":$,"on-progress":k,"file-list":s(v),"on-change":p,"before-upload":y},{default:m(()=>[ee(o(O,{ref_key:"openRef",ref:b,size:"small",type:"primary"},null,512),[[Oe,!1]])]),_:1},8,["data","accept","file-list"])])}}}),rt=De("CRONTAB-VIEW-STORE",()=>{const e=r({}),a=r(!0),t=r([]),i=r([]);return{rowData:e,typeInit:a,$resetForm:()=>{e.value={},a.value=!0},shellOptions:t,pythonEnvOptions:i}}),it=rt(),{rowData:D}=Ve(it),ct=de({route:"/ws_panel"}),ne=r(),K=r(),J=r([]),M=r(!1),le=r(0),f=Y({p:1,count:20,search:"",type_id:"all",order_param:""}),I=r([]),re=r(!0),q=r(!1),F=r(""),ut=()=>ne.value.open(),Lt=$e(()=>{const{save:e,sType:a}=D.value;return!["enterpriseBackup","logs","special_log","toShell"].includes(a)&&!(!e&&me(e))}),R=async(e,a,t,i,c)=>{const{label:b,value:g}=i,u=b.replace("任务",""),v=async(d,T)=>{const y=new Map([["exec",se],["delete",Ye]]),{id:p}=d;switch(g){case"exec":case"delete":const k=y.get(g);if(k)return await k({id:p})}},V=async(d,T)=>{const y=JSON.stringify(T.map(p=>p.id));d.unmount(),c(),await E({loading:"正在执行,请稍后...",request:Qe({id_list:y,type:g,if_stop:"False"}),success:p=>{const k=p.data.map(n=>{const l=Object.entries(n)[0];return{msg:n.status?u+"成功":l[1],name:l[0],status:n.status}});Xe(k,{title:"".concat(u,"计划任务")})}})},$=async(d,T)=>{const y=JSON.stringify(T.map(p=>p.id));d.unmount(),c(),await E({loading:"正在执行,请稍后...",request:ae({ids:y}),success:p=>{window.open("/download?filename="+p.msg.replace("导出成功!,下载路径为",""),"_blank","noopener,noreferrer")}})};await e({title:"批量".concat(u,"计划任务"),content:"即将批量".concat(u,"选中的计划任务,是否继续操作?"),column:[{label:"计划任务",prop:"rname"},nt()],onConfirm:async d=>{switch(g){case"start":case"stop":await V(d,t.value);break;case"delete":case"exec":await a(v);break;case"out":await $(d,t.value);break}return _(),!1}})},pt=()=>[{label:"执行任务",value:"exec",event:R},{label:"启动任务",value:"start",event:R},{label:"停止任务",value:"stop",event:R},{label:"设置分类",value:"setClass",event:async(e,a,t,i,c)=>{await ot({name:"计划任务分类",options:I.value.filter(b=>b.value!=="all"&&b.value>0),selectList:t.value,request:async(b,g)=>{const u=JSON.stringify(t.value.map(v=>v.id));await E({loading:"正在批量设置分类,请稍后...",request:Fe({id:b.id,crontab_ids:u}),message:!0}),c(),g(),_()}})}},{label:"导出任务",value:"out",event:R},{label:"删除任务",value:"delete",event:R}],dt=pt(),Pt=async e=>{try{const{data:a}=await He({id:D.value.id});a.status?(oe({path:a.msg}),e&&e()):P.request(a)}catch(a){}},mt=({column:e,prop:a,order:t})=>{f.order_param=t?a+(t==="ascending"?" asc":" desc"):"",_()},_=async()=>{try{const e={...f};f.type_id==="all"&&(e.type_id=""),await E({loading:M,request:Ne(e),data:{data:[Array,J],page:Object},success:a=>{le.value=_e(a.page)}})}catch(e){}finally{M.value=!1}},ie=async()=>{try{const e=await Ue();re.value=!!e.status}catch(e){}},_t=async(e,a=!1)=>{let t={};a?t={id:D.value.id}:t={id:e.id};try{const i=await se(t);P.request(i),a||ce(e)}catch(i){}},ce=e=>{D.value=e,A({title:"查看【"+(e.rname||e.name)+"】日志",area:80,component:()=>L(()=>import("./index523.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)})},bt=async(e,a)=>{try{let t;a=="top"?t=await Ke({task_id:e.id}):a=="untop"&&(t=await Ge({task_id:e.id})),P.request(t),_()}catch(t){}},ft=async e=>{try{const a=!e.status;await B({title:"".concat(a?"启用":"停用","计划任务"),content:"该计划任务".concat(a?"已停止":"正在运行",",是否要").concat(a?"启用":"停用","这个计划任务?")}),await E({loading:"正在设置计划任务状态,请稍候...",request:Je({id:Number.parseInt(e.id),if_stop:a?"False":"True"}),message:!0}),_()}catch(a){}finally{}},gt=e=>{D.value=e,A({title:"".concat(e.name,"-备份文件"),area:80,component:()=>L(()=>import("./index451.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)})},U=e=>{D.value=e||!1,A({title:"".concat(e?e!=null&&e.id?"编辑":"复制":"添加","计划任务"),area:100,showFooter:!0,component:()=>L(()=>import("./index524.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)})},ue=async()=>(await E({request:We(),data:{msg:Array},success:e=>{I.value=[{label:"全部分类",value:"all"},{label:"系统任务",value:"-1"},{label:"默认分类",value:"0"},{label:"正在运行",value:"-2"},{label:"已停止",value:"-3"},...e.msg.map(a=>({label:a.name,value:a.id.toString()}))]}}),Promise.resolve(I.value||[])),vt={getClassList:ue,addClass:Ie,editClass:je,deleteClass:Me},yt=async({id:e,name:a})=>{try{await B({title:"删除计划任务",content:"您确定要删除计划任务【".concat(a,"】,是否继续?")}),await E({loading:"正在删除计划任务,请稍候...",request:ze({id:e}),message:!0}),_()}catch(t){}},G=r([et({key:"id"}),tt({event:(e,a)=>{bt(e,a)},param:"sort"}),{label:"任务名称",prop:"name",minWidth:250,sortable:"custom",showOverflowTooltip:!0,render:e=>e.rname||e.name},{label:"分类",prop:"type_name",isCustom:!0},at({event:ft,sortable:"custom",data:["停用","正常"]}),{label:"执行周期",prop:"cycle",minWidth:150,isCustom:!0,showOverflowTooltip:!0},{label:"保存数量",isCustom:!0,render:e=>["site","database","enterpriseBack","path","mysql_increment_backup"].includes(e.sType)&&e.save?o("span",null,[e.save,x("份"),o("span",{class:"bt-link",onClick:()=>gt(e)},[x("[查看]")])]):e.sType==="logs"||e.sType==="special_log"?"".concat(e.save?e.save+"份":"--"):"--"},{label:"备份到",minWidth:160,isCustom:!0,render:e=>{if(e.sType==="mysql_increment_backup"||e.sType==="enterpriseBackup"){const t=e.backupTo.split("|");let i="";return t.forEach(c=>i+=H[c]+","),i.slice(0,-1)}const a=H[e.backupTo];return e.sType==="toShell"?"--":a||"--"}},{label:"备份路径",prop:"db_backup_path",width:100,isCustom:!0,showOverflowTooltip:!0,render:e=>["site","database","path"].includes(e.sType)?o("span",{class:"bt-link",onClick:()=>oe({path:e.db_backup_path})},[e.db_backup_path]):"--"},{label:"上次执行时间",prop:"addtime",minWidth:150,sortable:"custom",isCustom:!0},{label:"上次定时任务执行结果",prop:"result",isCustom:!1,minWidth:160,sortable:"custom",render:e=>o("span",{class:e.result?"text-primary":"text-danger"},[e.result?"正常":"异常"])},st([{onClick:e=>_t(e),title:"执行"},{onClick:U,title:"编辑"},{onClick:ce,title:"日志"},{onClick:e=>U({...e,id:""}),title:"复制"},{onClick:yt,title:"删除"}])]),Q=async()=>{await B({title:"一键修复",content:"此修复主要用于解决计划任务无法定时执行,请谨慎操作,是否继续?"}),q.value=!0;let e=[];F.value="开始修复计划任务...",ct.request("/crontab/repair_crontab_service",{customType:"model",onMessage:a=>{a.includes("修复完成")?(P.success("修复成功"),ie(),q.value=!1):(e.push(a),F.value=e.join("\n"))}})},kt=async()=>{if(J.value.length===0){P.error("暂无数据可导出");return}try{const e=await ae();window.open("/download?filename="+e.msg.replace("导出成功!,下载路径为",""),"_blank","noopener,noreferrer")}catch(e){}},Ct=()=>{A({title:"日志切割设置",area:56,component:()=>L(()=>import("./index452.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)})},ht=()=>{_(),ue(),ie()},Tt={class:"flex items-center"},wt={class:"flex items-center"},St={class:"flex-wrap"},xt=X({__name:"index",setup(e){return be(),Re(()=>ht()),(a,t)=>{const i=Pe,c=te,b=Se,g=fe,u=we,v=ge,V=ve,$=ye,d=Te,T=he,y=Ce,p=ke,k=qe("bt-loading");return j(),Z("div",null,[s(re)?Ae("",!0):(j(),Be(i,{key:0,closable:!1,type:"error",class:"!mb-[1.6rem]"},{title:m(()=>[h("div",Tt,[t[9]||(t[9]=h("i",{class:"svgtofont-el-warning-filled text-[var(--el-color-error-light-8)] !text-base mr-[4px]"},null,-1)),t[10]||(t[10]=x(" 检测到当前计划任务服务异常,请及时修复,温馨提示:修复前请先临时关闭系统加固,否则可能导致修复失败。 ",-1)),h("span",{class:"bt-link",onClick:t[0]||(t[0]=(...n)=>s(Q)&&s(Q)(...n))},"[ 一键修复 ]")])]),_:1})),o(T,null,{"header-left":m(()=>[o(c,{class:"crontab_add_task",type:"primary",onClick:t[1]||(t[1]=n=>s(U)())},{default:m(()=>[...t[11]||(t[11]=[x("添加任务",-1)])]),_:1}),o(c,{onClick:s(ut)},{default:m(()=>[...t[12]||(t[12]=[x("导入",-1)])]),_:1},8,["onClick"]),o(c,{onClick:s(kt)},{default:m(()=>[...t[13]||(t[13]=[x("导出",-1)])]),_:1},8,["onClick"]),o(c,{onClick:t[2]||(t[2]=n=>s(Ct)())},{default:m(()=>[...t[14]||(t[14]=[x("日志切割设置",-1)])]),_:1}),o(lt,{ref_key:"fileRef",ref:ne,onUploadSuccess:s(_)},null,8,["onUploadSuccess"]),h("div",{class:"flex items-center ml-4px",onClick:t[3]||(t[3]=n=>s(Ze)())},[...t[15]||(t[15]=[h("i",{class:"svgtofont-desired text-medium"},null,-1),h("span",{class:"bt-link"},"需求反馈",-1)])])]),"header-right":m(()=>[h("div",wt,[o(b,{name:"CrontabTask",class:"mr-[10px] !w-[16rem]",modelValue:s(f).type_id,"onUpdate:modelValue":t[4]||(t[4]=n=>s(f).type_id=n),options:s(I),field:"name",config:s(vt),onChange:s(_),ignore:["-1","0","-2","-3"]},null,8,["modelValue","options","config","onChange"]),h("div",null,[o(g,{class:"!w-[26rem]",modelValue:s(f).search,"onUpdate:modelValue":t[5]||(t[5]=n=>s(f).search=n),onSearch:s(_),placeholder:"支持任务名称模糊搜索"},null,8,["modelValue","onSearch"])]),o(u,{onRefresh:s(_),class:"!mx-[10px]"},null,8,["onRefresh"]),o(v,{name:"Crontab",column:s(G)},null,8,["column"])])]),content:m(()=>[ee(o(V,{ref_key:"crontabRef",ref:K,column:s(G),data:s(J),onSortChange:s(mt)},null,8,["column","data","onSortChange"]),[[k,s(M)],[k,"正在加载中,请稍候...","title"]])]),"footer-left":m(()=>[o($,{"table-ref":s(K),options:s(dt)},null,8,["table-ref","options"])]),"footer-right":m(()=>[o(d,{page:s(f).p,"onUpdate:page":t[6]||(t[6]=n=>s(f).p=n),row:s(f).count,"onUpdate:row":t[7]||(t[7]=n=>s(f).count=n),total:s(le),onChange:s(_)},null,8,["page","row","total","onChange"])]),_:1}),o(p,{title:"正在修复服务,请耐心等候",modelValue:s(q),"onUpdate:modelValue":t[8]||(t[8]=n=>Le(q)?q.value=n:null),area:[60]},{default:m(()=>[h("div",St,[o(y,{class:"h-[40rem] !rounded-none",content:s(F)},null,8,["content"])])]),_:1},8,["modelValue"])])}}}),Nt=Object.freeze(Object.defineProperty({__proto__:null,default:xt},Symbol.toStringTag,{value:"Module"}));export{rt as C,Nt as a,_ as g,Lt as i,Pt as o,_t as s,ct as w};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}