File: /www/server/panel/BTPanel/static/js/index199.js
import{_ as g}from"./index118.js?v=1777008528";import{e as b,_ as v,M as y,w as k,k as x,d3 as D,cP as C}from"./utils-lib.js?v=1777008528";import{_ as I}from"./index131.js?v=1777008528";import{r as P,H as S,V as E,e as a,c as w,o as R,I as $,j as B,k as O,v as r,p as o,x as T,J as V,z as j}from"./base-lib.js?v=1777008528";import{aI as A,g as H}from"./index3.js?v=1777008528";import{u as L}from"./useStore2.js?v=1777008528";import{getPhpSiteSafe as M,delPhpSiteSafe as N}from"./site.js?v=1777008528";import{r as m}from"./useController22.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index119.js?v=1777008528";import"./index116.js?v=1777008528";import"./useController19.js?v=1777008528";import"./useController13.js?v=1777008528";import"./useMethod12.js?v=1777008528";import"./index192.js?v=1777008528";import"./useController21.js?v=1777008528";import"./useStore13.js?v=1777008528";const{siteInfo:p}=L();P();const i=S({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>'}],z=()=>E([{label:"路径",prop:"path",render:t=>a("div",{class:"truncate bt-link",onClick:()=>{t.type==="dir"&&A({path:t.path})}},[t.path])},{label:"类型",prop:"type",render:t=>"".concat(t.type==="dir"?"文件夹":"文件")},{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(" / ")}},H([{onClick:_,title:"编辑"},{onClick:F,title:"删除"}])]),F=async t=>{await k({title:"删除监视器",width:"35rem",icon:"warning-filled",content:"您真的要删除路径【".concat(t.path,"】的监视器吗?")}),(await x({loading:"正在删除监视器,请稍后...",request:N({domain:p.value.name,type:t.type,path:t.path}),message:!0})).status&&l()},_=async t=>{let e={name:p.value.name,path:t?t.path:m.path,refresh:l};t&&(e.row=t),b({title:"".concat(t?"编辑":"添加","文件监视器"),area:47,isAsync:!0,component:()=>v(()=>import("./add-file-monitor.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),compData:e,showFooter:!0})},l=async()=>{try{i.load=!0;const t=await M();t.status||y.error(t.msg);const e=t.data.sites.find(n=>n.path===m.path&&n.site_name===p.value.name);if(e){const n=[];for(const s in e.config.file_info)Object.prototype.hasOwnProperty.call(e.config.file_info,s)&&n.push({...e.config.file_info[s],path:s});i.list=n}}catch(t){}finally{i.load=!1}},J=z(),G={class:"relative p-[16px]"},mt=w({__name:"index",setup(t){return R(()=>{l()}),(e,n)=>{const s=j,u=I,f=D,d=C,h=g,c=$("bt-loading");return B(),O("div",G,[a(h,null,{"header-left":r(()=>[a(s,{type:"primary",onClick:n[0]||(n[0]=K=>o(_)())},{default:r(()=>[...n[1]||(n[1]=[T("添加监视器",-1)])]),_:1})]),"header-right":r(()=>[a(u,{onRefresh:o(l)},null,8,["onRefresh"])]),content:r(()=>[V(a(f,{ref:"ftpTable",column:o(J),"max-height":360,data:o(i).list,description:"暂无数据"},null,8,["column","data"]),[[c,o(i).load],[c,"正在加载中,请稍后...","title"]])]),"footer-left":r(()=>[a(d,{options:o(q),class:"ml-[20px] mt-[20px]"},null,8,["options"])]),_:1})])}}});export{mt as default};
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = []
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}