import{P as a,aH as e,aK as t,b as s,bk as l,bF as n,V as r,n as o,Q as i}from"./utils-lib.js?v=1761009159";import{g as c,b as p,d as u}from"./firewall.js?v=1761009159";import{r as d,o as m,e as w,C as f,aS as v,aD as y,ap as _,ar as h,aq as b,i as k}from"./base-lib.js?v=1761009159";import{u as g,c as j}from"./column.js?v=1761009159";import{g as x}from"./useStore5.js?v=1761009159";import{r as L}from"./validator.js?v=1761009159";const T=s(),{refs:{sshInfo:C,firewallInfo:P}}=x(),O=async()=>{try{const a=await c();C.value=a.data}catch(a){}},S=async()=>{const e=await a({request:p()});P.value={...P.value,...e.data},P.value.ping=!e.data.ping},I=async()=>{const{data:{status:a,init_status:e}}=await u();P.value.status=a||!1,P.value.init_status=(null==e?void 0:e.status)||!1},U=async a=>{let s;try{s=T.load("正在获取插件状态，请稍后...");return(await e({sName:a})).data}catch(l){t(l)}finally{s.close()}},A=d(!1),F=d("初始化防火墙中..."),M=d(null),E=async a=>{M.value=null,A.value=!0,M.value=setInterval(async()=>{const e=await l({num:10,filename:"/www/server/panel/tmp/"+a+".log"});F.value=e.msg.replace(/\n/g,"<br/>"),(e.msg.indexOf("结束")>-1||!e.status)&&(A.value=!1,I(),e.status||T.request(e),clearInterval(M.value))},1e3)},q=m({1:"全站扫描",2:"快速扫描",3:"单URL"}),D=m({title:"标题",body:"网页内",keywords:"关键词",descriptions:"描述",title_update:"标题更新",keywords_update:"关键词更新",description_update:"描述更新",tail_hash_update:"尾部script代码块更新",title_hash_update:"头部head代码块更新"}),H=()=>[{label:"巡检时间",width:150,render:a=>{const e=n(a.time,"number",0);return w("span",null,[r(e)])}},{label:"URL",showOverflowTooltip:!0,render:a=>w("span",{class:"bt-link",title:a.url,onClick:()=>window.open(a.url,"_blank","noopener,noreferrer")},[a.url])},{label:"关键词",prop:"content",width:180},{label:"类型",prop:"risk_content",width:180},{label:"风险位置",width:120,showOverflowTooltip:!0,render:a=>D[a.risk_type]},g([{onClick:N,title:"详情"}])],N=a=>{var e;let t="/www/server/panel/class/projectModel/content/source/",s=t+a.source_file;(null==(e=a.risk_type)?void 0:e.indexOf("_update"))>-1?R(a,t):Q(s,a.content)},R=(a,e)=>{"title_hash_update"!==a.risk_type&&"tail_hash_update"!==a.risk_type||(e="/www/server/panel/class/projectModel/content/hash/"+a.site_name+"/");let t=e+a.new_content_file;Q(t)},Q=(a,e)=>{L(a,"editor","html")},V=a=>{o({title:"风险详情",area:[70,55],component:()=>i(()=>import("./index277.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),compData:a})},K=(a,e,t)=>w("div",null,"link"===e?[a,w("span",{class:"ml-4px bt-ico-ask",onClick:()=>window.open(t,"_blank","noopener,noreferrer")},[f("?")])]:[w("span",null,[a]),w(v,{content:e,placement:"top"},{default:()=>[w("span",{class:"ml-4px bt-ico-ask"},[t||"?"])]})]),z={3306:"MySQL服务默认端口",888:"phpMyAdmin默认端口",22:"SSH远程服务",20:"FTP主动模式数据端口",21:"FTP协议默认端口","39000-40000":"FTP被动模式端口范围","30000-40000":"FTP被动模式端口范围",11211:"Memcached服务端口",873:"rsync数据同步服务",8888:"宝塔Linux面板默认端口"},B=d("ALL"),G=({changePolicy:a,change:e})=>[{label:"策略",render:(e,t)=>w("span",{class:"cursor-pointer",style:"color:".concat("accept"===e.Strategy?"var(--el-color-primary)":"#ef0808"),onClick:()=>a(e)},["accept"==e.Strategy?"放行":"禁止"])},{label:"方向",renderHeader(){var a;const t=[{title:"所有方向",key:"ALL"},{title:"入站",key:"INPUT"},{title:"出站",key:"OUTPUT"}],s=null==(a=t.find(a=>a.key===B.value))?void 0:a.title;return y("div",{class:"flex items-center flex-nowrap"},["",y(_,{onCommand:a=>e(a)},{default:()=>y("span",{class:"text-small flex items-center"},[[w("span",{class:"status-header-text"},[f("状态"),"ALL"===B.value?"":s?"(".concat(s,")"):""])],y("i",{class:"svgtofont-el-arrow-down "})]),dropdown:()=>{let a;return w(b,null,"function"==typeof(e=a=t.map(a=>w(h,{command:a.key},{default:()=>[a.title]})))||"[object Object]"===Object.prototype.toString.call(e)&&!k(e)?a:{default:()=>[a]});var e}})])},render:(a,e)=>"INPUT"===a.Chain?"入站":"出站"}],J=({editEvent:a,deleteEvent:e})=>g([{onClick:a,title:"修改"},{onClick:e,title:"删除"}]),W=async(a,e,t,s,l)=>{await a({title:"批量删除",content:"即将删除所选中的数据，是否继续操作?",column:[s,j()],onConfirm:async()=>(await e(t),l(),!1)})};export{S as a,B as b,O as c,U as d,J as e,W as f,I as g,E as h,H as i,F as l,q as m,V as o,z as p,K as r,A as s,G as u};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
