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/add-file-monitor.js
import{k as E,cP as M}from"./utils-lib.js?v=1777008528";import{c as q,H as B,r as S,g as j,o as N,j as d,k as u,e as l,v as c,p as i,F as U,B as H,q as f,s as I,ad as P,U as R,ag as z,ab as A}from"./base-lib.js?v=1777008528";import{_ as G}from"./index116.js?v=1777008528";import{az as L}from"./firewall.js?v=1777008528";import{w as O}from"./index3.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index119.js?v=1777008528";const T={class:"p-20px"},Z=q({__name:"add-file-monitor",props:{compData:{default:()=>{}}},setup(_,{expose:h}){const a=_,e=B({path:"",type:"dir",domain:a.compData.name,actions:[]}),p=S(),g=j(()=>e.type==="dir"),b=[{name:"read",title:"读取"},{name:"del",title:"删除"},{name:"reit",title:"修改/增加"}],D={path:[{required:!0,message:"请选择监测路径",trigger:"blur"}],actions:[{required:!0,message:"请选择告警操作",trigger:"change"}]},w=()=>{a.compData.row||O({type:"all",path:e.path,change:(n,t)=>{e.path=n,e.type=t,t==="dir"?e.actions=["read"]:e.actions=["read","del","reit"]}})},y=n=>{e.path=e.path.replace(/\s+/g,"")},k=async n=>{await p.value.validate();let t={...e},o=[0,0,0,0];e.actions.includes("read")&&(o[0]=1),e.actions.includes("del")&&(o[1]=1),e.actions.includes("reit")&&(o[2]=1,o[3]=1),t.actions=o.join(","),await E({loading:"正在添加文件监视器,请稍后...",request:L(!!a.compData.row,{...t}),message:!0,success:r=>{r.status&&(a.compData.refresh&&a.compData.refresh(),n())}})},x=()=>{if(a.compData.path&&(e.path=a.compData.path.replace("//","/")),a.compData.row){const n=["del","read","reit"],t=[];Object.entries(a.compData.row).forEach(([o,r])=>{n.includes(o)&&Number(r)&&t.push(o)}),e.type=a.compData.row.type,e.actions=t}};return N(()=>x()),h({onConfirm:k}),(n,t)=>{const o=G,r=P,F=R,v=z,V=A,C=M;return d(),u("div",T,[l(V,{model:i(e),ref_key:"addFileMonitorRef",ref:p,rules:D},{default:c(()=>[l(r,{prop:"path",label:"监测路径"},{default:c(()=>[l(o,{modelValue:i(e).path,"onUpdate:modelValue":t[0]||(t[0]=s=>i(e).path=s),class:"!w-[28rem]",icon:"icon-file_mode",onIconClick:w,disabled:!!a.compData.row,onChangePassive:t[1]||(t[1]=s=>y("path")),placeholder:"请选择文件目录"},null,8,["modelValue","disabled"])]),_:1}),l(r,{label:"告警操作",prop:"actions"},{default:c(()=>[l(v,{modelValue:i(e).actions,"onUpdate:modelValue":t[2]||(t[2]=s=>i(e).actions=s)},{default:c(()=>[(d(),u(U,null,H(b,(s,m)=>l(F,{key:m,label:s.name,disabled:i(g)&&m>0},{default:c(()=>[f("div",null,[f("span",null,I(s.title),1)])]),_:2},1032,["label","disabled"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"]),l(C,{options:[{content:"目录暂时只支持读取告警操作"}],class:"ml-20px mt-20px","list-style":"disc"})])}}});export{Z as default};