import{_ as t}from"./index104.js?v=1761009159";import{o as e,L as s,M as a,at as o,q as r,K as n,n as i,W as l,_ as p}from"./utils-lib.js?v=1761009159";import{_ as m}from"./index126.js?v=1761009159";import{r as c,k as d,U as f,e as h,c as u,p as _,G as j,q as y,v as b,A as g,x as w,B as x,H as v,D as k}from"./base-lib.js?v=1761009159";import{o as C,u as I}from"./column.js?v=1761009159";import{u as A}from"./useStore4.js?v=1761009159";import{getPhpSiteSafe as q,delPhpSiteSafe as D}from"./site.js?v=1761009159";import{r as H}from"./useController19.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index105.js?v=1761009159";import"./validator.js?v=1761009159";import"./useStore5.js?v=1761009159";import"./useMethod5.js?v=1761009159";import"./useController18.js?v=1761009159";import"./useStore14.js?v=1761009159";import"./useController6.js?v=1761009159";const{siteInfo:O}=A();c();const R=d({list:[],load:!1}),S=[{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:D({domain:O.value.name,type:t.type,path:t.path}),message:!0})).status&&L()},E=async t=>{let a={name:O.value.name,path:t?t.path:H.path,refresh:L};t&&(a.row=t),e({title:"".concat(t?"编辑":"添加","文件监视器"),area:47,isAsync:!0,component:()=>s((()=>import("./add-file-monitor.js?v=1761009159")),__vite__mapDeps([]),import.meta.url),compData:a,showFooter:!0})},L=async()=>{try{R.load=!0;const t=await q();t.status||a.error(t.msg);const e=t.data.sites.find((t=>t.path===H.path&&t.site_name===O.value.name));if(e){const t=[];for(const s in e.config.file_info)Object.prototype.hasOwnProperty.call(e.config.file_info,s)&&t.push({...e.config.file_info[s],path:s});R.list=t}}catch(t){o(t)}finally{R.load=!1}},M=f([{label:"路径",prop:"path",render:t=>h("div",{class:"truncate bt-link",onClick:()=>{"dir"===t.type&&C({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(" / ")}},I([{onClick:E,title:"编辑"},{onClick:B,title:"删除"}])]),P={class:"relative p-[16px]"},T=p(u({__name:"index",setup:e=>(_((()=>{L()})),(e,s)=>{const a=k,o=m,r=i,n=l,p=t,c=j("bt-loading");return y(),b("div",P,[h(p,null,{"header-left":g((()=>[h(a,{type:"primary",onClick:s[0]||(s[0]=t=>w(E)())},{default:g((()=>s[1]||(s[1]=[x("添加监视器")]))),_:1})])),"header-right":g((()=>[h(o,{onRefresh:w(L)},null,8,["onRefresh"])])),content:g((()=>[v(h(r,{ref:"ftpTable",column:w(M),"max-height":360,data:w(R).list,description:"暂无数据"},null,8,["column","data"]),[[c,w(R).load],[c,"正在加载中，请稍后...","title"]])])),"footer-left":g((()=>[h(n,{options:w(S),class:"ml-[20px] mt-[20px]"},null,8,["options"])])),_:1})])})}),[["__file","/Users/chudong/project/linux-10/src/views/site/views/php-model/php-setting/safe-monitor/index.vue"]]);export{T as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
