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/index23.js
import{_ as z}from"./index118.js?v=1777008528";import{_ as H}from"./index217.js?v=1777008528";import{k as C,c4 as F,R as k,c as B,e as x,_ as D,w as j,M as X,cR as Y,c_ as G,d3 as Z,d4 as K,cZ as Q}from"./utils-lib.js?v=1777008528";import{aJ as W,r as p,H as v,e as u,aI as ee,V as te,c as ae,o as se,a8 as re,I as ne,J as A,p as a,j as O,k as V,v as f,F as oe,B as le,C as ie,q as h,x as ce,aE as pe,z as ue}from"./base-lib.js?v=1777008528";import{g as de,A as _e,B as me,C as q,D as N,E as ge,F as fe,z as be}from"./useController25.js?v=1777008528";import{e as ye,g as ve,b as we}from"./index3.js?v=1777008528";const he=W("CRONTAB-STORE",()=>{const e=p({}),s=p(!1),t=p([]),n=v({p:1,rows:10}),o=p(0),l=async()=>{await C({loading:s,request:e.value.request({...e.value.data,...n}),data:{data:[Array,t],page:F(o)}})},w=[{label:"执行时间",width:148,render:r=>k(r.start_time)},{label:"耗时",render:r=>{let _=r.end_time-r.start_time;return"".concat(_<1?"小于1":_,"秒")}},{label:"执行结果",render:r=>u("span",{style:"color: ".concat(r.status?"var(--el-color-primary)":"#ef0808",";")},[r.status?"成功":"失败"])},{label:"返回内容",width:400,render:r=>{let _=r.status?r.result_succ:r.result_err;return u("pre",{class:"max-h-[14rem] overflow-y-hidden overflow-x-hidden w-full",onMouseenter:g=>{let d=g.target;d.style.overflowX="auto",d.style.overflowY="auto"},onMouseleave:g=>{let d=g.target;d.style.overflowX="hidden",d.style.overflowY="hidden"}},[_])}}];return{logCompData:e,total:o,tableParam:n,tableLoading:s,tableColumns:w,tableData:t,getLogList:l}});B();const Se=he(),{logCompData:Ce}=ee(Se),c=v({p:1,rows:20,search:"",type_id:""}),P=p(),xe=p(!1),I=p(0),R=p([]),M=p(!1),S=p([]),Te=async(e,s)=>{const{is_args:t,args_title:n,name:o,args_ps:l,script_id:m}=e;if(Object.assign(T,{script_id:m,name:o,form:{args:"",placeholder:o==="端口检测"?"127.0.0.1:433":l},title:n}),t){x({title:"执行脚本参数",component:()=>D(()=>import("./index308.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),showFooter:!0,area:42,onConfirm:async()=>(await Ae.value.validate(),$())});return}else $()},$=async()=>{const{name:e,script_id:s,form:t}=T,n={script_id:s,args:t.args};await j({title:"执行脚本",icon:"warning-filled",content:"立即执行【".concat(e,"】脚本任务,执行过程可能等待时间较长,请耐心等待。是否继续?")});const o=X.load("正在执行脚本,请稍后...");try{const{data:l}=await me({data:JSON.stringify(n)});return o.close(),l.status&&L(),x({title:"执行结果",area:[60,40],component:{render(m){return u("pre",{class:"h-full w-full bg-darkPrimary dark:bg-lighter !overflow-auto whitespace-pre-line text-white break-all p-12px"},[l.msg])}}}),l.status}catch(l){return o.close(),!1}},Oe=e=>{Ce.value={request:q,data:{script_id:e.script_id}},x({title:"执行日志",area:86,compData:{request:q,data:{script_id:e.script_id}},component:()=>D(()=>import("./index453.js?v=1777008528"),__vite__mapDeps([]),import.meta.url)})},ke=async e=>{await j({title:"删除脚本",icon:"warning-filled",content:"删除后脚本信息不可恢复,是否继续操作?"}),await C({loading:"正在删除脚本,请稍后...",request:N(e),message:!0,success:b})},De=async()=>{const e=await de();S.value=e,S.value.length&&(c.type_id=String(S.value[0].type_id))},b=async()=>{await C({loading:M,request:_e(c),data:{data:[Array,R],page:F(I)}})},Re=e=>{c.type_id=e.props.name,b()},U=(e,s)=>{if(L(),y.type_id=c.type_id,e){const{script_id:t,name:n,return_type:o,is_args:l,ps:m,script:w,args_title:r,args_ps:_,type_id:g}=s;Object.assign(y,{name:n,return_type:o,is_args:String(l),ps:m,script:w,type_id:g,script_id:t}),l=="1"&&Object.assign(E,{args_title:r,args_ps:_})}x({title:(e?"编辑":"创建")+"脚本",area:57,component:()=>D(()=>import("./index309.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),onConfirm:()=>qe(!!e),showFooter:!0})},Ee=te([ye({key:"script_id"}),{label:"名称",prop:"name"},{label:"类型",prop:"script_type"},{label:"返回类型",prop:"return_type"},{label:"备注",prop:"ps",showOverflowTooltip:!0},{label:"创建时间",render:e=>k(e.create_time)},{label:"上次执行时间",render:e=>Array.isArray(e.last_exec_time)?"--":k(e.last_exec_time)},ve([{onClick:e=>Te(e),title:"执行"},{onClick:e=>U(!0,e),title:"编辑"},{onClick:Oe,title:"日志"},{onClick:ke,title:"删除"}])]),Le=[{label:"删除脚本",value:"delete",event:async(e,s)=>{const t=async n=>await N({script_id:n.script_id});await e({title:"批量删除",content:"即将删除所选中的数据,是否继续操作?",column:[{prop:"name",label:"脚本名称"},we()],onConfirm:async()=>(await s(t),b(),!1)})}}],Ae=p(),T=v({title:"脚本参数",form:{args:"",placeholder:"请输入脚本参数"},name:"",script_id:""}),He={args:[{required:!0,message:"请输入脚本参数",trigger:"blur"},{validator:(e,s,t)=>{T.name==="端口检测"?/^(\d{1,3}\.){3}\d{1,3}:\d{1,5}$/.test(s)?t():t(new Error("请输入正确的IP:端口格式")):t()}}]},Ve=p(),E=v({args_title:"",args_ps:""}),y=v({name:"",return_type:"string",is_args:"0",ps:"",script:"",type_id:"",script_id:""}),Xe=[{content:"当前仅支持Python和Shell脚本"},{content:"请根据返回类型在脚本执行结束时输出符合预期的值"},{content:"如果选择需要脚本参数,使用当前脚本时需传递一个参数,在脚本中的第一个参数中接收"},{content:"Python 脚本需指定编码(如 #coding: utf-8);Shell 脚本可以用 #!/bin/bash 或 #!/bin/sh 开头,未指定类型时默认按 Shell 脚本执行。"}],Ye=v({name:[{required:!0,message:"请输入脚本名称",trigger:"blur"}],script:[{required:!0,message:"请输入脚本内容",trigger:"blur"}]}),qe=async e=>{await Ve.value.validate();let s={...y};y.is_args=="1"&&(s={...y,...E}),e||delete s.type_id,s={data:JSON.stringify(s)};const t=e?ge:fe;return(await C({loading:"正在".concat(e?"编辑":"创建","脚本,请稍后..."),request:t(s),message:!0,success:o=>{o.status&&L(),b()}})).status},L=()=>{Object.assign(y,{name:"",return_type:"string",is_args:"0",ps:"",script:"",type_id:"",script_id:""}),Object.assign(E,{args_title:"",args_ps:""}),Object.assign(T,{title:"脚本参数",form:{args:"",placeholder:"请输入脚本参数"},name:"",script_id:""})},Pe=()=>{R.value=[],S.value=[]},$e={class:"flex items-center"},Fe={class:"flex items-center"},Be=ae({__name:"index",setup(e){return B(),se(async()=>{await De(),b()}),re(Pe),(s,t)=>{const n=pe,o=Y,l=ue,m=G,w=Z,r=K,_=H,g=z,d=ne("bt-loading");return A((O(),V("div",null,[u(o,{modelValue:a(c).type_id,"onUpdate:modelValue":t[0]||(t[0]=i=>a(c).type_id=i),type:"card",onTabClick:a(Re)},{default:f(()=>[(O(!0),V(oe,null,le(a(S),(i,J)=>(O(),ie(n,{class:"h-0",key:J,label:i.name,name:String(i.type_id)},null,8,["label","name"]))),128))]),_:1},8,["modelValue","onTabClick"]),u(g,null,{"header-left":f(()=>[h("div",$e,[u(l,{onClick:t[1]||(t[1]=i=>a(U)()),type:"primary"},{default:f(()=>[...t[6]||(t[6]=[ce("创建脚本",-1)])]),_:1}),h("div",{class:"flex items-center ml-4px",onClick:t[2]||(t[2]=i=>a(be)())},[...t[7]||(t[7]=[h("i",{class:"svgtofont-desired text-medium"},null,-1),h("span",{class:"bt-link"},"需求反馈",-1)])])])]),"header-right":f(()=>[h("div",Fe,[u(m,{modelValue:a(c).search,"onUpdate:modelValue":t[3]||(t[3]=i=>a(c).search=i),class:"ml-12px !w-[32rem]",placeholder:"请输入搜索关键字",onSearch:a(b)},null,8,["modelValue","onSearch"])])]),content:f(()=>[A(u(w,{ref_key:"scriptTableRef",ref:P,column:a(Ee),data:a(R)},null,8,["column","data"]),[[d,a(M)],[d,"正在加载中,请稍后...","title"]])]),"footer-left":f(()=>[u(r,{"table-ref":a(P),options:a(Le)},null,8,["table-ref","options"])]),"footer-right":f(()=>[u(_,{total:a(I),page:a(c).p,"onUpdate:page":t[4]||(t[4]=i=>a(c).p=i),row:a(c).rows,"onUpdate:row":t[5]||(t[5]=i=>a(c).rows=i),onChange:a(b)},null,8,["total","page","row","onChange"])]),_:1})])),[[d,a(xe)]])}}}),je=Q(Be,[["__scopeId","data-v-7622be20"]]),Ge=Object.freeze(Object.defineProperty({__proto__:null,default:je},Symbol.toStringTag,{value:"Module"}));export{he as C,T as a,Ae as b,y as c,E as d,Ve as e,Ye as f,Xe as h,Ge as i,He as r};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}