chore: 同步 embed 静态资源(base=/ 修复深链白屏)
二进制 / K8s embed 模式 go:embed 使用 backend/static
This commit is contained in:
1 parent
992e9b2ecc
commit
921b44d6a4
155 files changed
+187
-184
No files matched your search
@@ -0,0 +1 @@
|
||||
import{r,t as y,j as e,B as w,P as le,K as he,D as Q,a as q,b as H,c as K,V as ge,d as Z,a3 as S,a4 as ue,C as Te,Q as je,W as Me,o as Ne,a5 as fe,S as ve}from"./index-BTQygws6.js";import{I as ye}from"./input-C6mE-wO9.js";import{B as j}from"./badge-BsIZhz7S.js";import{C as M,a as N,b,c as C}from"./card-D0oz3NII.js";import{S as we}from"./stat-strip-M_Ng3raR.js";import{S as D,a as I,b as L,c as R,d as n}from"./select-pPlmgAjn.js";import{T as Se,a as be,b as B,c as F}from"./tabs-CH1b5gPd.js";import{L as s}from"./label-8e-EC7mH.js";import{t as O}from"./trace-L8uY5gM3.js";import{S as Ce}from"./search-BDsFve6h.js";import{R as De}from"./refresh-cw-e9vbQhCy.js";import{T as Ie}from"./trending-up-CwtABPES.js";import{C as Le}from"./circle-x-CYoA2i-_.js";import{C as Re}from"./code-BxEc8JAj.js";import{B as Be}from"./box-CHjdSJYg.js";import{Z as Fe}from"./zap-72OjNvOL.js";import{A as Oe}from"./arrow-right-QQqkjfZb.js";import"./index-WFeZT6kc.js";import"./chevron-up-Z8QjN8G2.js";const ea=()=>{const[k,G]=r.useState([]),[p,J]=r.useState([]),[U,A]=r.useState(!1),[f,W]=r.useState(""),[l,X]=r.useState("all"),[h,Y]=r.useState("all"),[g,_]=r.useState("1h"),[ee,ae]=r.useState("traces"),[m,te]=r.useState(null),[o,re]=r.useState(null),[ce,E]=r.useState(!1),[se,$]=r.useState(!1);r.useEffect(()=>{oe()},[g]);const oe=async()=>{await Promise.all([P(),ne()])},P=async()=>{A(!0);try{const a=await O.getTraces({timeRange:g,service:l,status:h});G(a.data||[])}catch{y.error("获取链路数据失败")}finally{A(!1)}},ne=async()=>{try{const a=await O.getServices(g);J(a.data||[])}catch{y.error("获取服务数据失败")}},me=async a=>{try{return(await O.getTraceDetail(a)).data}catch{return y.error("获取链路详情失败"),null}},v=a=>{switch(a){case"success":return e.jsxs(j,{"code-path":"src/components/monitor/trace/TraceManager.tsx:139:16",variant:"default",className:"bg-green-500 gap-1",children:[e.jsx(je,{"code-path":"src/components/monitor/trace/TraceManager.tsx:139:72",className:"w-3 h-3"}),"成功"]});case"error":return e.jsxs(j,{"code-path":"src/components/monitor/trace/TraceManager.tsx:141:16",variant:"destructive",className:"gap-1",children:[e.jsx(Le,{"code-path":"src/components/monitor/trace/TraceManager.tsx:141:63",className:"w-3 h-3"}),"错误"]});case"pending":return e.jsxs(j,{"code-path":"src/components/monitor/trace/TraceManager.tsx:143:16",variant:"outline",className:"gap-1",children:[e.jsx(Te,{"code-path":"src/components/monitor/trace/TraceManager.tsx:143:59",className:"w-3 h-3"}),"进行中"]});default:return e.jsx(j,{"code-path":"src/components/monitor/trace/TraceManager.tsx:145:16",variant:"secondary",children:"未知"})}},ie=a=>{switch(a){case"client":return e.jsx(Oe,{"code-path":"src/components/monitor/trace/TraceManager.tsx:151:29",className:"w-4 h-4"});case"server":return e.jsx(ve,{"code-path":"src/components/monitor/trace/TraceManager.tsx:152:29",className:"w-4 h-4"});case"producer":return e.jsx(Fe,{"code-path":"src/components/monitor/trace/TraceManager.tsx:153:31",className:"w-4 h-4"});case"consumer":return e.jsx(Be,{"code-path":"src/components/monitor/trace/TraceManager.tsx:154:31",className:"w-4 h-4"});default:return e.jsx(Re,{"code-path":"src/components/monitor/trace/TraceManager.tsx:155:23",className:"w-4 h-4"})}},de=a=>{switch(a){case"success":return"bg-green-500";case"error":return"bg-red-500";case"pending":return"bg-yellow-500";default:return"bg-gray-500"}},i=a=>a<1?`${(a*1e3).toFixed(2)}μs`:a<1e3?`${a.toFixed(2)}ms`:`${(a/1e3).toFixed(2)}s`,V=k.filter(a=>{const t=a.traceId.toLowerCase().includes(f.toLowerCase())||a.operationName.toLowerCase().includes(f.toLowerCase()),d=l==="all"||a.serviceName===l,c=h==="all"||a.status===h;return t&&d&&c}),pe=Array.from(new Set(k.map(a=>a.serviceName))),xe=a=>{const t=new Map,d=[];return a.forEach(c=>{t.set(c.spanId,{...c,children:[]})}),a.forEach(c=>{const u=t.get(c.spanId);if(c.parentSpanId&&t.has(c.parentSpanId)){const x=t.get(c.parentSpanId);x.children=x.children||[],x.children.push(u)}else d.push(u)}),d},z=({span:a,level:t,totalDuration:d})=>{const[c,u]=r.useState(!0),x=d>0?a.duration/d*100:0;return e.jsxs("div",{"code-path":"src/components/monitor/trace/TraceManager.tsx:214:7",className:"select-none",children:[e.jsxs("div",{"code-path":"src/components/monitor/trace/TraceManager.tsx:215:9",className:"flex items-center py-2 hover:bg-muted/50 cursor-pointer border-l-2 border-transparent hover:border-blue-500",style:{paddingLeft:`${t*24+12}px`},onClick:()=>{re(a),$(!0)},children:[a.children?.length>0&&e.jsx(w,{"code-path":"src/components/monitor/trace/TraceManager.tsx:221:13",variant:"ghost",size:"sm",className:"h-4 w-4 p-0 mr-1",onClick:T=>{T.stopPropagation(),u(!c)},children:c?e.jsx(Me,{"code-path":"src/components/monitor/trace/TraceManager.tsx:227:27",className:"w-3 h-3"}):e.jsx(Ne,{"code-path":"src/components/monitor/trace/TraceManager.tsx:227:65",className:"w-3 h-3"})}),!a.children?.length&&e.jsx("span",{"code-path":"src/components/monitor/trace/TraceManager.tsx:23Line truncated
|
||||
Reference in new issue
Block a user