chore(build): 更新 embed 前端静态资源
同步 ./run.sh build 产出的 backend/static 哈希资源与 index.html。
This commit is contained in:
1 parent
8df0acb338
commit
1fd9a631e5
108 files changed
+142
-139
No files matched your search
@@ -0,0 +1 @@
|
||||
import{r as t,j as e}from"./vendor-codemirror-B1SGo4xl.js";import{C as S,a as C}from"./card-BHSBTtub.js";import{g as Q,i as Y,L,B as Z}from"./index-Bp-M7P_8.js";import{S as j,a as P,b as N,c as f,d}from"./select-DbhcBWnH.js";import{k as y}from"./index-BkulU9RM.js";import{n as ee,f as se,E as te}from"./EventTable-D9T7PrIy.js";import{f as z,t as ne,R as ae,X as F,l as ce}from"./vendor-icons-BWk-DH7F.js";import"./index-5FEebgvX.js";import"./badge-B00SZHvE.js";import"./table-u8V9iTZf.js";import"./k8s-yaml-utils-4KZB_Bq_.js";function M({title:g,items:x,selected:m,onSelect:b,emptyText:l}){const k=Math.max(...x.map(o=>o.count),1);return e.jsx(S,{"code-path":"src/components/kubernetes/EventsPage.tsx:27:5",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:e.jsxs(C,{"code-path":"src/components/kubernetes/EventsPage.tsx:28:7",className:"p-4",children:[e.jsx("h3",{"code-path":"src/components/kubernetes/EventsPage.tsx:29:9",className:"text-sm font-medium text-[var(--dg-text-primary)] mb-3",children:g}),x.length===0?e.jsx("p",{"code-path":"src/components/kubernetes/EventsPage.tsx:31:11",className:"text-xs text-[var(--dg-text-muted)] py-6 text-center",children:l||"暂无数据"}):e.jsx("div",{"code-path":"src/components/kubernetes/EventsPage.tsx:33:11",className:"space-y-1.5 max-h-[220px] overflow-y-auto pr-1",children:x.map(o=>{const h=m===o.name;return e.jsxs("button",{"code-path":"src/components/kubernetes/EventsPage.tsx:37:17",type:"button",className:`w-full flex items-center gap-2 rounded px-2 py-1.5 text-left transition-colors ${h?"bg-[var(--dg-bg-tertiary)]":"hover:bg-[var(--dg-bg-tertiary)]/60"}`,onClick:()=>b?.(h?"":o.name),children:[e.jsx("span",{"code-path":"src/components/kubernetes/EventsPage.tsx:45:19",className:"w-[88px] shrink-0 truncate text-xs text-[var(--dg-text-secondary)]",title:o.name,children:o.name}),e.jsx("div",{"code-path":"src/components/kubernetes/EventsPage.tsx:48:19",className:"flex-1 h-1.5 rounded-full bg-[var(--dg-bg-tertiary)] overflow-hidden",children:e.jsx("div",{"code-path":"src/components/kubernetes/EventsPage.tsx:49:21",className:`h-full rounded-full ${h?"bg-[var(--dg-accent)]":"bg-[var(--dg-text-muted)]/50"}`,style:{width:`${o.count/k*100}%`}})}),e.jsx("span",{"code-path":"src/components/kubernetes/EventsPage.tsx:54:19",className:"w-8 text-right text-xs tabular-nums text-[var(--dg-text-muted)]",children:o.count})]},o.name)})})]})})}function w({label:g,value:x,hint:m}){return e.jsxs("div",{"code-path":"src/components/kubernetes/EventsPage.tsx:67:5",className:"px-4 py-3 border-r border-[var(--dg-border)] last:border-r-0",children:[e.jsx("p",{"code-path":"src/components/kubernetes/EventsPage.tsx:68:7",className:"text-xs text-[var(--dg-text-muted)]",children:g}),e.jsx("p",{"code-path":"src/components/kubernetes/EventsPage.tsx:69:7",className:"text-xl font-semibold tabular-nums text-[var(--dg-text-primary)] mt-0.5",children:x}),m&&e.jsx("p",{"code-path":"src/components/kubernetes/EventsPage.tsx:70:16",className:"text-[10px] text-[var(--dg-text-muted)] mt-0.5",children:m})]})}function ve(){const{clusterCode:g}=Q(),x=Y(),[m,b]=t.useState(!1),[l,k]=t.useState([]),[o,h]=t.useState([]),[U,X]=t.useState([]),[u,q]=t.useState("all"),[E,G]=t.useState("all"),[v,H]=t.useState("0"),[a,W]=t.useState(g||""),[r,D]=t.useState(null),[i,R]=t.useState(""),[p,T]=t.useState("");t.useEffect(()=>{y.getClusters().then(s=>{const c=s?.list||[];if(h(c),!a&&c.length>0){const n=c[0].code||String(c[0].id);W(n),x(`/kubernetes/${n}/events`,{replace:!0})}}).catch(()=>{})},[]),t.useEffect(()=>{a&&y.getNamespaces(a).then(s=>{X(Array.isArray(s)?s:s?.list||s?.data||[])}).catch(()=>{})},[a]);const _=t.useCallback(async()=>{if(a){b(!0);try{const s=u==="all"?void 0:u,c=E==="all"?void 0:E,n=await y.getEvents(a,s,c);k(Array.isArray(n)?n:n?.list||[])}catch{k([])}finally{b(!1)}}},[a,u,E]),$=t.useCallback(async()=>{if(a)try{const s=u==="all"?void 0:u,c=parseInt(v)||void 0,n=await y.getEventsSummary(a,s,c);D(n||null)}catch{D(null)}},[a,u,v]);t.useEffect(()=>{_()},[_]),t.useEffect(()=>{$()},[$]);const V=t.useMemo(()=>{let s=l.map(n=>ee(n));const c=parseInt(v,10);if(c>0){const n=Date.now()-c*3600*1e3;s=s.filter(I=>!I.lastTime||new Date(I.lastTime).getTime()>=n)}return i&&(s=s.filter(n=>n.reason===i)),p&&(s=s.filter(n=>n.objectKind===p||n.object.startsWith(`${p}/`))),s},[l,i,p,v]),J=t.useMemo(()=>l.filter(s=>s.type==="Warning").length,[l]),O=t.useMemo(()=>l.filter(s=>s.type==="Normal").length,[l]),A=t.useMemo(()=>(r?.by_reason||[]).map(s=>({name:s.reason||"Unknown",count:s.count})),[r]),K=t.useMemo(()=>(r?.by_namespace||[]).map(s=>({name:s.namespace||"<cluster>",count:s.count})),[r]),B=t.useMemo(()=>(r?.by_kind||[]).map(s=>({name:s.kind||"Unknown",count:s.count})),[r]);return e.jsxs("div",{"code-path":"src/components/kubernetes/EventsPage.tsx:166:5",className:"space-y-4",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/EventsPage.tsx:167:7",className:"flex items-center gap-2 text-sm text-[var(--dgLine truncated
|
||||
Reference in new issue
Block a user