import{R as a,d_ as t,P as e,n as o,Q as r,p as n,l as s}from"./utils-lib.js?v=1761009159";import{_ as i}from"./index105.js?v=1761009159";import{c as l,r as m,e as c,C as p,q as _,H as d,v as u,x as b,B as f,I as h,y as j,G as w}from"./base-lib.js?v=1761009159";import{ad as g,ae as y,af as k}from"./firewall.js?v=1761009159";import{u as v}from"./column.js?v=1761009159";import{m as E,o as C}from"./useMethod6.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./useStore5.js?v=1761009159";import"./validator.js?v=1761009159";const D=l({__name:"index",setup(l){const D=m(!1),x=m(),A=async()=>{await e({loading:D,request:g(),data:[Array,x]})},R=()=>{o({title:"自定义词库",area:44,component:()=>r(()=>import("./own-thesaurus.js?v=1761009159"),__vite__mapDeps([]),import.meta.url)})},I=a=>{o({title:"添加监控",area:68,showFooter:!0,compData:{...a,refreshEvent:A},component:()=>r(()=>import("./add-monitor.js?v=1761009159"),__vite__mapDeps([]),import.meta.url)})},L=[{label:"监控名",prop:"name"},{label:"网站/URL",prop:"url"},{label:"监控方式",prop:"method",render:a=>E[a.method]},{label:"上一次检测时间",minWidth:110,render:e=>a(e.last_scan_time)&&!e.last_scan_time.length?"未检测":e.last_scan_time?t(e.last_scan_time):"未检测"},{label:"上一次风险",minWidth:90,render:a=>[a.last_risk_count>0?c("span",{class:"bt-link !text-danger",onClick:()=>C(a)},[a.last_risk_count]):c("span",null,[p("无风险")])]},{label:"计划任务状态",prop:"crontab_status",minWidth:100,render:a=>[1===a.crontab_status?c("span",null,[p("正常")]):c("span",{style:"color:var(--el-color-warning);cursor:pointer",onClick:()=>(a=>o({isAsync:!0,title:"修复计划任务【".concat(a.name,"】"),area:64,component:()=>r(()=>import("./repair-crontab.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),compData:{...a,refreshEvent:A},showFooter:!0}))(a)},[p("未设置")])]},{label:"发送告警",prop:"send_msg",render:a=>c("span",{style:"color:".concat(1===a.send_msg?"var(--el-color-primary)":"var(--el-color-warning)",";cursor:pointer"),onClick:()=>I(a)},[1===a.send_msg?"已开启":"未开启"])},{label:"检测频率",prop:"crontab_info",render:a=>a.crontab_info?a.crontab_info.cycle:a.crontab_info},v([{onClick:async a=>{var t;const n=await e({request:k({id:a.id})});o({title:"检测详情",area:[64,50],btn:["停止检测"],component:()=>r(()=>import("./scan-details.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),compData:{name:a.name,id:a.id,path_info:null==(t=n.data)?void 0:t.path_info}})},title:"立即检测",width:70},{onClick:I,title:"编辑"},{onClick:async a=>{await n({icon:"warning-filled",title:"删除监控【"+a.name+"】",width:"34rem",content:"删除后无法继续监控该网站，是否继续？"}),await e({loading:"正在删除监控，请稍后...",request:y({id:a.id}),message:!0}),A()},title:"删除"}])];return _(()=>A()),(a,t)=>{const e=w,o=s,r=i,n=d("bt-loading");return u(),b("div",null,[c(r,null,{"header-left":f(()=>[c(e,{type:"primary",onClick:t[0]||(t[0]=a=>I())},{default:f(()=>t[1]||(t[1]=[p("添加监控",-1)])),_:1,__:[1]}),c(e,{onClick:R},{default:f(()=>t[2]||(t[2]=[p("自定义词库",-1)])),_:1,__:[2]})]),content:f(()=>[h(c(o,{ref:"portTable",column:L,data:j(x),description:"监控列表为空"},null,8,["data"]),[[n,j(D)],[n,"正在加载监控列表，请稍后...","title"]])]),popup:f(()=>t[3]||(t[3]=[])),_:1})])}}});export{D as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
