chore: 同步最新前端构建产物到 backend/static

This commit is contained in:
Logan.Li committed 2026-06-26 00:02:36 +08:00
1 parent 0b404b4611
commit 9bf35b369c
134 files changed
+480 -2

No files matched your search

@@ -0,0 +1,3 @@
import{i as ce,r as a,j as e,D as xe,a as he,b as _e,c as me,d as ue,L as ge,a3 as De,$ as be,aN as Y,X as ie,f as Te,A as je,B as y,O as fe,aO as Re,G as Me,x as ze}from"./index-CwVkcMR-.js";import{C as W,a as U}from"./card-C5qBu7CR.js";import{I as H}from"./input-B5ad6Rfz.js";import{B as _}from"./badge-DgJ0w7jf.js";import{T as q,a as J,b as E,c as l,d as X,e as o}from"./table-X8m9Cp5H.js";import{t as K,s as Ie,a as V,l as Ee}from"./terminal-CUhviP7m.js";import{x as Ae,a as ve}from"./xterm-DSqgeKvr.js";import{m as $e,a as Be}from"./xterm-utils-slbfdUHf.js";import{M as Fe,a as Pe}from"./minimize-2-Dk2LAAKi.js";import{S as F}from"./search-1PdnG-g5.js";import{R as G}from"./refresh-cw-DM6JPbZg.js";import{P as He}from"./play-_cqG4jyc.js";import{D as Ne}from"./download-BgEJ-n5L.js";const Ke=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],We=ce("octagon-x",Ke);const Ue=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7",key:"10he05"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2",key:"15f7sh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M12 12v-2",key:"fwoke6"}]],qe=ce("timer-off",Ue);const Je=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Xe=ce("timer",Je);function Ge({open:s,onOpenChange:i,sessionId:d}){const n=a.useRef(null),p=a.useRef(null),g=a.useRef(null),[x,w]=a.useState(!1),[T,L]=a.useState(""),[j,A]=a.useState(0);return a.useEffect(()=>{if(!s||!d)return;const r=new Ae.Terminal({cursorBlink:!1,fontSize:13,fontFamily:'Menlo, Monaco, "Courier New", monospace',disableStdin:!0,cols:80,rows:24,theme:{background:"#0a0e14",foreground:"#d6d6d6",cursor:"#0a0e14",selectionBackground:"rgba(255,255,255,0.2)"}}),h=new ve.FitAddon;r.loadAddon(h),p.current=r;let b=!1;return w(!0),L(""),A(0),K.getRecord(d).then(O=>{if(b)return;const z=typeof O=="string"?O:O?.data||O?.record_data||"";if(!z||z.trim()===""){L("No recording data available for this session"),w(!1);return}if(n.current){r.open(n.current);try{h.fit()}catch{}}const m=z.split(`
`).filter(f=>f.trim()),v=[];for(const f of m)try{const S=JSON.parse(f);Array.isArray(S)&&S.length>=3&&v.push({time:S[0],eventType:S[1],data:S[2]})}catch{}if(v.length===0){r.write(z),A(100),w(!1);return}w(!1);const $=v[v.length-1].time;let D=0,I=0;const u=()=>{if(b||D>=v.length){A(100);return}const f=v[D],S=(f.time-I)*1e3;I=f.time,D++;const k=Math.min(S,2e3);g.current=setTimeout(()=>{b||(r.write(f.data),A(Math.round(f.time/$*100)),u())},k)};u()}).catch(O=>{b||(console.error("[Replay] Load failed:",O),L("Failed to load recording data"),w(!1))}),()=>{b=!0,g.current&&clearTimeout(g.current);try{r.dispose()}catch{}p.current=null}},[s,d]),e.jsx(xe,{"code-path":"src/components/system/ReplayDialog.tsx:153:5",open:s,onOpenChange:i,children:e.jsxs(he,{"code-path":"src/components/system/ReplayDialog.tsx:154:7",showOverlay:!1,className:"bg-slate-900 border-slate-800 p-0 gap-0",style:{maxWidth:"900px",width:"90vw"},children:[e.jsxs(_e,{"code-path":"src/components/system/ReplayDialog.tsx:155:9",className:"px-4 py-3 border-b border-slate-800",children:[e.jsxs(me,{"code-path":"src/components/system/ReplayDialog.tsx:156:11",className:"text-slate-100 text-base flex items-center gap-2",children:["Terminal Replay #",d??"",j>0&&j<100&&e.jsxs("span",{"code-path":"src/components/system/ReplayDialog.tsx:159:15",className:"text-xs text-slate-500 font-normal ml-2",children:[j,"%"]})]}),e.jsx(ue,{"code-path":"src/components/system/ReplayDialog.tsx:162:11",className:"text-slate-500 sr-only",children:"Replay recorded terminal output"})]}),e.jsxs("div",{"code-path":"src/components/system/ReplayDialog.tsx:164:9",className:"relative bg-[#0a0e14]",style:{height:"460px"},children:[x&&e.jsx("div",{"code-path":"src/components/system/ReplayDialog.tsx:166:13",className:"absolute inset-0 z-10 flex items-center justify-center bg-black/40",children:e.jsx(ge,{"code-path":"src/components/system/ReplayDialog.tsx:167:15",className:"h-6 w-6 animate-spin text-blue-400"})}),T&&e.jsx("div",{"code-path":"src/components/system/ReplayDialog.tsx:171:13",className:"absolute inset-0 z-10 flex items-center justify-center bg-black/40",children:e.jsx("p",{"code-path":"src/components/system/ReplayDialog.tsx:172:15",className:"text-red-400 text-sm",children:T})}),j>0&&j<100&&e.jsx("div",{"code-path":"src/components/system/ReplayDialog.tsx:176:13",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-slate-800 z-10",children:e.jsx("div",{"code-path":"src/components/system/ReplayDialog.tsx:177:15",className:"h-full bg-blue-500 transition-all duration-300",style:{width:`${j}%`}})}),e.jsx("div",{"code-path":"src/components/system/ReplayDialog.tsx:183:11",ref:n,className:"absolute inset-0 p-1"})]})]})})}function Ve({open:s,onOpenChange:i,sessionId:d,sessionInfo:n}){const p=a.useRef(null),g=a.useRef(null),x=a.useRef(null),w=a.useRef(null),[T,L]=a.useState(!1),[j,A]=a.useState(""),[r,h]=a.useState(n||null),[b,O]=a.useState(!1);a.useEffect(()=>{s||(L(!1),A(""),O(!1))},[s]),a.useEffect(()=>{if(!s||!d)return;L(!1),A("");const m=new Ae.Terminal({cursorBlink:!1,fontSize:13,fontFamily:'Menlo, Monaco, "Courier New", monospace',disableStdin:!0,allowProposedApi:!0,scrollback:5e3,theme:{background:"#0a0e14",foreground:"#d6d6d6",cursor:"#d6d6d6",selectionBackground:"rgba(255,255,255,0.2)"}}),v=new ve.FitAddon;m.loadAddon(v),g.current=m,x.current=v;const $=De.getState().token||localStorage.getItem("token")||(()=>{try{return JSON.parse(localStorage.getItem("user-storage")||"{}")?.state?.token||""}catch{return""}})(),I=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/audit/${d}?token=${encodeURIComponent($)}`,u=new WebSocket(I);w.current=u;let f=!1;u.onopen=()=>{f=!0,L(!0),A(""),$e(m,v,()=>p.current),m.writeln("\x1B[36m[审计监控] 已连接到会话...\x1B[0m")},u.onmessage=k=>{try{const C=JSON.parse(k.data);switch(C.type){case"session_info":h(C.payload),m.writeln(`\x1B[36m用户: ${C.payload.username} 服务器: ${C.payload.server_name} (${C.payload.server_ip})\x1B[0m`);break;case"history":C.data&&m.write(C.data);break;case"output":C.data&&m.write(C.data);break}}catch{}},u.onerror=()=>A("WebSocket 连接失败"),u.onclose=k=>{f||A(`连接失败 (code=${k.code}): ${k.reason||"认证失败或网络问题"}`),L(!1),m.writeln(`\r
\x1B[33m[审计监控] 连接已断开\x1B[0m`)};const S=setTimeout(()=>{f||(A("连接超时 — 请确认已登录且有活跃会话"),u.close())},5e3);return()=>{clearTimeout(S),u.close(),m.dispose(),g.current=null,x.current=null,w.current=null,L(!1)}},[s,d]),a.useEffect(()=>{if(!s)return;let m,v=0;const $=()=>{const D=p.current,I=x.current,u=g.current;if(!D||!I||!u){v++<30&&requestAnimationFrame($);return}m=Be(D,I,u)};return $(),()=>m?.()},[s,d,b]);const z=m=>m?new Date(m).toLocaleString():"--";return e.jsx(xe,{"code-path":"src/components/system/LiveMonitorDialog.tsx:180:5",open:s,onOpenChange:i,children:e.jsxs(he,{"code-path":"src/components/system/LiveMonitorDialog.tsx:181:7",showCloseButton:!1,showOverlay:!1,className:be("bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] p-0 gap-0","!duration-0 !transition-none",b?"!max-w-none !w-screen !h-screen !rounded-none !translate-x-0 !translate-y-0 !left-0 !top-0":""),style:b?{maxWidth:"100vw",width:"100vw",height:"100vh"}:{maxWidth:"960px",width:"92vw"},children:[e.jsx(me,{"code-path":"src/components/system/LiveMonitorDialog.tsx:197:9",className:"sr-only",children:"终端实时监控"}),e.jsx(ue,{"code-path":"src/components/system/LiveMonitorDialog.tsx:198:9",className:"sr-only",children:"审计在线 WebSSH 会话"}),e.jsxs("div",{"code-path":"src/components/system/LiveMonitorDialog.tsx:201:9",className:"flex items-center justify-between px-4 py-2 border-b border-[var(--dg-border)]",children:[e.jsxs("div",{"code-path":"src/components/system/LiveMonitorDialog.tsx:202:11",className:"flex items-center gap-2 text-sm min-w-0 flex-wrap",children:[e.jsx(Y,{"code-path":"src/components/system/LiveMonitorDialog.tsx:203:13",className:"h-4 w-4 text-emerald-400 shrink-0"}),e.jsx("span",{"code-path":"src/components/system/LiveMonitorDialog.tsx:204:13",className:"text-[var(--dg-text-primary)] font-medium",children:"终端实时监控"}),r&&e.jsxs("span",{"code-path":"src/components/system/LiveMonitorDialog.tsx:206:15",className:"text-[var(--dg-text-muted)] truncate",children:[r.username," · ",r.server_name," (",r.server_ip,") · ",z(r.start_time)]}),T&&e.jsx(_,{"code-path":"src/components/system/LiveMonitorDialog.tsx:211:15",variant:"outline",className:"border-emerald-500/30 text-emerald-400 bg-emerald-500/10 text-xs",children:"● 在线"}),!T&&!j&&e.jsxs(_,{"code-path":"src/components/system/LiveMonitorDialog.tsx:216:15",variant:"outline",className:"border-yellow-500/30 text-yellow-400 bg-yellow-500/10 text-xs",children:[e.jsx(ge,{"code-path":"src/components/system/LiveMonitorDialog.tsx:217:17",className:"h-3 w-3 animate-spin mr-1"}),"连接中"]}),j&&e.jsx(_,{"code-path":"src/components/system/LiveMonitorDialog.tsx:222:15",variant:"outline",className:"border-red-500/30 text-red-400 bg-red-500/10 text-xs",children:"连接失败"})]}),e.jsxs("div",{"code-path":"src/components/system/LiveMonitorDialog.tsx:227:11",className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{"code-path":"src/components/system/LiveMonitorDialog.tsx:228:13",type:"button",onClick:()=>O(!b),className:"p-1.5 rounded hover:bg-[var(--dg-bg-hover)] text-[var(--dg-text-secondary)]",title:b?"退出全屏":"全屏",children:b?e.jsx(Fe,{"code-path":"src/components/system/LiveMonitorDialog.tsx:234:29",className:"h-4 w-4"}):e.jsx(Pe,{"code-path":"src/components/system/LiveMonitorDialog.tsx:234:65",className:"h-4 w-4"})}),e.jsx("button",{"code-path":"src/components/system/LiveMonitorDialog.tsx:236:13",type:"button",onClick:()=>i(!1),className:"p-1.5 rounded hover:bg-[var(--dg-bg-hover)] text-[var(--dg-text-secondary)]",children:e.jsx(ie,{"code-path":"src/components/system/LiveMonitorDialog.tsx:241:15",className:"h-4 w-4"})})]})]}),j&&e.jsx("p",{"code-path":"src/components/system/LiveMonitorDialog.tsx:247:11",className:"text-sm text-red-400 px-4 py-2 border-b border-[var(--dg-border)]",children:j}),e.jsx("div",{"code-path":"src/components/system/LiveMonitorDialog.tsx:250:9",ref:p,className:"xterm-terminal-host",style:{height:b?"calc(100vh - 49px)":"520px"}})]})})}function ye(s){if(!s||s<0)return"--";if(s<60)return`${s}秒`;const i=Math.floor(s/60),d=s%60;if(i<60)return`${i}分${d>0?`${d}秒`:""}`;const n=Math.floor(i/60),p=i%60;return`${n}时${p>0?`${p}分`:""}`}function Qe(s){return s?s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(2)} MB`:"0 B"}function Le(s){return s==="active"?e.jsxs(_,{"code-path":"src/pages/TerminalAuditTab.tsx:86:7",variant:"outline",className:"border-emerald-500/30 text-emerald-400 bg-emerald-500/10",children:[e.jsx("span",{"code-path":"src/pages/TerminalAuditTab.tsx:87:9",className:"w-1.5 h-1.5 rounded-full bg-emerald-400 mr-1.5 inline-block animate-pulse"}),"活动中"]}):s==="failed"?e.jsx(_,{"code-path":"src/pages/TerminalAuditTab.tsx:94:7",variant:"outline",className:"border-red-500/30 text-red-400 bg-red-500/10",children:"失败"}):e.jsx(_,{"code-path":"src/pages/TerminalAuditTab.tsx:100:5",variant:"outline",className:"border-sl Line truncated