← Back
Editing: index488.js
import{_ as t}from"./index104.js?v=1765440387";import{n as e,L as a,M as s,at as o,p as r,K as n,l as i,W as l}from"./utils-lib.js?v=1765440387";import{_ as p}from"./index124.js?v=1765440387";import{r as m,k as c,U as d,e as f,c as h,p as u,G as j,q as _,v as y,A as b,x as g,B as w,H as x,D as k}from"./base-lib.js?v=1765440387";import{o as v,u as C}from"./column.js?v=1765440387";import{u as I}from"./useStore4.js?v=1765440387";import{getPhpSiteSafe as A,delPhpSiteSafe as D}from"./site.js?v=1765440387";import{r as H}from"./useController19.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./index105.js?v=1765440387";import"./validator.js?v=1765440387";import"./useStore5.js?v=1765440387";import"./useMethod5.js?v=1765440387";import"./useController18.js?v=1765440387";import"./useStore14.js?v=1765440387";import"./useController6.js?v=1765440387";const{siteInfo:O}=I();m();const R=c({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>'}],q=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&&E()},B=async t=>{let s={name:O.value.name,path:t?t.path:H.path,refresh:E};t&&(s.row=t),e({title:"".concat(t?"编辑":"添加","文件监视器"),area:47,isAsync:!0,component:()=>a((()=>import("./add-file-monitor.js?v=1765440387")),__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===H.path&&t.site_name===O.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}},L=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(" / ")}},C([{onClick:B,title:"编辑"},{onClick:q,title:"删除"}])]),M={class:"relative p-[16px]"},P=h({__name:"index",setup:e=>(u((()=>{E()})),(e,a)=>{const s=k,o=p,r=i,n=l,m=t,c=j("bt-loading");return _(),y("div",M,[f(m,null,{"header-left":b((()=>[f(s,{type:"primary",onClick:a[0]||(a[0]=t=>g(B)())},{default:b((()=>a[1]||(a[1]=[w("添加监视器")]))),_:1})])),"header-right":b((()=>[f(o,{onRefresh:g(E)},null,8,["onRefresh"])])),content:b((()=>[x(f(r,{ref:"ftpTable",column:g(L),"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(S),class:"ml-[20px] mt-[20px]"},null,8,["options"])])),_:1})])})});export{P as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel