Files
aiops/backend/static/assets/LogCenter-CDEKd-2_.js
T
Logan 8d46e8f352 feat: 新增日志中心、功能优化与代码重构
- 新增 log_datasource.go / log_proxy.go / user_api_token.go 后端控制器
- 新增 log_datasource.go model
- 新增 monitor/log-center.ts API 模块
- 新增 LogCenter 前端组件及页面
- 重构 deployment 相关组件 (HPDA/UpdateImageModal/bundle-yaml 等)
- 新增 ResetPasswordDialog / code-snippet-block / copy-button 等 UI 组件
- 重构多个 k8s 相关组件 (TopologyView/ResourceVisualEditor/PodFileBrowser 等)
- 更新多个 API 和工具函数 (auth.ts/monitor/index.ts/request.ts 等)
- 更新静态资源 (index.html + 新 JS/CSS bundle)
- 删除废弃静态资源文件
2026-06-26 23:18:05 +08:00

2 lines
39 KiB
JavaScript

import{r as t,j as e}from"./vendor-codemirror-B1SGo4xl.js";import{T as me,a as de,b as K,c as M}from"./tabs-CVrkiNvd.js";import{D as Z,a as ee,b as te,c as oe,d as se,e as re,B as j,f as ge,av as xe}from"./index-lgmWPQDG.js";import{I as k}from"./input-DBDfXZx0.js";import{L as p}from"./label-Bzhjv1tR.js";import{T as W}from"./textarea-ym7reYBG.js";import{S as $,a as z,b as B,c as q,d as O}from"./select-Bv_WioDg.js";import{u as _}from"./use-toast-DNZLibQY.js";import{l as T}from"./log-center-Cyw2AhE7.js";import{S as U}from"./switch-BGnej0rz.js";import{L as F,aW as pe,P as H,R as G,z as ne,d as he,T as ue,b5 as ve,aD as ye,I as be,a7 as Le}from"./vendor-icons-BlY7QrxS.js";import{B as R}from"./badge-Ca5YHtna.js";import{C as X,a as Y}from"./card-CdN7vcLa.js";import{a as I}from"./alert-CifuiQtF.js";import{A as je}from"./AlertRuleDialog-B7BGtl_o.js";import"./index-5FEebgvX.js";const ae=t.createContext(null);function fe({children:s}){const[r,o]=t.useState(null),n=t.useCallback(i=>o(i),[]);return e.jsx(ae.Provider,{"code-path":"src/components/monitor/log-center/LogQueryContext.tsx:16:5",value:{context:r,setContext:n},children:s})}function J(){const s=t.useContext(ae);if(!s)throw new Error("useLogQueryContext must be used within LogQueryProvider");return s}function ce({open:s,onOpenChange:r,engine:o,editing:n,onSaved:i}){const{toast:h}=_(),[g,u]=t.useState(""),[d,x]=t.useState(""),[v,N]=t.useState("logstash-*"),[b,P]=t.useState(!1),[Q,c]=t.useState(""),[f,y]=t.useState(""),[m,C]=t.useState(!1),[A,l]=t.useState(!1),[S,a]=t.useState(!1),[D,E]=t.useState(!1);t.useEffect(()=>{s&&(n?(u(n.name),x(n.url),N(n.default_index||"logstash-*"),P(!!n.basic_auth),c(n.basic_auth_user||""),y(""),C(!!n.skip_tls_verify),l(!!n.is_default)):(u(o==="loki"?"Loki":"Elasticsearch"),x(o==="loki"?"http://localhost:3100":"http://localhost:9200"),N("logstash-*"),P(!1),c(""),y(""),C(!1),l(!1)))},[s,n,o]);const w=()=>({name:g.trim(),type:o,url:d.trim(),basic_auth:b,basic_auth_user:Q,basic_auth_pass:f,skip_tls_verify:m,default_index:o==="elasticsearch"?v:void 0,is_default:A}),V=async()=>{E(!0);try{await T.testDatasource(w()),h({title:"连接成功"})}catch(L){h({title:"连接失败",description:L?.message||String(L),variant:"destructive"})}finally{E(!1)}},ie=async()=>{if(!(!g.trim()||!d.trim())){a(!0);try{n?await T.updateDatasource(n.id,w()):await T.createDatasource(w()),h({title:"已保存"}),r(!1),i()}catch(L){h({title:"保存失败",description:L?.message||String(L),variant:"destructive"})}finally{a(!1)}}};return e.jsx(Z,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:103:5",open:s,onOpenChange:r,children:e.jsxs(ee,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:104:7",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] max-w-md max-h-[85vh] overflow-y-auto",children:[e.jsxs(te,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:105:9",children:[e.jsxs(oe,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:106:11",className:"text-[var(--dg-text-primary)]",children:[n?"编辑":"添加",o==="loki"?" Loki":" Elasticsearch"," 数据源"]}),e.jsx(se,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:109:11",className:"text-[var(--dg-text-muted)]",children:"仅保存连接信息,日志本体存储在您的 Loki / ES 集群"})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:113:9",className:"space-y-3 py-1",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:114:11",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:115:13",className:"text-xs text-[var(--dg-text-muted)]",children:"名称"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:116:13",value:g,onChange:L=>u(L.target.value),className:"mt-1 h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:118:11",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:119:13",className:"text-xs text-[var(--dg-text-muted)]",children:"地址"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:120:13",value:d,onChange:L=>x(L.target.value),placeholder:"http://host:port",className:"mt-1 h-9 font-mono text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),o==="elasticsearch"&&e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:123:13",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:124:15",className:"text-xs text-[var(--dg-text-muted)]",children:"默认索引"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:125:15",value:v,onChange:L=>N(L.target.value),className:"mt-1 h-9 font-mono text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:128:11",className:"flex items-center justify-between",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:129:13",className:"text-xs text-[var(--dg-text-muted)]",children:"基础认证"}),e.jsx(U,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:130:13",checked:b,onCheckedChange:P})]}),b&&e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:133:13",className:"grid grid-cols-2 gap-2",children:[e.jsx(k,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:134:15",value:Q,onChange:L=>c(L.target.value),placeholder:"用户名",className:"h-9 text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:135:15",type:"password",value:f,onChange:L=>y(L.target.value),placeholder:"密码",className:"h-9 text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:138:11",className:"flex items-center justify-between",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:139:13",className:"text-xs text-[var(--dg-text-muted)]",children:"跳过 TLS 校验"}),e.jsx(U,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:140:13",checked:m,onCheckedChange:C})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:142:11",className:"flex items-center justify-between",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:143:13",className:"text-xs text-[var(--dg-text-muted)]",children:"设为默认"}),e.jsx(U,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:144:13",checked:A,onCheckedChange:l})]})]}),e.jsxs(re,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:147:9",className:"gap-2",children:[e.jsxs(j,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:148:11",variant:"outline",size:"sm",onClick:V,disabled:D,children:[D?e.jsx(F,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:149:24",className:"h-4 w-4 animate-spin mr-1"}):e.jsx(pe,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:149:76",className:"h-4 w-4 mr-1"}),"测试"]}),e.jsxs(j,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:152:11",size:"sm",onClick:ie,disabled:S,children:[S&&e.jsx(F,{"code-path":"src/components/monitor/log-center/LogDatasourceDialog.tsx:153:24",className:"h-4 w-4 animate-spin mr-1"}),"保存"]})]})]})})}const Ne={error:"bg-red-500/15 text-red-400 border-red-500/30",warn:"bg-amber-500/15 text-amber-400 border-amber-500/30",warning:"bg-amber-500/15 text-amber-400 border-amber-500/30",info:"bg-blue-500/15 text-blue-400 border-blue-500/30",debug:"bg-slate-500/15 text-slate-400 border-slate-500/30"};function le({entries:s,loading:r}){return r?e.jsx("div",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:15:12",className:"text-center py-16 text-[var(--dg-text-muted)] text-sm",children:"查询中..."}):s.length===0?e.jsx("div",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:18:12",className:"text-center py-16 text-[var(--dg-text-muted)] text-sm",children:"暂无日志,调整查询条件后重试"}):e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:21:5",className:"border border-[var(--dg-border)] rounded-lg overflow-hidden",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:22:7",className:"grid grid-cols-[160px_72px_1fr] gap-2 px-3 py-2 bg-[var(--dg-bg-tertiary)]/50 text-[11px] font-medium text-[var(--dg-text-muted)] uppercase",children:[e.jsx("span",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:23:9",children:"时间"}),e.jsx("span",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:24:9",children:"级别"}),e.jsx("span",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:25:9",children:"内容"})]}),e.jsx("div",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:27:7",className:"max-h-[480px] overflow-y-auto divide-y divide-[var(--dg-border)]",children:s.map((o,n)=>e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:29:11",className:"grid grid-cols-[160px_72px_1fr] gap-2 px-3 py-2 text-xs hover:bg-[var(--dg-bg-tertiary)]/30",children:[e.jsx("span",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:30:13",className:"font-mono text-[var(--dg-text-muted)] truncate",title:o.timestamp,children:o.timestamp}),e.jsx("span",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:31:13",children:o.level?e.jsx(R,{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:33:17",variant:"outline",className:`text-[10px] ${Ne[o.level.toLowerCase()]||"border-[var(--dg-border)]"}`,children:o.level}):"—"}),e.jsx("pre",{"code-path":"src/components/monitor/log-center/LogResultsTable.tsx:36:13",className:"font-mono text-[var(--dg-text-secondary)] whitespace-pre-wrap break-all leading-relaxed",children:o.message})]},n))})]})}const De=[{label:"15 分钟",value:"15m"},{label:"1 小时",value:"1h"},{label:"6 小时",value:"6h"},{label:"24 小时",value:"24h"}];function Pe(s){const r=s.match(/^(\d+)(m|h)$/);if(!r)return new Date(Date.now()-36e5).toISOString();const o=parseInt(r[1],10),n=r[2]==="h"?o*36e5:o*6e4;return new Date(Date.now()-n).toISOString()}function Qe(){const{toast:s}=_(),{setContext:r}=J(),[o,n]=t.useState([]),[i,h]=t.useState(""),[g,u]=t.useState('{namespace="default"} |= "error"'),[d,x]=t.useState("1h"),[v,N]=t.useState(200),[b,P]=t.useState([]),[Q,c]=t.useState(!1),[f,y]=t.useState(!1),m=t.useCallback(async()=>{const l=await T.listDatasources("loki").catch(()=>[]),S=Array.isArray(l)?l:[];if(n(S),!i&&S.length){const a=S.find(D=>D.is_default)||S[0];h(String(a.id))}},[i]);t.useEffect(()=>{m()},[m]);const C=t.useCallback((l,S)=>{const a=o.find(D=>String(D.id)===S);r({engine:"loki",datasourceId:a?a.id:void 0,datasourceName:a?.name,query:l,timeRange:d})},[o,d,r]);t.useEffect(()=>{C(g,i)},[g,i,C]);const A=async()=>{if(!(!i||!g.trim())){c(!0);try{const l=await T.queryLoki({datasource_id:Number(i),query:g.trim(),limit:v,start:Pe(d),end:new Date().toISOString()});P(l?.entries||[]),s({title:"查询完成",description:`共 ${l?.total??0} 条`})}catch(l){s({title:"查询失败",description:l?.message||String(l),variant:"destructive"}),P([])}finally{c(!1)}}};return e.jsxs("div",{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:91:5",className:"space-y-4",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:92:7",className:"flex flex-wrap items-end gap-3",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:93:9",className:"min-w-[200px] flex-1",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:94:11",className:"text-xs text-[var(--dg-text-muted)]",children:"数据源"}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:95:11",className:"flex gap-2 mt-1",children:[e.jsxs($,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:96:13",value:i,onValueChange:h,children:[e.jsx(z,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:97:15",className:"h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]",children:e.jsx(B,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:98:17",placeholder:"选择 Loki"})}),e.jsx(q,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:100:15",children:o.map(l=>e.jsxs(O,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:102:19",value:String(l.id),children:[l.name,l.is_default?" (默认)":""]},l.id))})]}),e.jsx(j,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:106:13",variant:"outline",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>y(!0),title:"添加数据源",children:e.jsx(H,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:107:15",className:"h-4 w-4"})}),e.jsx(j,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:109:13",variant:"outline",size:"icon",className:"h-9 w-9 shrink-0",onClick:m,title:"刷新",children:e.jsx(G,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:110:15",className:"h-4 w-4"})})]})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:114:9",className:"w-[120px]",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:115:11",className:"text-xs text-[var(--dg-text-muted)]",children:"时间范围"}),e.jsxs($,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:116:11",value:d,onValueChange:x,children:[e.jsx(z,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:117:13",className:"h-9 mt-1 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]",children:e.jsx(B,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:118:15"})}),e.jsx(q,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:120:13",children:De.map(l=>e.jsx(O,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:121:38",value:l.value,children:l.label},l.value))})]})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:125:9",className:"w-[88px]",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:126:11",className:"text-xs text-[var(--dg-text-muted)]",children:"条数"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:127:11",type:"number",value:v,onChange:l=>N(Number(l.target.value)||200),className:"h-9 mt-1 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs(j,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:129:9",className:"h-9 bg-[var(--dg-blue)] hover:opacity-90",onClick:A,disabled:Q||!i,children:[Q?e.jsx(F,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:130:22",className:"h-4 w-4 animate-spin mr-1"}):e.jsx(ne,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:130:74",className:"h-4 w-4 mr-1"}),"查询"]})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:135:7",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:136:9",className:"text-xs text-[var(--dg-text-muted)]",children:"LogQL"}),e.jsx(W,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:137:9",value:g,onChange:l=>u(l.target.value),rows:3,className:"mt-1 font-mono text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] resize-y",placeholder:'{app="nginx"} |= "error"'}),e.jsxs("p",{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:144:9",className:"text-[10px] text-[var(--dg-text-muted)] mt-1",children:["示例:",'{job="varlogs"}',' | json | level="error" · 单次最多 500 条,不落库']})]}),e.jsx(le,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:149:7",entries:b,loading:Q}),e.jsx(ce,{"code-path":"src/components/monitor/log-center/LokiQueryPanel.tsx:151:7",open:f,onOpenChange:y,engine:"loki",onSaved:m})]})}const Se=[{label:"15 分钟",value:"15m"},{label:"1 小时",value:"1h"},{label:"6 小时",value:"6h"},{label:"24 小时",value:"24h"}];function ke(s){const r=s.match(/^(\d+)(m|h)$/);if(!r)return new Date(Date.now()-36e5).toISOString();const o=parseInt(r[1],10),n=r[2]==="h"?o*36e5:o*6e4;return new Date(Date.now()-n).toISOString()}function Ce(){const{toast:s}=_(),{setContext:r}=J(),[o,n]=t.useState([]),[i,h]=t.useState(""),[g,u]=t.useState("logstash-*"),[d,x]=t.useState("level:error AND message:*timeout*"),[v,N]=t.useState("1h"),[b,P]=t.useState(200),[Q,c]=t.useState([]),[f,y]=t.useState(!1),[m,C]=t.useState(!1),A=t.useCallback(async()=>{const a=await T.listDatasources("elasticsearch").catch(()=>[]),D=Array.isArray(a)?a:[];if(n(D),!i&&D.length){const E=D.find(w=>w.is_default)||D[0];h(String(E.id)),E.default_index&&u(E.default_index)}},[i]);t.useEffect(()=>{A()},[A]);const l=t.useCallback((a,D,E)=>{const w=o.find(V=>String(V.id)===D);r({engine:"elasticsearch",datasourceId:w?w.id:void 0,datasourceName:w?.name,query:a,index:E,timeRange:v})},[o,v,r]);t.useEffect(()=>{l(d,i,g)},[d,i,g,l]);const S=async()=>{if(i){y(!0);try{const a=await T.queryElasticsearch({datasource_id:Number(i),index:g.trim()||void 0,query:d.trim()||"*",size:b,start:ke(v),end:new Date().toISOString()});c(a?.entries||[]),s({title:"查询完成",description:`共 ${a?.total??0} 条`})}catch(a){s({title:"查询失败",description:a?.message||String(a),variant:"destructive"}),c([])}finally{y(!1)}}};return e.jsxs("div",{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:94:5",className:"space-y-4",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:95:7",className:"flex flex-wrap items-end gap-3",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:96:9",className:"min-w-[200px] flex-1",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:97:11",className:"text-xs text-[var(--dg-text-muted)]",children:"数据源"}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:98:11",className:"flex gap-2 mt-1",children:[e.jsxs($,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:99:13",value:i,onValueChange:h,children:[e.jsx(z,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:100:15",className:"h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]",children:e.jsx(B,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:101:17",placeholder:"选择 ES"})}),e.jsx(q,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:103:15",children:o.map(a=>e.jsxs(O,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:105:19",value:String(a.id),children:[a.name,a.is_default?" (默认)":""]},a.id))})]}),e.jsx(j,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:109:13",variant:"outline",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>C(!0),children:e.jsx(H,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:110:15",className:"h-4 w-4"})}),e.jsx(j,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:112:13",variant:"outline",size:"icon",className:"h-9 w-9 shrink-0",onClick:A,children:e.jsx(G,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:113:15",className:"h-4 w-4"})})]})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:117:9",className:"w-[140px]",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:118:11",className:"text-xs text-[var(--dg-text-muted)]",children:"索引"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:119:11",value:g,onChange:a=>u(a.target.value),className:"h-9 mt-1 font-mono text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:121:9",className:"w-[120px]",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:122:11",className:"text-xs text-[var(--dg-text-muted)]",children:"时间范围"}),e.jsxs($,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:123:11",value:v,onValueChange:N,children:[e.jsx(z,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:124:13",className:"h-9 mt-1 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]",children:e.jsx(B,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:125:15"})}),e.jsx(q,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:127:13",children:Se.map(a=>e.jsx(O,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:128:38",value:a.value,children:a.label},a.value))})]})]}),e.jsxs(j,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:132:9",className:"h-9 bg-[var(--dg-blue)] hover:opacity-90",onClick:S,disabled:f||!i,children:[f?e.jsx(F,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:133:22",className:"h-4 w-4 animate-spin mr-1"}):e.jsx(ne,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:133:74",className:"h-4 w-4 mr-1"}),"查询"]})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:138:7",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:139:9",className:"text-xs text-[var(--dg-text-muted)]",children:"Lucene 查询"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:140:9",value:d,onChange:a=>x(a.target.value),className:"mt-1 font-mono text-xs h-10 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]",placeholder:'status:500 AND path:"/api/*"'}),e.jsx("p",{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:146:9",className:"text-[10px] text-[var(--dg-text-muted)] mt-1",children:"支持 Lucene 语法;留空则匹配全部 · 单次最多 500 条,不落库"})]}),e.jsx(le,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:149:7",entries:Q,loading:f}),e.jsx(ce,{"code-path":"src/components/monitor/log-center/EsQueryPanel.tsx:151:7",open:m,onOpenChange:C,engine:"elasticsearch",onSaved:A})]})}function Ae(){const{toast:s}=_(),r=ge(),[o,n]=t.useState([]),[i,h]=t.useState([]),[g,u]=t.useState(!0),[d,x]=t.useState(!1),[v,N]=t.useState(null),b=t.useCallback(async()=>{u(!0);try{const[c,f]=await Promise.all([I.getRules(),I.getNotifyChannels()]),y=c?.list||(Array.isArray(c)?c:[]);n(y.filter(m=>m.type==="log"||m.source==="loki"||m.source==="elasticsearch")),h(f?.list||[])}finally{u(!1)}},[]);t.useEffect(()=>{b()},[b]);const P=async c=>{if(await r({title:"删除规则",description:`删除「${c.name}」?`,variant:"destructive",confirmText:"删除"}))try{await I.deleteRule(c.id),s({title:"已删除"}),b()}catch(y){s({title:"删除失败",description:y?.message||String(y),variant:"destructive"})}},Q={critical:"bg-red-500/15 text-red-400",warning:"bg-amber-500/15 text-amber-400",info:"bg-blue-500/15 text-blue-400"};return e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:57:5",className:"space-y-4",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:58:7",className:"flex items-center justify-between",children:[e.jsx("p",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:59:9",className:"text-sm text-[var(--dg-text-muted)]",children:"仅保存告警策略(LogQL / Lucene),日志数据仍在外部 Loki / ES"}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:60:9",className:"flex gap-2",children:[e.jsxs(j,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:61:11",variant:"outline",size:"sm",onClick:b,disabled:g,children:[e.jsx(G,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:62:13",className:`h-4 w-4 mr-1 ${g?"animate-spin":""}`}),"刷新"]}),e.jsxs(j,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:64:11",size:"sm",onClick:()=>{N(null),x(!0)},children:[e.jsx(H,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:65:13",className:"h-4 w-4 mr-1"}),"新建"]})]})]}),g?e.jsx("div",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:71:9",className:"flex justify-center py-16",children:e.jsx(F,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:71:52",className:"h-6 w-6 animate-spin text-[var(--dg-text-muted)]"})}):o.length===0?e.jsx(X,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:73:9",className:"dg-card",children:e.jsx(Y,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:74:11",className:"py-12 text-center text-[var(--dg-text-muted)] text-sm",children:"暂无日志告警。在 Loki/ES 查询页点击右下角「叮当」可从当前查询快速创建。"})}):e.jsx("div",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:79:9",className:"space-y-2",children:o.map(c=>e.jsx(X,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:81:13",className:"dg-card",children:e.jsxs(Y,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:82:15",className:"py-3 px-4 flex flex-wrap items-center gap-3",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:83:17",className:"flex-1 min-w-[200px]",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:84:19",className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:85:21",className:"font-medium text-[var(--dg-text-primary)]",children:c.name}),e.jsx(R,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:86:21",variant:"outline",className:"text-[10px] border-[var(--dg-border)]",children:c.source||"log"}),e.jsx(R,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:87:21",className:`text-[10px] ${Q[c.severity]||""}`,children:c.severity}),!c.enabled&&c.enabled!==void 0&&e.jsx(R,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:89:23",variant:"outline",className:"text-[10px] text-[var(--dg-text-muted)]",children:"已禁用"})]}),e.jsx("p",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:92:19",className:"text-[11px] font-mono text-[var(--dg-text-muted)] mt-1 truncate",title:c.expression,children:c.expression})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:94:17",className:"flex gap-1 shrink-0",children:[e.jsx(j,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:95:19",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{N(c),x(!0)},children:e.jsx(he,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:96:21",className:"h-3.5 w-3.5"})}),e.jsx(j,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:98:19",variant:"ghost",size:"icon",className:"h-8 w-8 text-red-400",onClick:()=>P(c),children:e.jsx(ue,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:99:21",className:"h-3.5 w-3.5"})})]})]})},c.id))}),e.jsx(je,{"code-path":"src/components/monitor/log-center/LogAlertsPanel.tsx:108:7",open:d,onOpenChange:x,editingRule:v,notifyChannels:i,onSaved:b,defaultType:"log"})]})}function we({open:s,onOpenChange:r,ctx:o,onSaved:n}){const{toast:i}=_(),[h,g]=t.useState(""),[u,d]=t.useState(""),[x,v]=t.useState(""),[N,b]=t.useState("warning"),[P,Q]=t.useState(300),[c,f]=t.useState(!1);t.useEffect(()=>{if(!s||!o)return;const m=o.engine==="loki"?"Loki":"ES";g(`${m} 日志告警`),d(`数据源: ${o.datasourceName||"—"} · 范围: ${o.timeRange||"—"}${o.index?` · 索引: ${o.index}`:""}`),o.engine==="loki"?v(`count_over_time(${Ee(o.query)}[5m]) > 0`):v(o.query||"*")},[s,o]);const y=async()=>{if(!(!h.trim()||!x.trim()||!o)){f(!0);try{await I.createRule({name:h.trim(),description:u.trim(),type:"log",source:o.engine==="loki"?"loki":"elasticsearch",expression:x.trim(),severity:N,duration:P,notify_channels:[]}),i({title:"告警规则已创建",description:"可在「日志告警」Tab 中继续配置通知渠道"}),r(!1),n?.()}catch(m){i({title:"创建失败",description:m?.message||String(m),variant:"destructive"})}finally{f(!1)}}};return e.jsx(Z,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:70:5",open:s,onOpenChange:r,children:e.jsxs(ee,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:71:7",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] max-w-lg max-h-[85vh] overflow-y-auto",children:[e.jsxs(te,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:72:9",children:[e.jsxs(oe,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:73:11",className:"text-[var(--dg-text-primary)] flex items-center gap-2",children:[e.jsx(ve,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:74:13",className:"h-5 w-5 text-amber-400"}),"叮当 · 添加告警"]}),e.jsx(se,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:77:11",className:"text-[var(--dg-text-muted)]",children:"将当前查询条件保存为日志告警规则,命中时触发通知"})]}),o?.query?.trim()?e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:84:11",className:"space-y-3",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:85:13",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:86:15",className:"text-xs text-[var(--dg-text-muted)]",children:"规则名称"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:87:15",value:h,onChange:m=>g(m.target.value),className:"mt-1 h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:89:13",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:90:15",className:"text-xs text-[var(--dg-text-muted)]",children:"描述"}),e.jsx(W,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:91:15",value:u,onChange:m=>d(m.target.value),rows:2,className:"mt-1 text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] resize-none"})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:93:13",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:94:15",className:"text-xs text-[var(--dg-text-muted)]",children:"触发条件"}),e.jsx(W,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:95:15",value:x,onChange:m=>v(m.target.value),rows:4,className:"mt-1 font-mono text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"}),e.jsx("p",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:96:15",className:"text-[10px] text-[var(--dg-text-muted)] mt-1",children:o.engine==="loki"?"LogQL 告警表达式,默认 count_over_time":"ES Lucene 查询,匹配到日志即告警"})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:100:13",className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:101:15",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:102:17",className:"text-xs text-[var(--dg-text-muted)]",children:"级别"}),e.jsxs("select",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:103:17",value:N,onChange:m=>b(m.target.value),className:"w-full h-9 mt-1 px-2 rounded-md bg-[var(--dg-bg-tertiary)] border border-[var(--dg-border)] text-sm",children:[e.jsx("option",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:104:19",value:"info",children:"提示"}),e.jsx("option",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:105:19",value:"warning",children:"警告"}),e.jsx("option",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:106:19",value:"critical",children:"严重"})]})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:109:15",children:[e.jsx(p,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:110:17",className:"text-xs text-[var(--dg-text-muted)]",children:"持续(秒)"}),e.jsx(k,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:111:17",type:"number",value:P,onChange:m=>Q(Number(m.target.value)||300),className:"mt-1 h-9 bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"})]})]}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:114:13",className:"rounded-md bg-[var(--dg-bg-tertiary)]/60 p-2 text-[10px] font-mono text-[var(--dg-text-secondary)] break-all",children:["原始查询: ",o.query]})]}):e.jsx("p",{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:82:11",className:"text-sm text-amber-400/90 py-4",children:"请先在 Loki 或 ES 查询页输入查询语句"}),e.jsxs(re,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:119:9",children:[e.jsx(j,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:120:11",variant:"outline",onClick:()=>r(!1),children:"取消"}),e.jsxs(j,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:121:11",onClick:y,disabled:c||!o?.query?.trim(),children:[c&&e.jsx(F,{"code-path":"src/components/monitor/log-center/LogAlertFromQueryDialog.tsx:122:24",className:"h-4 w-4 animate-spin mr-1"}),"创建规则"]})]})]})})}function Ee(s){const r=s.trim();return r.startsWith("{")?r:`{job=~".+"} |= "${r.replace(/"/g,'\\"')}"`}function Te({onRuleCreated:s}){const{context:r}=J(),[o,n]=t.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogDingAssistant.tsx:14:7",className:"fixed bottom-6 right-6 z-40 flex flex-col items-end gap-2",children:[e.jsx("div",{"code-path":"src/components/monitor/log-center/LogDingAssistant.tsx:15:9",className:"hidden sm:block rounded-lg bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] px-3 py-1.5 text-[11px] text-[var(--dg-text-muted)] shadow-lg opacity-0 hover:opacity-100 transition-opacity pointer-events-none",children:"将当前查询添加为告警"}),e.jsxs(j,{"code-path":"src/components/monitor/log-center/LogDingAssistant.tsx:18:9",size:"lg",className:"h-12 rounded-full shadow-lg bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-400 hover:to-orange-400 text-white gap-2 px-5",onClick:()=>n(!0),title:"叮当 · 添加告警",children:[e.jsx(ye,{"code-path":"src/components/monitor/log-center/LogDingAssistant.tsx:24:11",className:"h-5 w-5"}),e.jsx("span",{"code-path":"src/components/monitor/log-center/LogDingAssistant.tsx:25:11",className:"font-medium",children:"叮当"})]})]}),e.jsx(we,{"code-path":"src/components/monitor/log-center/LogDingAssistant.tsx:28:7",open:o,onOpenChange:n,ctx:r,onSaved:s})]})}function Fe(){return e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogCenterArchBanner.tsx:6:5",className:"flex gap-3 rounded-lg border border-cyan-500/20 bg-cyan-500/5 px-4 py-3 text-xs text-[var(--dg-text-secondary)] leading-relaxed",children:[e.jsx(be,{"code-path":"src/components/monitor/log-center/LogCenterArchBanner.tsx:7:7",className:"h-4 w-4 shrink-0 text-cyan-400 mt-0.5"}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogCenterArchBanner.tsx:8:7",children:[e.jsx("p",{"code-path":"src/components/monitor/log-center/LogCenterArchBanner.tsx:9:9",className:"text-[var(--dg-text-primary)] font-medium mb-1",children:"无状态查询网关"}),e.jsxs("p",{"code-path":"src/components/monitor/log-center/LogCenterArchBanner.tsx:10:9",children:["AIOps 不存储 Loki / Elasticsearch 中的海量日志,仅保存",e.jsx("strong",{"code-path":"src/components/monitor/log-center/LogCenterArchBanner.tsx:11:52",className:"text-[var(--dg-text-primary)] font-normal",children:"数据源连接"}),"与",e.jsx("strong",{"code-path":"src/components/monitor/log-center/LogCenterArchBanner.tsx:12:11",className:"text-[var(--dg-text-primary)] font-normal",children:"告警策略"}),"。查询时实时转发至外部集群,结果仅在当前页面展示,刷新即清空。"]})]})]})}function Xe(){const[s,r]=xe(),o=s.get("tab")||"loki",[n,i]=t.useState(["loki","es","alerts"].includes(o)?o:"loki"),[h,g]=t.useState(0);t.useEffect(()=>{const d=s.get("tab");d&&["loki","es","alerts"].includes(d)&&i(d)},[s]);const u=d=>{const x=d;i(x),r(x==="loki"?{}:{tab:x})};return e.jsx(fe,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:34:5",children:e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogCenter.tsx:35:7",className:"space-y-4 pb-20",children:[e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogCenter.tsx:36:9",className:"flex items-center gap-3",children:[e.jsx("div",{"code-path":"src/components/monitor/log-center/LogCenter.tsx:37:11",className:"h-10 w-10 rounded-xl bg-gradient-to-br from-cyan-500/20 to-blue-500/20 flex items-center justify-center border border-cyan-500/20",children:e.jsx(Le,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:38:13",className:"h-5 w-5 text-cyan-400"})}),e.jsxs("div",{"code-path":"src/components/monitor/log-center/LogCenter.tsx:40:11",children:[e.jsx("h1",{"code-path":"src/components/monitor/log-center/LogCenter.tsx:41:13",className:"text-xl font-bold text-[var(--dg-text-primary)]",children:"日志中心"}),e.jsx("p",{"code-path":"src/components/monitor/log-center/LogCenter.tsx:42:13",className:"text-sm text-[var(--dg-text-muted)]",children:"对接外部 Loki / ES · 实时查询 · 告警策略"})]})]}),e.jsx(Fe,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:46:9"}),e.jsxs(me,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:48:9",value:n,onValueChange:u,children:[e.jsxs(de,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:49:11",className:"bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)]",children:[e.jsx(K,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:50:13",value:"loki",className:"data-[state=active]:bg-cyan-500/10 data-[state=active]:text-cyan-400",children:"Loki 查询"}),e.jsx(K,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:51:13",value:"es",className:"data-[state=active]:bg-amber-500/10 data-[state=active]:text-amber-400",children:"ES 查询"}),e.jsx(K,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:52:13",value:"alerts",className:"data-[state=active]:bg-red-500/10 data-[state=active]:text-red-400",children:"日志告警"})]}),e.jsx(M,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:55:11",value:"loki",className:"mt-4",children:e.jsx(Qe,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:56:13"})}),e.jsx(M,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:58:11",value:"es",className:"mt-4",children:e.jsx(Ce,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:59:13"})}),e.jsx(M,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:61:11",value:"alerts",className:"mt-4",children:e.jsx(Ae,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:62:13"},h)})]}),n!=="alerts"&&e.jsx(Te,{"code-path":"src/components/monitor/log-center/LogCenter.tsx:67:11",onRuleCreated:()=>g(d=>d+1)})]})})}export{Xe as default};