refactor(q1): src/api 全量清零 any + types/monitor 扩展输入 DTO
ROADMAP Q1 推进(前端类型安全治理 in_progress): - src/api/ 整个目录 any 清零(含 monitor/ deploy/ 子目录 12+ 文件) create/update 入参 any -> Record<string, unknown> / object mock 桩 trace/grafana 对接 types/ 标准类型(Trace/GrafanaDashboard) 典型接口 LdapFormData/ProbeForm 等强类型表单用 object 接收 - types/monitor.ts 扩展 ~150 行接口: ZabbixDatasource / AlertSilence / 7 个输入 DTO Trace / TraceSpan / TraceServiceMetrics / GrafanaDashboard / DashboardPanel HealthProbeInput 验证: - 整个 src/api/ 目录 any=0 - ESLint no-explicit-any: 995 -> 937 (本项目此轮贡献 -58) - tsc -b 零错误, npm run build ✓ (17.06s) - API 回归 8/8 核心端点通过, Docker 部署 healthy
This commit is contained in:
1 parent
480e677042
commit
b553c7956d
436 files changed
+410
-1198
No files matched your search
@@ -0,0 +1 @@
|
||||
import{i as Oe,j as e,I as st,T as Le,a3 as ot,Q as ze,U as ct,D as V,a as H,b as U,c as Q,d as Y,e as ie,B as d,O as Ge,o as at,r as s,t as l,f as $e,C as lt,P as it,as as mt}from"./index-o4rKtKfJ.js";import{I as E}from"./input-BfBi0wR2.js";import{B as v}from"./badge-CDGsL4jH.js";import{C as F,a as J,b as Te,c as _e}from"./card-6Ae5ROGi.js";import{S as dt}from"./stat-strip-DYcHo9Kj.js";import{S as se,a as oe,b as ce,c as ae,d as _}from"./select-DuV0kIrj.js";import{T as pt,a as xt,b as P,c as W}from"./tabs-CoTqT5ed.js";import{S as Ie}from"./switch-Dqj5wqUV.js";import{a as O}from"./alert-BV-5lkdi.js";import{a as R}from"./alert-center-d1Xoi8Bo.js";import{a as ge}from"./agent-BmcTPQds.js";import{Z as ht}from"./zap-BPZOchcR.js";import{L as j}from"./label-DrX9VaVC.js";import{A as ut}from"./AlertRuleDialog-IbIdg7El.js";import{T as gt}from"./textarea-9Podrtqd.js";import{R as re}from"./refresh-cw-eQ6GkWW0.js";import{P as ne}from"./plus-BXcAPnTg.js";import{C as jt}from"./calendar-DgwL_Rib.js";import{S as Ct}from"./square-pen-y4Af_nu2.js";import{T as ft}from"./trash-2-C2Niwqae.js";import{S as vt}from"./search-C_UCkHB_.js";import"./index-BeCACrpC.js";import"./chevron-up-CZcf1jNw.js";import"./message-square-CE152duc.js";import"./phone-C90KJWhC.js";const At=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],Nt=Oe("repeat",At);const yt=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],le=Oe("volume-x",yt);function wt(r){return{id:String(r.id),title:r.rule_name||r.title||`告警 #${r.id}`,description:r.message||r.description||"",severity:r.severity||"info",status:r.status||"firing",source:r.target||r.source||"",service:r.service||"",metric:r.metric||"",value:r.value||0,threshold:r.threshold||0,startedAt:r.started_at||r.startedAt||r.created_at||new Date().toISOString(),resolvedAt:r.resolved_at||r.resolvedAt,labels:typeof r.labels=="string"?(()=>{try{return JSON.parse(r.labels||"{}")}catch{return{}}})():r.labels||{},annotations:typeof r.annotations=="string"?(()=>{try{return JSON.parse(r.annotations||"{}")}catch{return{}}})():r.annotations||{}}}function je(r){switch(r){case"critical":return e.jsxs(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:106:14",variant:"destructive",className:"gap-1",children:[e.jsx(ot,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:106:61",className:"w-3 h-3"}),"严重"]});case"warning":return e.jsxs(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:108:14",variant:"default",className:"bg-orange-500 gap-1",children:[e.jsx(Le,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:108:71",className:"w-3 h-3"}),"警告"]});case"info":return e.jsxs(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:110:14",variant:"default",className:"bg-blue-500 gap-1",children:[e.jsx(st,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:110:69",className:"w-3 h-3"}),"信息"]});default:return e.jsx(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:112:14",variant:"secondary",children:"未知"})}}function bt(r){switch(r){case"firing":return e.jsxs(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:120:14",variant:"destructive",className:"gap-1 animate-pulse",children:[e.jsx(ht,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:120:75",className:"w-3 h-3"}),"触发中"]});case"acknowledged":return e.jsxs(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:122:14",variant:"default",className:"bg-yellow-500 gap-1",children:[e.jsx(ct,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:122:71",className:"w-3 h-3"}),"已确认"]});case"resolved":return e.jsxs(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:124:14",variant:"default",className:"bg-green-500 gap-1",children:[e.jsx(ze,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:124:70",className:"w-3 h-3"}),"已解决"]});case"suppressed":return e.jsxs(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:126:14",variant:"secondary",className:"gap-1",children:[e.jsx(le,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:126:59",className:"w-3 h-3"}),"已静默"]});default:return e.jsx(v,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:128:14",variant:"secondary",children:"未知"})}}function St(r){return{dingtalk:"钉钉",wechat:"企业微信",feishu:"飞书",email:"邮件",sms:"Line truncated
|
||||
Reference in new issue
Block a user