import{_ as t}from"./index105.js?v=1761009159";import{n as e,Q as a,M as s,aK as o,p as r,P as n,l as i,$ as l}from"./utils-lib.js?v=1761009159";import{_ as p}from"./index126.js?v=1761009159";import{r as m,o as c,V as d,e as f,c as h,q as u,H as _,v as j,x as y,B as b,y as g,C as w,I as x,G as C}from"./base-lib.js?v=1761009159";import{o as v,u as k}from"./column.js?v=1761009159";import{u as I}from"./useStore4.js?v=1761009159";import{getPhpSiteSafe as A,delPhpSiteSafe as H}from"./site.js?v=1761009159";import{r as O}from"./useController21.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./validator.js?v=1761009159";import"./useController5.js?v=1761009159";import"./useController6.js?v=1761009159";import"./useMethod5.js?v=1761009159";import"./useController20.js?v=1761009159";import"./useStore13.js?v=1761009159";const{siteInfo:P}=I();m();const R=c({list:[],load:!1}),q=[{content:"安全告警默认会监视当前网站访问非当前网站文件的行为(例：你的站点A.com访问了站点B.com的文件或者目录)，通过添加监视器路径，当路径被访问时发送告警"},{content:"告警频率：60秒某一个告警行为只会发送一次告警"},{isHtml:!0,content:'<a class="bt-link"  href="https://www.bt.cn/bbs/thread-112442-1-1.html" target="_blank" rel="noreferrer noopener">使用教程</a>'}],B=async t=>{await r({title:"删除监视器",width:"35rem",icon:"warning-filled",content:"您真的要删除路径【".concat(t.path,"】的监视器吗？")});(await n({loading:"正在删除监视器，请稍后...",request:H({domain:P.value.name,type:t.type,path:t.path}),message:!0})).status&&E()},D=async t=>{let s={name:P.value.name,path:t?t.path:O.path,refresh:E};t&&(s.row=t),e({title:"".concat(t?"编辑":"添加","文件监视器"),area:47,isAsync:!0,component:()=>a(()=>import("./add-file-monitor.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),compData:s,showFooter:!0})},E=async()=>{try{R.load=!0;const t=await A();t.status||s.error(t.msg);const e=t.data.sites.find(t=>t.path===O.path&&t.site_name===P.value.name);if(e){const t=[];for(const a in e.config.file_info)Object.prototype.hasOwnProperty.call(e.config.file_info,a)&&t.push({...e.config.file_info[a],path:a});R.list=t}}catch(t){o(t)}finally{R.load=!1}},M=d([{label:"路径",prop:"path",render:t=>f("div",{class:"truncate bt-link",onClick:()=>{"dir"===t.type&&v({path:t.path})}},[t.path])},{label:"类型",prop:"type",render:t=>"".concat("dir"===t.type?"文件夹":"文件")},{label:"告警操作",prop:"type",render:t=>{const e=[];return parseInt(t.read)&&e.push("读取"),parseInt(t.del)&&e.push("删除"),parseInt(t.reit)&&(e.push("修改"),e.push("增加")),e.join(" / ")}},k([{onClick:D,title:"编辑"},{onClick:B,title:"删除"}])]),S={class:"relative p-[16px]"},T=h({__name:"index",setup:e=>(u(()=>{E()}),(e,a)=>{const s=C,o=p,r=i,n=l,m=t,c=_("bt-loading");return j(),y("div",S,[f(m,null,{"header-left":b(()=>[f(s,{type:"primary",onClick:a[0]||(a[0]=t=>g(D)())},{default:b(()=>a[1]||(a[1]=[w("添加监视器",-1)])),_:1,__:[1]})]),"header-right":b(()=>[f(o,{onRefresh:g(E)},null,8,["onRefresh"])]),content:b(()=>[x(f(r,{ref:"ftpTable",column:g(M),"max-height":360,data:g(R).list,description:"暂无数据"},null,8,["column","data"]),[[c,g(R).load],[c,"正在加载中，请稍后...","title"]])]),"footer-left":b(()=>[f(n,{options:g(q),class:"ml-[20px] mt-[20px]"},null,8,["options"])]),_:1})])})});export{T as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
