← Back
Editing: index460.js
import{_ as t}from"./index93.js?v=1765440387";import{l as e,L as a,M as s,at as o,o as n,K as r,k as i,W as l}from"./utils-lib.js?v=1765440387";import{_ as p}from"./index113.js?v=1765440387";import{r as c,k as m,U as d,e as f,c as h,p as u,G as _,q as j,v as y,A as b,x,B as g,H as w,D as v}from"./base-lib.js?v=1765440387";import{o as k,u as C}from"./column.js?v=1765440387";import{u as I}from"./useStore3.js?v=1765440387";import{dL as A,g2 as D}from"./site.js?v=1765440387";import{m as H}from"./index421.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./index94.js?v=1765440387";import"./index120.js?v=1765440387";import"./validator.js?v=1765440387";import"./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang.js?v=1765440387";import"./index92.js?v=1765440387";import"./useController5.js?v=1765440387";import"./useController6.js?v=1765440387";const{siteInfo:L}=I();c();const O=m({list:[],load:!1}),R=[{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 n({title:"删除监视器",width:"35rem",icon:"warning-filled",content:"您真的要删除路径【".concat(t.path,"】的监视器吗?")});(await r({loading:"正在删除监视器,请稍后...",request:D({domain:L.value.name,type:t.type,path:t.path}),message:!0})).status&&E()},B=async t=>{let s={name:L.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{O.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===L.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});O.list=t}}catch(t){o(t)}finally{O.load=!1}},P=d([{label:"路径",prop:"path",render:t=>f("div",{class:"truncate bt-link",onClick:()=>{"dir"===t.type&&k({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:"删除"}])]),T={class:"relative p-[16px]"},F=h({__name:"index",setup:e=>(u(()=>{E()}),(e,a)=>{const s=v,o=p,n=i,r=l,c=t,m=_("bt-loading");return j(),y("div",T,[f(c,null,{"header-left":b(()=>[f(s,{type:"primary",onClick:a[0]||(a[0]=t=>x(B)())},{default:b(()=>[...a[1]||(a[1]=[g("添加监视器",-1)])]),_:1})]),"header-right":b(()=>[f(o,{onRefresh:x(E)},null,8,["onRefresh"])]),content:b(()=>[w(f(n,{ref:"ftpTable",column:x(P),"max-height":360,data:x(O).list,description:"暂无数据"},null,8,["column","data"]),[[m,x(O).load],[m,"正在加载中,请稍后...","title"]])]),"footer-left":b(()=>[f(r,{options:x(R),class:"ml-[20px] mt-[20px]"},null,8,["options"])]),_:1})])})});export{F as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel