← Back
Editing: index51.js
import{u as e,a6 as a,cZ as t,a7 as l,$ as s,J as r,K as o,l as n,L as i,o as u,ag as c,al as m,e as d}from"./utils-lib.js?v=1765440387";import{c as p,q as y,M as g,A as v,e as f,B as h,x as _,D as w,s as b,G as x,v as V,y as L,C as S,H as C,K as k,am as A,aR as j,T as D,b7 as O,r as T,p as E,P as R}from"./base-lib.js?v=1765440387";import{L as W,p as P}from"./useStore5.js?v=1765440387";import{u as M,A as F}from"./index313.js?v=1765440387";import{_ as H}from"./index93.js?v=1765440387";import{L as I,u as J,d as N,a as U}from"./useController8.js?v=1765440387";import{_ as z}from"./index113.js?v=1765440387";import{_ as B}from"./index106.js?v=1765440387";import{p as K}from"./validator.js?v=1765440387";const Y=p({__name:"index",setup(s,{expose:r}){e();const o=I(),{getOperateLog:n,outLogs:i}=o,{isRefreshList:u}=J(),{BtTable:c,BtPage:m,BtSearch:d,BtRefresh:p,refresh:b}=a({request:e=>{const{search:a,...t}=e;return n({keywords:a,...t,stype:"网站管理"})},columns:[{label:"用户",prop:"username",width:180},{label:"操作类型",prop:"type",width:100},{label:"详情",render:function(e){const a=(new DOMParser).parseFromString(e.log,"text/html");return f("span",{innerHTML:t(a.body.innerHTML)},null)}},{label:"操作时间",width:150,prop:"addtime",align:"right"}],extension:[l(u)]});return r({init:b}),(e,a)=>{const t=w,l=H;return y(),g(l,null,{"header-left":v(()=>[f(t,{onClick:_(i)},{default:v(()=>[...a[0]||(a[0]=[h("导出日志",-1)])]),_:1},8,["onClick"])]),"header-right":v(()=>[f(_(d),{class:"mr-1rem !w-[24rem]",placeholder:"请输入搜索关键字"}),f(_(p))]),content:v(()=>[f(_(c))]),"footer-right":v(()=>[f(_(m))]),_:1})}}}),q={class:"flex flex-col"},G={class:"flex items-center justify-end mb-[12px]"},Z={class:"flex justify-between w-full flex-wrap"},$={class:"flex items-center"},Q={class:"pl-[1rem] mr-[8px]"},X={class:"flex items-center mt-4px"},ee={class:"ml-1rem"},ae=p({__name:"index",setup(a,{expose:t}){const{mainHeight:l}=e(),o=I(),{logParams:n,logMsg:i,preLoading:u}=b(o),c=[{label:"运行日志",value:"access"},{label:"异常日志",value:"error"}];return t({init:()=>Pe("WebLogs")}),(e,a)=>{const t=w,o=A,m=j,d=D,p=s,b=O,T=r,E=z,R=x("bt-loading");return y(),V("div",q,[L("div",G,[L("div",Z,[L("div",$,[f(t,{type:"default",onClick:_(Ce)},{default:v(()=>[...a[6]||(a[6]=[h(" 清理日志 ",-1)])]),_:1},8,["onClick"]),f(t,{type:"default",class:"!mr-[8px]",onClick:_(ke)},{default:v(()=>[...a[7]||(a[7]=[h(" 导出日志 ",-1)])]),_:1},8,["onClick"]),f(o,{modelValue:_(n).keywordSwitch,"onUpdate:modelValue":a[0]||(a[0]=e=>_(n).keywordSwitch=e),width:36,onChange:_(De)},null,8,["modelValue","onChange"]),L("span",Q,[f(m,{content:"点击开启日志关键词告警",placement:"top"},{default:v(()=>[...a[8]||(a[8]=[L("span",null,[L("span",{class:"lt-xl:hidden"},"关键词"),h("告警 ")],-1)])]),_:1}),L("span",{class:"cursor-pointer text-primary",onClick:a[1]||(a[1]=(...e)=>_(je)&&_(je)(...e))}," [配置] ")]),"access"===_(n).typeValue?(y(),g(d,{key:0,modelValue:_(n).ipArea,"onUpdate:modelValue":a[2]||(a[2]=e=>_(n).ipArea=e),class:"pr-[2rem]",onChange:_(Oe)},{default:v(()=>[...a[9]||(a[9]=[L("div",{class:"flex items-center"},[L("span",{class:"text-[1.2rem]"},"显示IP归属地"),L("i",{class:"svgtofont-icon-ltd text-[#9F834F] !text-[2rem]"})],-1)])]),_:1},8,["modelValue","onChange"])):S("",!0)]),L("div",X,[f(p,{type:"button",size:"default",class:"mr-1rem",modelValue:_(n).typeValue,"onUpdate:modelValue":a[3]||(a[3]=e=>_(n).typeValue=e),onChange:_(Ae),options:c},null,8,["modelValue","onChange"]),f(b,{modelValue:_(n).timeValue,"onUpdate:modelValue":a[4]||(a[4]=e=>_(n).timeValue=e),format:"YYYY/MM/DD","value-format":"x",onChange:_(Ae),type:"daterange","range-separator":"-","disabled-date":_(Se),"start-placeholder":"开始",class:"!lt-xl:w-[12rem] !at-lg:w-[12rem] !at-xl:w-[12rem] !w-[20rem]","end-placeholder":"结束"},null,8,["modelValue","onChange","disabled-date"]),L("div",ee,[f(T,{class:"!lt-xl:w-[16rem] !w-[24rem]",modelValue:_(n).searchValue,"onUpdate:modelValue":a[5]||(a[5]=e=>_(n).searchValue=e),placeholder:"请输入搜索关键字",onSearch:_(Ae)},null,8,["modelValue","onSearch"])]),f(E,{class:"ml-1rem",onRefresh:_(Ae)},null,8,["onRefresh"])])])]),C(f(B,{content:_(i),isHtml:!0,autoScroll:!0,fullScreen:{title:"全屏查看-日志",onRefresh:()=>_(Pe)("WebLogs")},style:k("height:"+(_(l)-292)+"px;min-height:400px;")},null,8,["content","fullScreen","style"]),[[R,_(u)]])])}}}),{selectedWebSite:te,webTabActive:le,outDataForm:se,configData:re}=b(W()),{clearWebLogEvent:oe,outWebLogEvent:ne,setKeyWordConfigEvent:ie,onConfirmKeyConfig:ue,getKeywordAlarmData:ce,delLogSourceEvent:me,sendSourceConfirm:de,getLogSystemSite:pe,getSiteLogsData:ye,logSystemConfirm:ge}=I(),{logParams:ve,isRefreshLogSystem:fe,isRefreshList:he,logSystemList:_e}=J(),{payment:we}=e(),{isRefreshList:be,routeData:xe}=M(),Ve=[{label:"网站日志",name:"WebLogs",lazy:!0,render:()=>f(ae,null,null)},{label:"操作日志",name:"OperateLog",lazy:!0,render:()=>f(Y,null,null)},{label:"web日志分析",name:"WebLogAnalysis",lazy:!0,render:()=>f(F,null,null)}],Le=T([]),Se=e=>e.getTime()>Date.now(),Ce=()=>{n({title:"清理【"+te.value+"】网站日志",area:44,component:()=>i(()=>import("./index311.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),compData:{tips:"清理相关日志可能会导致故障排查困难,请谨慎操作",type:"website",clearEvent:async(e,a)=>{const t=N(e),l=await oe(t,a);return Ae(),l.status}},showFooter:!0})},ke=()=>{se.value.type=W().getType("website"),re.value={type:"website"},n({title:"导出日志",area:44,component:()=>i(()=>import("./index268.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),showFooter:!0,compData:{type:"website"}})},Ae=()=>{const e=(()=>{let e={ip_area:ve.value.ipArea?1:0,siteName:te.value,search:ve.value.searchValue};return ve.value.timeValue&&(ve.value.timeValue[0]=new Date(ve.value.timeValue[0]).setHours(0,0,0,0),ve.value.timeValue[1]=new Date(ve.value.timeValue[1]).setHours(23,59,59,0),e.time_search=JSON.stringify([ve.value.timeValue[0]/1e3,ve.value.timeValue[1]/1e3])),ve.value.searchValue||delete e.search,e})();ye(e),"error"!==ve.value.typeValue&&ce()},je=()=>{n({title:"关键字告警配置",area:62,component:()=>i(()=>import("./keyword-config.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),showFooter:!0})},De=async e=>{const{keywordConfig:a}=ve.value;if((!a.keys.length||!a.channel||!a.cycle)&&e)return ve.value.keywordSwitch=!e,void je();const t={sitename:te.value};e&&(t.cycle=ve.value.keywordConfig.cycle,t.keys=JSON.stringify(ve.value.keywordConfig.keys),t.channel=ve.value.keywordConfig.channel);const{status:l}=await ie(t);l&&(ve.value.keywordSwitch=e)},Oe=e=>{if("ltd"!==we.value.authType)return ve.value.ipArea=!e,K({sourceId:107});Ae()},Te=async(e,a,t)=>{try{await a();const t={cycle:e.value.cycle,channel:e.value.give.join(","),keys:JSON.stringify(e.value.keyword.split(","))},l=await ue(t);return ce(),l.status}catch(l){}},Ee=async e=>{await u({title:"删除【"+e.site_name+"】日志源",icon:"warning-filled",content:"是否删除【"+e.site_name+"】?"});const a={server_id:e.server.id,source_type:e.source_type,source_list:JSON.stringify([e.site_name])};await me(a)},Re=async e=>{var a;try{let t=_e.value.length>0,l={server_data:JSON.stringify({ip:e.ip,port:e.port})};t?l.server_id=null==(a=_e.value[0])?void 0:a.id:l.server_type="bt_log_server";const s=await ge(l);return s.status&&pe(),s.status}catch(t){}},We=async e=>{try{const a={server_id:e.server_id,source_type:"site",source_list:JSON.stringify(e.site)},t=await de(a);return fe.value=!0,t.status}catch(a){}},Pe=e=>{"WebLogs"===e?Ae():"WebLogAnalysis"===e?(be.value=!0,xe.value.name=te.value):he.value=!0},Me={class:"flex items-center mb-[20px]"},Fe={key:0},He=d(p({__name:"index",setup(e){const{selectedWebSite:a,webTabActive:t}=b(W()),l=()=>{n({title:"日志服务系统",area:60,component:()=>i(()=>import("./index312.js?v=1765440387"),__vite__mapDeps([]),import.meta.url)})};return E(async()=>{await(async()=>{const{msg:e}=await o({loading:"正在获取网站列表,请稍后...",request:P(),data:{msg:Array}});return Array.isArray(e)?(te.value=Array.isArray(e)&&e[0]||"",Le.value=e.map(e=>({label:e,value:e})),e):(Le.value=[],[])})(),"WebLogs"===t.value&&Ae()}),(e,s)=>{const r=c,o=w,n=m;return y(),V("div",null,[L("div",Me,[s[6]||(s[6]=h(" 网站: ",-1)),f(r,{modelValue:_(a),"onUpdate:modelValue":s[0]||(s[0]=e=>R(a)?a.value=e:null),options:_(Le),onChange:s[1]||(s[1]=e=>_(Pe)(_(t))),placeholder:"请选择网站",class:"!w-[22rem]",filterable:""},null,8,["modelValue","options"]),"WebLogs"===_(t)?(y(),V("div",Fe,[f(o,{class:"!ml-12px",onClick:l},{default:v(()=>[...s[4]||(s[4]=[h(" 日志服务系统 ",-1)])]),_:1})])):S("",!0),L("div",{class:"flex items-center ml-[16px]",onClick:s[2]||(s[2]=e=>_(U)())},[...s[5]||(s[5]=[L("i",{class:"svgtofont-desired text-[1.6rem]"},null,-1),L("span",{class:"bt-link"},"需求反馈",-1)])])]),f(n,{type:"card",modelValue:_(t),"onUpdate:modelValue":s[3]||(s[3]=e=>R(t)?t.value=e:null),options:_(Ve)},null,8,["modelValue","options"])])}}}),[["__scopeId","data-v-276b29ef"]]),Ie=Object.freeze(Object.defineProperty({__proto__:null,default:He},Symbol.toStringTag,{value:"Module"}));export{Le as a,We as b,Te as c,Ee as d,Ie as i,Re as s}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel