Files
aiops/backend/static/assets/HostMonitor-DC7m51SG.js
T

2 lines
74 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{aX as oe,aY as Ct,aZ as E,a_ as gt,a$ as tt,b0 as ut,b1 as bt,b2 as kt,b3 as re,b4 as rt,b5 as ae,b6 as ce,b7 as Dt,b8 as Bt,r as v,b9 as Qt,ba as jt,i as Ut,j as t,N as ct,B as L,P as ie,C as it,D as Kt,a as zt,b as Wt,c as Gt,d as qt,e as Vt,A as Xt,bb as ne,L as de,S as J,aN as le,I as he,p as pe}from"./index-CwVkcMR-.js";import{a as z}from"./agent-CJbfK8cW.js";import{C as I,a as F}from"./card-C5qBu7CR.js";import{S as Rt,a as Tt,b as Et,c as It,d as at}from"./select-CGtvCG8I.js";import{c as G,T as xe,a as me,b as ge}from"./tabs-Bd_3HnQp.js";import{B as Z}from"./badge-DgJ0w7jf.js";import{R as yt,C as _t,X as Nt,Y as Ht,T as St,N as Yt}from"./generateCategoricalChart-B9iVh1fX.js";import{A as Mt,a as nt}from"./AreaChart-ZFR7lw9c.js";import{R as Jt}from"./refresh-cw-DM6JPbZg.js";import{P as ue}from"./plus-CaJ-dB4A.js";import{C as ft}from"./circle-x-DBoylLde.js";import{S as be}from"./square-pen-C8Ol72WC.js";import{T as fe}from"./trash-2-BPpnm3Sz.js";import{H as Y}from"./hard-drive-CGq_SnM5.js";import{D as xt}from"./disc-nz-uNCoJ.js";import"./index-CBIZnJrN.js";import"./chevron-up-DM77dvsL.js";var ve=class extends oe{constructor(e,s){super(),this.options=s,this.#s=e,this.#r=null,this.#o=Ct(),this.bindMethods(),this.setOptions(s)}#s;#t=void 0;#m=void 0;#e=void 0;#c;#l;#o;#r;#g;#h;#p;#i;#n;#a;#x=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ft(this.#t,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#j(),this.#y(),this.#t.removeObserver(this)}setOptions(e){const s=this.options,o=this.#t;if(this.options=this.#s.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof E(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),s._defaulted&&!gt(this.options,s)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&Ot(this.#t,o,this.options,s)&&this.#d(),this.updateResult(),a&&(this.#t!==o||E(this.options.enabled,this.#t)!==E(s.enabled,this.#t)||tt(this.options.staleTime,this.#t)!==tt(s.staleTime,this.#t))&&this.#u();const l=this.#b();a&&(this.#t!==o||E(this.options.enabled,this.#t)!==E(s.enabled,this.#t)||l!==this.#a)&&this.#f(l)}getOptimisticResult(e){const s=this.#s.getQueryCache().build(this.#s,e),o=this.createResult(s,e);return ye(this,o)&&(this.#e=o,this.#l=this.options,this.#c=this.#t.state),o}getCurrentResult(){return this.#e}trackResult(e,s){return new Proxy(e,{get:(o,a)=>(this.trackProp(a),s?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,a))})}trackProp(e){this.#x.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=this.#s.defaultQueryOptions(e),o=this.#s.getQueryCache().build(this.#s,s);return o.fetch().then(()=>this.createResult(o,s))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#d(e){this.#_();let s=this.#t.fetch(this.options,e);return e?.throwOnError||(s=s.catch(ut)),s}#u(){this.#j();const e=tt(this.options.staleTime,this.#t);if(bt.isServer()||this.#e.isStale||!kt(e))return;const o=re(this.#e.dataUpdatedAt,e)+1;this.#i=rt.setTimeout(()=>{this.#e.isStale||this.updateResult()},o)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#f(e){this.#y(),this.#a=e,!(bt.isServer()||E(this.options.enabled,this.#t)===!1||!kt(this.#a)||this.#a===0)&&(this.#n=rt.setInterval(()=>{(this.options.refetchIntervalInBackground||ae.isFocused())&&this.#d()},this.#a))}#v(){this.#u(),this.#f(this.#b())}#j(){this.#i&&(rt.clearTimeout(this.#i),this.#i=void 0)}#y(){this.#n&&(rt.clearInterval(this.#n),this.#n=void 0)}createResult(e,s){const o=this.#t,a=this.options,l=this.#e,d=this.#c,i=this.#l,n=e!==o?e.state:this.#m,{state:c}=e;let x={...c},u=!1,g;if(s._optimisticResults){const w=this.hasListeners(),T=!w&&Ft(e,s),_=w&&Ot(e,o,s,a);(T||_)&&(x={...x,...ce(c.data,e.options)}),s._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:M,errorUpdatedAt:r,status:R}=x;g=x.data;let A=!1;if(s.placeholderData!==void 0&&g===void 0&&R==="pending"){let w;l?.isPlaceholderData&&s.placeholderData===i?.placeholderData?(w=l.data,A=!0):w=typeof s.placeholderData=="function"?s.placeholderData(this.#p?.state.data,this.#p):s.placeholderData,w!==void 0&&(R="success",g=Dt(l?.data,w,s),u=!0)}if(s.select&&g!==void 0&&!A)if(l&&g===d?.data&&s.select===this.#g)g=this.#h;else try{this.#g=s.select,g=s.select(g),g=Dt(l?.data,g,s),this.#h=g,this.#r=null}catch(w){this.#r=w}this.#r&&(M=this.#r,g=this.#h,r=Date.now(),R="error");const Q=x.fetchStatus==="fetching",$=R==="pending",k=R==="error",W=$&&Q,C=g!==void 0,m={status:R,fetchStatus:x.fetchStatus,isPending:$,isSuccess:R==="success",isError:k,isInitialLoading:W,isLoading:W,data:g,dataUpdatedAt:x.dataUpdatedAt,error:M,errorUpdatedAt:r,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:x.dataUpdateCount>n.dataUpdateCount||x.errorUpdateCount>n.errorUpdateCount,isFetching:Q,isRefetching:Q&&!$,isLoadingError:k&&!C,isPaused:x.fetchStatus==="paused",isPlaceholderData:u,isRefetchError:k&&C,isStale:wt(e,s),refetch:this.refetch,promise:this.#o,isEnabled:E(s.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const w=m.data!==void 0,T=m.status==="error"&&!w,_=b=>{T?b.reject(m.error):w&&b.resolve(m.data)},U=()=>{const b=this.#o=m.promise=Ct();_(b)},P=this.#o;switch(P.status){case"pending":e.queryHash===o.queryHash&&_(P);break;case"fulfilled":(T||m.data!==P.value)&&U();break;case"rejected":(!T||m.error!==P.reason)&&U();break}}return m}updateResult(){const e=this.#e,s=this.createResult(this.#t,this.options);if(this.#c=this.#t.state,this.#l=this.options,this.#c.data!==void 0&&(this.#p=this.#t),gt(s,e))return;this.#e=s;const o=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!this.#x.size)return!0;const d=new Set(l??this.#x);return this.options.throwOnError&&d.add("error"),Object.keys(this.#e).some(i=>{const h=i;return this.#e[h]!==e[h]&&d.has(h)})};this.#N({listeners:o()})}#_(){const e=this.#s.getQueryCache().build(this.#s,this.options);if(e===this.#t)return;const s=this.#t;this.#t=e,this.#m=e.state,this.hasListeners()&&(s?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#N(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function je(e,s){return E(s.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&s.retryOnMount===!1)}function Ft(e,s){return je(e,s)||e.state.data!==void 0&&vt(e,s,s.refetchOnMount)}function vt(e,s,o){if(E(s.enabled,e)!==!1&&tt(s.staleTime,e)!=="static"){const a=typeof o=="function"?o(e):o;return a==="always"||a!==!1&&wt(e,s)}return!1}function Ot(e,s,o,a){return(e!==s||E(a.enabled,e)===!1)&&(!o.suspense||e.state.status!=="error")&&wt(e,o)}function wt(e,s){return E(s.enabled,e)!==!1&&e.isStaleByTime(tt(s.staleTime,e))}function ye(e,s){return!gt(e.getCurrentResult(),s)}var Zt=v.createContext(!1),_e=()=>v.useContext(Zt);Zt.Provider;function Ne(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var He=v.createContext(Ne()),Se=()=>v.useContext(He),Me=(e,s,o)=>{const a=o?.state.error&&typeof e.throwOnError=="function"?Qt(e.throwOnError,[o.state.error,o]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(s.isReset()||(e.retryOnMount=!1))},we=e=>{v.useEffect(()=>{e.clearReset()},[e])},Pe=({result:e,errorResetBoundary:s,throwOnError:o,query:a,suspense:l})=>e.isError&&!s.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Qt(o,[e.error,a])),Ce=e=>{if(e.suspense){const o=l=>l==="static"?l:Math.max(l??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...l)=>o(a(...l)):o(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ke=(e,s)=>e.isLoading&&e.isFetching&&!s,De=(e,s)=>e?.suspense&&s.isPending,Lt=(e,s,o)=>s.fetchOptimistic(e).catch(()=>{o.clearReset()});function Re(e,s,o){const a=_e(),l=Se(),d=jt(),i=d.defaultQueryOptions(e);d.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const h=d.getQueryCache().get(i.queryHash);i._optimisticResults=a?"isRestoring":"optimistic",Ce(i),Me(i,l,h),we(l);const n=!d.getQueryCache().get(i.queryHash),[c]=v.useState(()=>new s(d,i)),x=c.getOptimisticResult(i),u=!a&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(g=>{const M=u?c.subscribe(Bt.batchCalls(g)):ut;return c.updateResult(),M},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),v.useEffect(()=>{c.setOptions(i)},[i,c]),De(i,x))throw Lt(i,c,l);if(Pe({result:x,errorResetBoundary:l,throwOnError:i.throwOnError,query:h,suspense:i.suspense}))throw x.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(i,x),i.experimental_prefetchInRender&&!bt.isServer()&&ke(x,a)&&(n?Lt(i,c,l):h?.promise)?.catch(ut).finally(()=>{c.updateResult()}),i.notifyOnChangeProps?x:c.trackResult(x)}function lt(e,s){return Re(e,ve)}const Te=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]],Ee=Ut("heart-pulse",Te);const Ie=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],At=Ut("list",Ie),q={terminalSessions:e=>["terminal-sessions",e],hostMonitor:{hosts:()=>["host-monitor","hosts"],history:(e,s)=>["host-monitor","history",e,s],probes:e=>["host-monitor","probes",e],portPolicy:e=>["host-monitor","port-policy",e]}};function Pt(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const s=e;if(Array.isArray(s.list))return s.list;if(Array.isArray(s.data))return s.data}return[]}function Fe(){return lt({queryKey:q.hostMonitor.hosts(),queryFn:async()=>{const e=await z.getLatest();return Pt(e)},staleTime:3e4})}function Oe(e,s){return lt({queryKey:q.hostMonitor.history(e,s),queryFn:async()=>{if(!e)return[];const o=await z.getHistory(e,s);return Pt(o)},enabled:!!e,staleTime:3e4})}function Le(e){return lt({queryKey:q.hostMonitor.probes(e),queryFn:async()=>{if(!e)return[];const s=await z.getHealthProbes({hostname:e});return Pt(s)},enabled:!!e})}function Ae(e){return lt({queryKey:q.hostMonitor.portPolicy(e),queryFn:async()=>{if(!e)return{port_filter_mode:"whitelist",port_whitelist:[]};const s=await z.getPortPolicy(e);return{port_filter_mode:s?.data?.port_filter_mode||"blacklist",port_whitelist:s?.data?.port_whitelist||[]}},enabled:!!e})}const mt=[{label:"1小时",hours:1,window:60,buckets:60},{label:"6小时",hours:6,window:300,buckets:72},{label:"12小时",hours:12,window:600,buckets:72},{label:"1天",hours:24,window:1800,buckets:96},{label:"3天",hours:72,window:3600,buckets:72},{label:"7天",hours:168,window:10800,buckets:56},{label:"14天",hours:336,window:21600,buckets:48}],$t=(e="")=>({name:"",hostname:e,probe_type:"http_get",http_url:"",http_method:"GET",http_expect_code:200,http_expect_body:"",tcp_host:"localhost",tcp_port:3306,exec_command:"",timeout:10,interval:60,description:""});function y(e,s,o){if(!e||e.length===0)return[];const a=Math.max(1,Math.ceil(e.length/o)),l=[];for(let d=0;d<e.length;d+=a){const i=e.slice(d,d+a),h=s.slice(d,d+a),c=i.reduce((M,r)=>M+r,0)/i.length,x=Math.max(...i),u=Math.min(...i),g=h[Math.floor(h.length/2)]||0;l.push({time:new Date(g*1e3).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),timestamp:g,avg:Number(c.toFixed(2)),max:Number(x.toFixed(2)),min:Number(u.toFixed(2)),count:i.length})}return l.slice(-o)}function N(e){if(!e)return{};if(typeof e=="object")return e;try{return JSON.parse(e)}catch{return{}}}function dt(e){return e>=1024*1024*1024?`${(e/1024/1024/1024).toFixed(1)} GB/s`:e>=1024*1024?`${(e/1024/1024).toFixed(1)} MB/s`:e>=1024?`${(e/1024).toFixed(1)} KB/s`:`${e.toFixed(1)} B/s`}function $e(e,s){const o=[],a=[],l=[],d=[],i=[],h=[],n=[],c=[],x=[],u=[],g=[],M=[],r=[],R=[],A=[],Q=[],$=[],k=[],W=[],C=[],f=[];for(const m of e){const w=m.report_time?new Date(m.report_time).getTime()/1e3:m.created_at?new Date(m.created_at).getTime()/1e3:0;f.push(w),o.push(m.cpu_usage||0),R.push(m.cpu_iowait||0),a.push(m.mem_usage||0),A.push(m.mem_available||0),l.push(m.load1||0),d.push(m.disk_usage||0);const T=N(m.disk_info);if(Array.isArray(T)&&T.length>0){const j=T.find(H=>H.mount==="/")||T[0];C.push(j?.inode_usage_pct||0)}else C.push(0);const _=N(m.net_info);i.push(_.tcp_established||0),h.push(_.tcp_time_wait||0),n.push(_.tcp_close_wait||0),$.push((_.tcp_established||0)+(_.tcp_time_wait||0)+(_.tcp_close_wait||0)),c.push(_.net_rx_bps||0),x.push(_.net_tx_bps||0),k.push(_.net_rx_errors||0),W.push(_.net_tx_errors||0);const U=N(m.disk_io_info);u.push(U.read_bps||0),g.push(U.write_bps||0),Q.push(U.util||0);const P=N(m.swap_info);M.push(P?.usage_percent||0);const b=N(m.fd_info);r.push(b?.usage_pct||0)}return{cpu:y(o,f,s.buckets),mem:y(a,f,s.buckets),load1:y(l,f,s.buckets),disk:y(d,f,s.buckets),tcpEst:y(i,f,s.buckets),tcpTW:y(h,f,s.buckets),tcpCW:y(n,f,s.buckets),rx:y(c.map(m=>m/1024),f,s.buckets),tx:y(x.map(m=>m/1024),f,s.buckets),ioRead:y(u.map(m=>m/1024),f,s.buckets),ioWrite:y(g.map(m=>m/1024),f,s.buckets),swap:y(M,f,s.buckets),fd:y(r,f,s.buckets),iowait:y(R,f,s.buckets),memAvail:y(A,f,s.buckets),ioUtil:y(Q,f,s.buckets),connTotal:y($,f,s.buckets),rxErr:y(k,f,s.buckets),txErr:y(W,f,s.buckets),inode:y(C,f,s.buckets)}}function Be(e,s,o,a,l,d,i="--"){return e?d==="cpu"?e.cpu_usage!=null?`${e.cpu_usage.toFixed(1)}%`:i:d==="mem"?e.mem_usage!=null?`${e.mem_usage.toFixed(1)}%`:i:d==="disk"?e.disk_usage!=null?`${e.disk_usage.toFixed(1)}%`:i:d==="load1"?e.load1!=null?String(e.load1):i:d==="tcp"?s.tcp_established!=null?String(s.tcp_established):i:d==="tw"?s.tcp_time_wait!=null?String(s.tcp_time_wait):i:d==="rx"?s.net_rx_bps!=null?`${(s.net_rx_bps/1024).toFixed(1)} KB/s`:i:d==="tx"?s.net_tx_bps!=null?`${(s.net_tx_bps/1024).toFixed(1)} KB/s`:i:d==="ioR"?o.read_bps!=null?`${dt(o.read_bps)}`:i:d==="ioW"?o.write_bps!=null?`${dt(o.write_bps)}`:i:d==="swap"?a?.usage_percent!=null?`${a.usage_percent.toFixed(1)}%`:i:d==="fd"&&l?.usage_pct!=null?`${l.usage_pct.toFixed(1)}%`:i:i}function S({title:e,value:s,icon:o,data:a,color:l,unit:d,domain:i,aggType:h}){const n=a.map(c=>({...c,value:c[h]}));return t.jsx(I,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:26:5",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsxs(F,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:27:7",className:"p-3",children:[t.jsx("div",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:28:9",className:"flex items-center justify-between mb-1",children:t.jsxs("div",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:29:11",className:"flex items-center gap-1.5",children:[o,t.jsx("span",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:29:60",className:"text-xs text-[var(--dg-text-primary)] font-medium truncate",children:e})]})}),t.jsxs("div",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:31:9",className:"mb-2",children:[t.jsx("span",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:32:11",className:"text-xl font-bold text-[var(--dg-text-primary)] tabular-nums",children:s}),d&&t.jsx("span",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:33:20",className:"text-xs text-[var(--dg-text-muted)] ml-1",children:d})]}),t.jsx("div",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:35:9",className:"h-48",children:n.length===0?t.jsx("div",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:37:13",className:"h-full flex items-center justify-center text-xs text-[var(--dg-text-muted)] border border-dashed border-[var(--dg-border)] rounded-md",children:"暂无数据"}):t.jsx(yt,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:39:13",width:"100%",height:"100%",children:t.jsxs(Mt,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:40:15",data:n,margin:{top:2,right:2,bottom:0,left:-10},children:[t.jsx("defs",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:41:17",children:t.jsxs("linearGradient",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:42:19",id:`grad-${e}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:43:21",offset:"5%",stopColor:l,stopOpacity:.3}),t.jsx("stop",{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:44:21",offset:"95%",stopColor:l,stopOpacity:0})]})}),t.jsx(_t,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:47:17",strokeDasharray:"3 3",stroke:"#1e293b",strokeOpacity:.5}),t.jsx(Nt,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:48:17",dataKey:"time",hide:!0}),t.jsx(Ht,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:49:17",hide:!0,domain:i[1]==="auto"?[0,c=>c*1.1]:i}),t.jsx(St,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:50:17",contentStyle:{backgroundColor:"#0f172a",border:"1px solid #1e293b",borderRadius:"4px",color:"#f8fafc",fontSize:"11px",padding:"4px 8px"},formatter:c=>[`${c.toFixed(2)} ${d}`,e.replace(/\(.+\)/,"")],labelFormatter:c=>`时间: ${c}`}),t.jsx(nt,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:53:17",type:"monotone",dataKey:"value",stroke:l,strokeWidth:1.5,fill:`url(#grad-${e})`}),t.jsx(Yt,{"code-path":"src/pages/host-monitor/MetricChartCard.tsx:54:17",dataKey:"time",height:24,stroke:"#334155",fill:"#0f172a",startIndex:Math.max(0,n.length-Math.min(20,n.length))})]})})})]})})}function Qe({title:e,currentRx:s,currentTx:o,rxData:a,txData:l,aggType:d,unit:i}){const h=a.map((x,u)=>({time:x.time,timestamp:x.timestamp,rx:x[d]??0,tx:l[u]?.[d]??0})),n=`grad-rx-${e.replace(/\s/g,"")}`,c=`grad-tx-${e.replace(/\s/g,"")}`;return t.jsx(I,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:32:5",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsxs(F,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:33:7",className:"p-3",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:34:9",className:"flex items-center justify-between mb-1",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:35:11",className:"flex items-center gap-1.5",children:[t.jsx(ct,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:36:13",className:"h-4 w-4 text-blue-400"}),t.jsx("span",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:37:13",className:"text-xs text-[var(--dg-text-primary)] font-medium",children:e})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:39:11",className:"flex items-center gap-3 text-xs",children:[t.jsxs("span",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:40:13",children:[t.jsx("span",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:40:19",className:"inline-block w-2.5 h-2.5 rounded-sm bg-blue-400 mr-1 align-middle"}),"接收 ",t.jsx("b",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:40:108",className:"text-blue-300",children:s})]}),t.jsxs("span",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:41:13",children:[t.jsx("span",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:41:19",className:"inline-block w-2.5 h-2.5 rounded-sm bg-emerald-400 mr-1 align-middle"}),"发送 ",t.jsx("b",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:41:111",className:"text-emerald-300",children:o})]})]})]}),t.jsx("div",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:44:9",className:"h-56",children:h.length===0?t.jsx("div",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:46:13",className:"h-full flex items-center justify-center text-xs text-[var(--dg-text-muted)] border border-dashed border-[var(--dg-border)] rounded-md",children:"暂无数据"}):t.jsx(yt,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:48:13",width:"100%",height:"100%",children:t.jsxs(Mt,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:49:15",data:h,margin:{top:2,right:2,bottom:0,left:-10},children:[t.jsxs("defs",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:50:17",children:[t.jsxs("linearGradient",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:51:19",id:n,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:52:21",offset:"5%",stopColor:"#3b82f6",stopOpacity:.3}),t.jsx("stop",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:53:21",offset:"95%",stopColor:"#3b82f6",stopOpacity:0})]}),t.jsxs("linearGradient",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:55:19",id:c,x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:56:21",offset:"5%",stopColor:"#10b981",stopOpacity:.3}),t.jsx("stop",{"code-path":"src/pages/host-monitor/DualLineChart.tsx:57:21",offset:"95%",stopColor:"#10b981",stopOpacity:0})]})]}),t.jsx(_t,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:60:17",strokeDasharray:"3 3",stroke:"#1e293b",strokeOpacity:.5}),t.jsx(Nt,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:61:17",dataKey:"time",hide:!0}),t.jsx(Ht,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:62:17",hide:!0,domain:[0,"auto"]}),t.jsx(St,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:63:17",contentStyle:{backgroundColor:"#0f172a",border:"1px solid #1e293b",borderRadius:"4px",color:"#f8fafc",fontSize:"11px",padding:"4px 8px"},formatter:(x,u)=>[`${x.toFixed(2)} ${i}`,u==="rx"?"接收":"发送"],labelFormatter:x=>`时间: ${x}`}),t.jsx(nt,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:66:17",type:"monotone",dataKey:"rx",stroke:"#3b82f6",strokeWidth:1.5,fill:`url(#${n})`,name:"rx"}),t.jsx(nt,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:67:17",type:"monotone",dataKey:"tx",stroke:"#10b981",strokeWidth:1.5,fill:`url(#${c})`,name:"tx"}),t.jsx(Yt,{"code-path":"src/pages/host-monitor/DualLineChart.tsx:68:17",dataKey:"time",height:24,stroke:"#334155",fill:"#0f172a",startIndex:Math.max(0,h.length-Math.min(20,h.length))})]})})})]})})}function Ue({selectedHost:e}){const s=jt(),{data:o=[],refetch:a}=Le(e),[l,d]=v.useState(!1),[i,h]=v.useState(null),[n,c]=v.useState($t()),x=()=>{h(null),c($t(e)),d(!0)},u=r=>{h(r),c({name:String(r.name||""),hostname:String(r.hostname||""),probe_type:String(r.probe_type||"http_get"),http_url:String(r.http_url||""),http_method:String(r.http_method||"GET"),http_expect_code:Number(r.http_expect_code)||200,http_expect_body:String(r.http_expect_body||""),tcp_host:String(r.tcp_host||""),tcp_port:Number(r.tcp_port)||3306,exec_command:String(r.exec_command||""),timeout:Number(r.timeout)||10,interval:Number(r.interval)||60,description:String(r.description||"")}),d(!0)},g=async()=>{if(!(!n.name||!n.hostname))try{i?await z.updateHealthProbe(i.id,n):await z.createHealthProbe(n),d(!1),s.invalidateQueries({queryKey:q.hostMonitor.probes(e)})}catch{alert("保存失败")}},M=async r=>{confirm(`确定删除探针"${r.name}"?`)&&(await z.deleteHealthProbe(r.id),s.invalidateQueries({queryKey:q.hostMonitor.probes(e)}))};return t.jsxs(t.Fragment,{children:[t.jsxs(G,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:80:7",value:"health_probes",className:"mt-3 space-y-3",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:81:9",className:"flex items-center justify-between",children:[t.jsx("h3",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:82:11",className:"text-xs font-medium text-[var(--dg-text-primary)]",children:"探针列表(Agent 在目标主机本地执行探测)"}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:83:11",className:"flex gap-2",children:[t.jsxs(L,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:84:13",size:"sm",variant:"outline",className:"h-7 text-[11px]",onClick:()=>a(),children:[t.jsx(Jt,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:85:15",className:"w-3 h-3 mr-1"}),"刷新"]}),t.jsxs(L,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:87:13",size:"sm",className:"h-7 text-[11px] bg-blue-600 hover:bg-blue-500",onClick:x,children:[t.jsx(ue,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:88:15",className:"w-3 h-3 mr-1"}),"添加探针"]})]})]}),o.length===0?t.jsx(I,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:93:11",className:"bg-[var(--dg-bg-secondary)] border-dashed border-[var(--dg-border)]",children:t.jsx(F,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:94:13",className:"p-8 text-center text-xs text-[var(--dg-text-muted)]",children:'暂无健康探针,点击"添加探针"创建'})}):t.jsx("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:99:11",className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:o.map(r=>t.jsx(I,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:101:15",className:`bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] ${r.last_status==="down"?"border-red-700/50":""}`,children:t.jsxs(F,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:102:17",className:"p-3",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:103:19",className:"flex items-start justify-between mb-2",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:104:21",className:"flex items-center gap-2",children:[r.last_status==="up"?t.jsx(ie,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:105:49",className:"w-4 h-4 text-emerald-400"}):r.last_status==="down"?t.jsx(ft,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:106:51",className:"w-4 h-4 text-red-400"}):t.jsx(it,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:107:24",className:"w-4 h-4 text-slate-500"}),t.jsx("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:108:23",className:"text-xs font-medium text-[var(--dg-text-primary)]",children:String(r.name)}),t.jsx(Z,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:109:23",variant:"outline",className:"text-[10px] h-5 px-1.5 capitalize",children:r.probe_type==="http_get"?"HTTP":r.probe_type==="tcp_socket"?"TCP":"Exec"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:113:21",className:"flex gap-1",children:[t.jsx(L,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:114:23",variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>u(r),children:t.jsx(be,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:115:25",className:"w-3 h-3"})}),t.jsx(L,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:117:23",variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-red-400 hover:text-red-300",onClick:()=>M(r),children:t.jsx(fe,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:118:25",className:"w-3 h-3"})})]})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:122:19",className:"space-y-1 text-[11px] text-[var(--dg-text-muted)]",children:[r.probe_type==="http_get"&&t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:124:23",className:"truncate",children:["URL: ",String(r.http_url)]}),r.probe_type==="tcp_socket"&&t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:127:23",children:[String(r.tcp_host),":",String(r.tcp_port)]}),r.probe_type==="exec_command"&&t.jsx("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:130:23",className:"truncate font-mono",children:String(r.exec_command)}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:132:21",className:"flex items-center gap-3",children:[t.jsxs("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:133:23",children:["状态: ",t.jsx("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:133:33",className:r.last_status==="up"?"text-emerald-400":r.last_status==="down"?"text-red-400":"text-slate-400",children:r.last_status?String(r.last_status).toUpperCase():"未检测"})]}),Number(r.last_latency_ms)>0&&t.jsxs("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:136:57",children:["延迟: ",String(r.last_latency_ms),"ms"]}),Number(r.fail_count)>0&&t.jsxs("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:137:52",className:"text-red-400",children:["连续失败: ",String(r.fail_count),"次"]}),r.last_checked_at&&t.jsx("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:138:45",className:"text-[10px]",children:new Date(String(r.last_checked_at)).toLocaleString("zh-CN")})]})]})]})},String(r.id)))})]}),t.jsx(Kt,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:148:7",open:l,onOpenChange:d,children:t.jsxs(zt,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:149:9",showOverlay:!1,className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] max-w-lg",children:[t.jsxs(Wt,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:150:11",children:[t.jsx(Gt,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:151:13",className:"text-[var(--dg-text-primary)]",children:i?"编辑探针":"添加探针"}),t.jsx(qt,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:154:13",className:"text-[var(--dg-text-secondary)]",children:i?"修改健康探针配置":"创建新的健康探针,Agent 在目标主机本地执行探测"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:158:11",className:"space-y-3 max-h-[60vh] overflow-y-auto pr-1",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:159:13",children:[t.jsxs("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:160:15",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:["探针名称 ",t.jsx("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:160:90",className:"text-red-400",children:"*"})]}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:161:15",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.name,onChange:r=>c({...n,name:r.target.value}),placeholder:"如:cex-agent 健康检查"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:163:13",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:164:15",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"目标主机"}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:165:15",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.hostname,onChange:r=>c({...n,hostname:r.target.value})})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:167:13",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:168:15",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"探针类型"}),t.jsxs("select",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:169:15",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.probe_type,onChange:r=>c({...n,probe_type:r.target.value}),children:[t.jsx("option",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:170:17",value:"http_get",children:"HTTP GET"}),t.jsx("option",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:171:17",value:"tcp_socket",children:"TCP Socket"}),t.jsx("option",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:172:17",value:"exec_command",children:"Exec Command"})]})]}),n.probe_type==="http_get"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:178:17",children:[t.jsxs("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:178:22",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:["HTTP URL ",t.jsx("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:178:101",className:"text-red-400",children:"*"})]}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:179:19",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.http_url,onChange:r=>c({...n,http_url:r.target.value}),placeholder:"http://localhost:8080/health"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:180:17",className:"grid grid-cols-2 gap-2",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:181:19",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:181:24",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"期望状态码"}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:182:21",type:"number",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.http_expect_code,onChange:r=>c({...n,http_expect_code:Number(r.target.value)})})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:183:19",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:183:24",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"期望响应内容(可选)"}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:184:21",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.http_expect_body,onChange:r=>c({...n,http_expect_body:r.target.value})})]})]})]}),n.probe_type==="tcp_socket"&&t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:190:15",className:"grid grid-cols-2 gap-2",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:191:17",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:191:22",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"TCP 目标地址"}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:192:19",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.tcp_host,onChange:r=>c({...n,tcp_host:r.target.value}),placeholder:"localhost"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:193:17",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:193:22",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"TCP 端口"}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:194:19",type:"number",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.tcp_port,onChange:r=>c({...n,tcp_port:Number(r.target.value)})})]})]}),n.probe_type==="exec_command"&&t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:199:15",children:[t.jsxs("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:199:20",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:["执行命令 ",t.jsx("span",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:199:95",className:"text-red-400",children:"*"})]}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:200:17",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs font-mono text-[var(--dg-text-primary)]",value:n.exec_command,onChange:r=>c({...n,exec_command:r.target.value}),placeholder:"pgrep -x mysqld"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:203:13",className:"grid grid-cols-2 gap-2",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:204:15",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:204:20",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"超时(秒)"}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:205:17",type:"number",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.timeout,onChange:r=>c({...n,timeout:Number(r.target.value)})})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:206:15",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:206:20",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"间隔(秒)"}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:207:17",type:"number",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.interval,onChange:r=>c({...n,interval:Number(r.target.value)})})]})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:210:13",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:210:18",className:"text-[11px] text-[var(--dg-text-muted)] mb-1 block",children:"描述"}),t.jsx("input",{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:211:15",className:"w-full h-8 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 text-xs text-[var(--dg-text-primary)]",value:n.description,onChange:r=>c({...n,description:r.target.value})})]})]}),t.jsxs(Vt,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:213:11",children:[t.jsx(L,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:214:13",variant:"outline",size:"sm",className:"h-7 text-[11px]",onClick:()=>d(!1),children:"取消"}),t.jsx(L,{"code-path":"src/pages/host-monitor/HealthProbeSection.tsx:215:13",size:"sm",className:"h-7 text-[11px] bg-blue-600 hover:bg-blue-500",onClick:g,disabled:!n.name||!n.hostname,children:i?"保存":"创建"})]})]})})]})}function Ke({open:e,onOpenChange:s,portPolicyMode:o,onModeChange:a,portWhitelist:l,onWhitelistChange:d,onSave:i,saving:h}){return t.jsx(Kt,{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:29:5",open:e,onOpenChange:s,children:t.jsxs(zt,{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:30:7",showOverlay:!1,className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] max-w-md",children:[t.jsxs(Wt,{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:31:9",children:[t.jsx(Gt,{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:32:11",className:"text-[var(--dg-text-primary)]",children:"端口监控策略"}),t.jsx(qt,{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:33:11",className:"text-[var(--dg-text-secondary)]",children:"配置 Agent 端口上报过滤规则"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:35:9",className:"space-y-4",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:36:11",children:[t.jsx("label",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:37:13",className:"text-[11px] text-[var(--dg-text-muted)] mb-1.5 block",children:"过滤模式"}),t.jsxs("div",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:38:13",className:"flex gap-2",children:[t.jsx("button",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:39:15",className:`flex-1 h-9 rounded text-xs font-medium border transition-colors ${o==="whitelist"?"bg-blue-500/20 border-blue-500 text-blue-400":"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] text-[var(--dg-text-muted)]"}`,onClick:()=>a("whitelist"),children:"白名单 ─ 全量上报"}),t.jsx("button",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:45:15",className:`flex-1 h-9 rounded text-xs font-medium border transition-colors ${o==="blacklist"?"bg-amber-500/20 border-amber-500 text-amber-400":"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] text-[var(--dg-text-muted)]"}`,onClick:()=>a("blacklist"),children:"黑名单 ─ 仅上报选中"})]}),t.jsx("p",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:52:13",className:"text-[10px] text-[var(--dg-text-muted)] mt-1.5 leading-relaxed",children:o==="whitelist"?"所有发现的端口都上报,任意端口变化都会触发告警 + 恢复通知。":"仅上报选中端口的变化,其余端口变化静默忽略(不告警)。系统进程端口(sshd/rpcbind/systemd等)永远忽略。"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:59:11",children:[t.jsxs("label",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:60:13",className:"text-[11px] text-[var(--dg-text-muted)] mb-1.5 block",children:["端口列表 ",t.jsx("span",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:61:20",className:"text-[var(--dg-text-muted)]",children:"(逗号分隔,如: 80,443,3306,6379)"}),o==="whitelist"&&t.jsx("span",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:62:50",className:"text-blue-400 ml-1",children:"— 白名单模式无需配置"})]}),t.jsx("textarea",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:64:13",className:`w-full h-20 bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)] rounded px-2 py-1.5 text-xs font-mono resize-none ${o==="whitelist"?"text-[var(--dg-text-muted)] opacity-50 cursor-not-allowed":"text-[var(--dg-text-primary)]"}`,value:l.join(","),onChange:n=>{if(o==="whitelist")return;const x=n.target.value.split(",").map(u=>parseInt(u.trim())).filter(u=>!isNaN(u)&&u>0&&u<=65535);d(x)},placeholder:o==="whitelist"?"白名单模式下所有端口自动上报":"80,443,3306,6379",readOnly:o==="whitelist"}),t.jsxs("p",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:78:13",className:"text-[10px] text-[var(--dg-text-muted)] mt-1",children:["已输入 ",l.length," 个端口"]})]}),t.jsx("div",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:83:11",className:"bg-amber-500/5 border border-amber-500/20 rounded p-2.5",children:t.jsxs("p",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:84:13",className:"text-[10px] text-amber-300/80 leading-relaxed",children:["⚠️ 无论选择哪种模式,以下系统进程端口",t.jsx("b",{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:85:35",children:"永远不上报"}),":sshd、rpcbind、master、systemd、dbus-daemon、rsyslogd 等。Agent 采集时自动跳过。"]})})]}),t.jsxs(Vt,{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:89:9",children:[t.jsx(L,{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:90:11",variant:"outline",size:"sm",className:"h-7 text-[11px]",onClick:()=>s(!1),children:"取消"}),t.jsx(L,{"code-path":"src/pages/host-monitor/PortPolicyDialog.tsx:91:11",size:"sm",className:"h-7 text-[11px] bg-blue-600 hover:bg-blue-500",onClick:i,disabled:h,children:h?"保存中…":"保存策略"})]})]})})}function ze({selectedHost:e,serverInfo:s,latest:o,heartbeatInfo:a,portInfoCount:l}){const d=o?.disk_info?N(o.disk_info):null,i=d?Array.isArray(d)?d:d.partitions||[]:[];return t.jsxs(G,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:22:5",value:"system",className:"mt-3 space-y-3",children:[t.jsx(I,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:23:7",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsx(F,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:24:9",className:"p-4",children:t.jsx("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:25:11",className:"grid grid-cols-2 md:grid-cols-4 gap-x-6 gap-y-3 text-xs",children:[["主机名",s?.hostname||e],["IP 地址",s?.ip||"—"],["操作系统",s?.os||"—"],["内核版本",s?.kernel||"—"],["CPU 核心数",s?.cpu_cores||"—"],["总内存",s?.mem_total?`${s.mem_total.toFixed(0)} GB`:"—"],["已用内存",s?.mem_used?`${s.mem_used.toFixed(1)} GB`:"—"],["运行时长",s?.uptime?`${Math.floor(s.uptime/86400)}天 ${Math.floor(s.uptime%86400/3600)}时`:"—"],["Agent 版本",a?.version||s?.agent_version||"—"],["Agent 序列号",a?.report_seq!=null?String(a.report_seq):"—"],["监听端口数",l>0?`${l}`:"—"],["Agent RSS",a?.self_rss_mb?`${a.self_rss_mb.toFixed(1)} MB`:"—"]].map(([h,n])=>t.jsxs("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:40:15",children:[t.jsxs("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:41:17",className:"text-[var(--dg-text-muted)]",children:[h,":"]}),t.jsx("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:42:17",className:"text-[var(--dg-text-primary)] font-mono",children:n})]},h))})})}),o&&t.jsx(I,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:50:9",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsxs(F,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:51:11",className:"p-4",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:52:13",className:"flex items-center gap-2 mb-2",children:[t.jsx(Xt,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:53:15",className:"h-4 w-4 text-[var(--dg-text-muted)]"}),t.jsx("h3",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:54:15",className:"text-xs font-medium text-[var(--dg-text-primary)]",children:"系统负载 (Load Average)"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:56:13",className:"flex items-center gap-6 text-xs",children:[t.jsxs("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:57:15",children:[t.jsx("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:57:20",className:"text-[var(--dg-text-muted)]",children:"1min "}),t.jsx("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:57:78",className:"text-sm font-bold text-slate-200",children:o.load1??"--"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:58:15",children:[t.jsx("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:58:20",className:"text-[var(--dg-text-muted)]",children:"5min "}),t.jsx("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:58:78",className:"text-sm font-bold text-slate-200",children:o.load5??"--"})]}),t.jsxs("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:59:15",children:[t.jsx("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:59:20",className:"text-[var(--dg-text-muted)]",children:"15min "}),t.jsx("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:59:79",className:"text-sm font-bold text-slate-200",children:o.load15??"--"})]})]})]})}),i.length>0&&t.jsx(I,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:66:9",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsxs(F,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:67:11",className:"p-4",children:[t.jsxs("h3",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:68:13",className:"text-xs font-medium text-[var(--dg-text-primary)] mb-2 flex items-center gap-2",children:[t.jsx(Y,{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:68:108",className:"h-4 w-4"}),"磁盘分区"]}),t.jsx("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:69:13",className:"space-y-1.5",children:i.map((h,n)=>t.jsxs("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:71:17",className:"flex items-center gap-2 text-xs",children:[t.jsx("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:72:19",className:"text-[var(--dg-text-muted)] w-24 font-mono truncate",children:h.mount||h.mountpoint||h.device||`disk${n}`}),t.jsx("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:73:19",className:"flex-1 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:t.jsx("div",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:74:21",className:"h-full rounded-full bg-blue-500",style:{width:`${Math.min(h.usage_percent||h.used_percent||0,100)}%`}})}),t.jsxs("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:76:19",className:"text-[var(--dg-text-primary)] w-28 text-right tabular-nums whitespace-nowrap",children:[(h.used_gb??0).toFixed(1),"/",(h.total_gb??0).toFixed(0),"GB"]}),t.jsxs("span",{"code-path":"src/pages/host-monitor/SystemInfoSection.tsx:77:19",className:"text-blue-400 w-14 text-right tabular-nums whitespace-nowrap",children:[(h.usage_percent??h.used_percent??0).toFixed(1),"%"]})]},n))})]})})]})}function ds(){const e=jt(),[s]=ne(),o=s.get("host")||"",[a,l]=v.useState(o),[d,i]=v.useState("basic"),[h,n]=v.useState(1),[c,x]=v.useState("avg"),[u,g]=v.useState("whitelist"),[M,r]=v.useState([]),[R,A]=v.useState(!1),[Q,$]=v.useState(!1),{data:k=[],isLoading:W}=Fe(),{data:C=[],isLoading:f}=Oe(a,h),{data:m,refetch:w}=Ae(a);v.useEffect(()=>{m&&(g(m.port_filter_mode),r(m.port_whitelist))},[m]),v.useEffect(()=>{if(k.length>0&&!a){const p=o?k.find(O=>O.hostname===o):null;l(String(p?.hostname||k[0]?.hostname||""))}},[k,a,o]);const T=async()=>{if(a){$(!0);try{await z.savePortPolicy(a,{port_filter_mode:u,port_whitelist:M}),A(!1),e.invalidateQueries({queryKey:q.hostMonitor.portPolicy(a)})}catch{}finally{$(!1)}}},_=mt.find(p=>p.hours===h)||mt[0],U=W||f,P=k.find(p=>p.hostname===a)||null,b=v.useMemo(()=>{const p=P||{};return C.length===0?p:{...p,...C[C.length-1]}},[P,C]),j=v.useMemo(()=>$e(C,_),[C,_]),H=N(b?.net_info),et=Array.isArray(b?.port_info)?b.port_info:Array.isArray(N(b?.port_info))?N(b?.port_info):[],ht=N(b?.disk_io_info),te=N(b?.swap_info),pt=Array.isArray(N(b?.process_top_info))?N(b?.process_top_info):[],K=N(b?.fd_info),D=N(b?.cs_info),ee=N(b?.heartbeat_info),B=(p,O="--")=>Be(b,H,ht,te,K,p,O);return U&&!C.length?t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:98:12",className:"flex items-center justify-center h-64",children:t.jsx(de,{"code-path":"src/pages/HostMonitor.tsx:98:67",className:"h-8 w-8 animate-spin text-slate-500"})}):t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:102:5",className:"space-y-3",children:[t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:103:7",className:"flex items-center justify-between flex-wrap gap-2",children:[t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:104:9",className:"flex items-center gap-2",children:[t.jsx(J,{"code-path":"src/pages/HostMonitor.tsx:105:11",className:"h-4 w-4 text-blue-400"}),t.jsxs(Rt,{"code-path":"src/pages/HostMonitor.tsx:106:11",value:a,onValueChange:l,children:[t.jsx(Tt,{"code-path":"src/pages/HostMonitor.tsx:107:13",className:"w-52 h-8 text-xs bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsx(Et,{"code-path":"src/pages/HostMonitor.tsx:108:15",placeholder:"选择主机..."})}),t.jsx(It,{"code-path":"src/pages/HostMonitor.tsx:110:13",className:"bg-slate-800 border-slate-700 text-slate-200",children:k.map(p=>t.jsx(at,{"code-path":"src/pages/HostMonitor.tsx:112:17",value:p.hostname,children:p.hostname},p.hostname))})]}),P&&t.jsxs("span",{"code-path":"src/pages/HostMonitor.tsx:117:13",className:"text-xs text-[var(--dg-text-muted)] ml-2",children:[P.os||"",P.cpu_cores?` | ${P.cpu_cores} 核`:"",P.mem_total?` | ${P.mem_total.toFixed(0)}GB`:""]})]}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:122:9",className:"flex items-center gap-2",children:[t.jsxs(Rt,{"code-path":"src/pages/HostMonitor.tsx:123:11",value:c,onValueChange:p=>x(p),children:[t.jsx(Tt,{"code-path":"src/pages/HostMonitor.tsx:124:13",className:"w-24 h-7 text-xs bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsx(Et,{"code-path":"src/pages/HostMonitor.tsx:125:15"})}),t.jsxs(It,{"code-path":"src/pages/HostMonitor.tsx:127:13",className:"bg-slate-800 border-slate-700 text-slate-200",children:[t.jsx(at,{"code-path":"src/pages/HostMonitor.tsx:128:15",value:"avg",children:"平均值"}),t.jsx(at,{"code-path":"src/pages/HostMonitor.tsx:129:15",value:"max",children:"最大值"}),t.jsx(at,{"code-path":"src/pages/HostMonitor.tsx:130:15",value:"min",children:"最小值"})]})]}),t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:133:11",className:"flex items-center gap-1",children:mt.map(p=>t.jsx(L,{"code-path":"src/pages/HostMonitor.tsx:135:15",variant:h===p.hours?"default":"outline",size:"sm",className:"h-7 text-xs px-2.5",onClick:()=>n(p.hours),children:p.label},p.hours))})]})]}),t.jsxs(xe,{"code-path":"src/pages/HostMonitor.tsx:142:7",value:d,onValueChange:i,children:[t.jsx(me,{"code-path":"src/pages/HostMonitor.tsx:143:9",className:"h-8 bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] gap-0 overflow-x-auto",children:[{id:"basic",label:"基础监控",icon:t.jsx(le,{"code-path":"src/pages/HostMonitor.tsx:145:49",className:"w-3 h-3"})},{id:"disk",label:"磁盘监控",icon:t.jsx(Y,{"code-path":"src/pages/HostMonitor.tsx:146:48",className:"w-3 h-3"})},{id:"network",label:"网络监控",icon:t.jsx(ct,{"code-path":"src/pages/HostMonitor.tsx:147:51",className:"w-3 h-3"})},{id:"ports",label:"端口监控",icon:t.jsx(J,{"code-path":"src/pages/HostMonitor.tsx:148:49",className:"w-3 h-3"})},{id:"process",label:"进程监控",icon:t.jsx(At,{"code-path":"src/pages/HostMonitor.tsx:149:51",className:"w-3 h-3"})},{id:"system",label:"系统信息",icon:t.jsx(he,{"code-path":"src/pages/HostMonitor.tsx:150:50",className:"w-3 h-3"})},{id:"health_probes",label:"健康探针",icon:t.jsx(Ee,{"code-path":"src/pages/HostMonitor.tsx:151:57",className:"w-3 h-3"})}].map(p=>t.jsxs(ge,{"code-path":"src/pages/HostMonitor.tsx:153:13",value:p.id,className:"text-[11px] h-7 gap-1 data-[state=active]:bg-[var(--dg-bg-primary)]",children:[p.icon,p.label]},p.id))}),t.jsxs(G,{"code-path":"src/pages/HostMonitor.tsx:159:9",value:"basic",className:"mt-3 grid grid-cols-1 md:grid-cols-3 gap-3",children:[t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:160:11",title:"CPU 使用率(%)",value:B("cpu"),icon:t.jsx(pe,{"code-path":"src/pages/HostMonitor.tsx:160:79",className:"h-4 w-4 text-blue-400"}),data:j.cpu,color:"#3b82f6",unit:"%",domain:[0,100],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:162:11",title:"CPU IO等待(%)",value:b?.cpu_iowait!=null?`${b.cpu_iowait.toFixed(1)}%`:"--",icon:t.jsx(it,{"code-path":"src/pages/HostMonitor.tsx:162:133",className:"h-4 w-4 text-orange-400"}),data:j.iowait,color:"#f97316",unit:"%",domain:[0,100],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:164:11",title:"内存使用率(%)",value:B("mem"),icon:t.jsx(J,{"code-path":"src/pages/HostMonitor.tsx:164:77",className:"h-4 w-4 text-emerald-400"}),data:j.mem,color:"#10b981",unit:"%",domain:[0,100],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:166:11",title:"可用内存(GB)",value:b?.mem_available!=null?`${b.mem_available.toFixed(1)}GB`:"--",icon:t.jsx(J,{"code-path":"src/pages/HostMonitor.tsx:166:137",className:"h-4 w-4 text-emerald-400"}),data:j.memAvail,color:"#34d399",unit:"GB",domain:[0,"auto"],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:168:11",title:"Swap 使用率(%)",value:B("swap"),icon:t.jsx(Y,{"code-path":"src/pages/HostMonitor.tsx:168:81",className:"h-4 w-4 text-red-400"}),data:j.swap,color:"#ef4444",unit:"%",domain:[0,100],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:170:11",title:"系统负载(1m)",value:B("load1"),icon:t.jsx(Xt,{"code-path":"src/pages/HostMonitor.tsx:170:79",className:"h-4 w-4 text-purple-400"}),data:j.load1,color:"#8b5cf6",unit:"",domain:[0,"auto"],aggType:c})]}),t.jsx(G,{"code-path":"src/pages/HostMonitor.tsx:174:9",value:"disk",className:"mt-3 space-y-3",children:t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:175:11",className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:176:13",title:"磁盘使用率(%)",value:B("disk"),icon:t.jsx(Y,{"code-path":"src/pages/HostMonitor.tsx:176:80",className:"h-4 w-4 text-orange-400"}),data:j.disk,color:"#f97316",unit:"%",domain:[0,100],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:178:13",title:"Inode 使用率(%)",value:(()=>{const p=Array.isArray(N(b?.disk_info))?N(b?.disk_info):[],O=p.find(V=>V.mount==="/")||p[0];return O?.inode_usage_pct!=null?`${O.inode_usage_pct.toFixed(1)}%`:"--"})(),icon:t.jsx(Y,{"code-path":"src/pages/HostMonitor.tsx:182:25",className:"h-4 w-4 text-purple-400"}),data:j.inode,color:"#8b5cf6",unit:"%",domain:[0,100],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:184:13",title:"磁盘读取(KB/s)",value:B("ioR"),icon:t.jsx(xt,{"code-path":"src/pages/HostMonitor.tsx:184:81",className:"h-4 w-4 text-blue-400"}),data:j.ioRead,color:"#3b82f6",unit:"KB/s",domain:[0,"auto"],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:186:13",title:"磁盘写入(KB/s)",value:B("ioW"),icon:t.jsx(xt,{"code-path":"src/pages/HostMonitor.tsx:186:81",className:"h-4 w-4 text-emerald-400"}),data:j.ioWrite,color:"#10b981",unit:"KB/s",domain:[0,"auto"],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:188:13",title:"磁盘IO繁忙度(%)",value:ht?.util!=null?`${ht.util.toFixed(1)}%`:"--",icon:t.jsx(xt,{"code-path":"src/pages/HostMonitor.tsx:188:130",className:"h-4 w-4 text-red-400"}),data:j.ioUtil,color:"#ef4444",unit:"%",domain:[0,100],aggType:c})]})}),t.jsxs(G,{"code-path":"src/pages/HostMonitor.tsx:193:9",value:"network",className:"mt-3 space-y-3",children:[t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:194:11",className:"grid grid-cols-1 md:grid-cols-4 gap-3",children:[t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:195:13",title:"TCP EST",value:B("tcp"),icon:t.jsx(ct,{"code-path":"src/pages/HostMonitor.tsx:195:78",className:"h-4 w-4 text-purple-400"}),data:j.tcpEst,color:"#8b5cf6",unit:"个",domain:[0,"auto"],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:197:13",title:"TCP TIME_WAIT",value:B("tw"),icon:t.jsx(it,{"code-path":"src/pages/HostMonitor.tsx:197:83",className:"h-4 w-4 text-amber-400"}),data:j.tcpTW,color:"#f59e0b",unit:"个",domain:[0,"auto"],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:199:13",title:"TCP CLOSE_WAIT",value:H?.tcp_close_wait!=null?String(H.tcp_close_wait):"--",icon:t.jsx(it,{"code-path":"src/pages/HostMonitor.tsx:199:139",className:"h-4 w-4 text-red-400"}),data:j.tcpCW,color:"#ef4444",unit:"个",domain:[0,"auto"],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:201:13",title:"TCP 总连接",value:H?String((H.tcp_established||0)+(H.tcp_time_wait||0)+(H.tcp_close_wait||0)):"--",icon:t.jsx(ct,{"code-path":"src/pages/HostMonitor.tsx:201:169",className:"h-4 w-4 text-cyan-400"}),data:j.connTotal,color:"#22d3ee",unit:"个",domain:[0,"auto"],aggType:c})]}),t.jsx(Qe,{"code-path":"src/pages/HostMonitor.tsx:204:11",title:"网卡带宽吞吐",currentRx:H?.net_rx_bps!=null?dt(H.net_rx_bps):"--",currentTx:H?.net_tx_bps!=null?dt(H.net_tx_bps):"--",rxData:j.rx,txData:j.tx,aggType:c,unit:"KB/s"}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:211:11",className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-3",children:[t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:212:13",title:"网卡接收错误",value:H?.net_rx_errors!=null?String(H.net_rx_errors):"--",icon:t.jsx(ft,{"code-path":"src/pages/HostMonitor.tsx:212:129",className:"h-4 w-4 text-red-400"}),data:j.rxErr,color:"#ef4444",unit:"个",domain:[0,"auto"],aggType:c}),t.jsx(S,{"code-path":"src/pages/HostMonitor.tsx:214:13",title:"网卡发送错误",value:H?.net_tx_errors!=null?String(H.net_tx_errors):"--",icon:t.jsx(ft,{"code-path":"src/pages/HostMonitor.tsx:214:129",className:"h-4 w-4 text-orange-400"}),data:j.txErr,color:"#f97316",unit:"个",domain:[0,"auto"],aggType:c})]})]}),t.jsx(G,{"code-path":"src/pages/HostMonitor.tsx:219:9",value:"ports",className:"mt-3 space-y-3",children:t.jsx(I,{"code-path":"src/pages/HostMonitor.tsx:220:11",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsxs(F,{"code-path":"src/pages/HostMonitor.tsx:221:13",className:"p-4",children:[t.jsxs("h3",{"code-path":"src/pages/HostMonitor.tsx:222:15",className:"text-xs font-medium text-[var(--dg-text-primary)] mb-3 flex items-center gap-2",children:[t.jsx(J,{"code-path":"src/pages/HostMonitor.tsx:223:17",className:"h-4 w-4 text-emerald-400"}),"监听端口 ",et.length,t.jsxs("span",{"code-path":"src/pages/HostMonitor.tsx:224:17",className:"ml-auto flex items-center gap-2",children:[u==="blacklist"&&M.length>0&&t.jsxs(Z,{"code-path":"src/pages/HostMonitor.tsx:226:21",variant:"outline",className:"text-[10px] text-amber-400 border-amber-500/30",children:["黑名单: ",M.join(",")]}),u==="whitelist"&&t.jsx(Z,{"code-path":"src/pages/HostMonitor.tsx:231:21",variant:"outline",className:"text-[10px] text-blue-400 border-blue-500/30",children:"白名单模式"}),t.jsx(L,{"code-path":"src/pages/HostMonitor.tsx:235:19",variant:"outline",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>{w(),A(!0)},children:"策略配置"})]})]}),et.length===0?t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:242:17",className:"text-center py-6 text-xs text-[var(--dg-text-muted)] border border-dashed border-[var(--dg-border)] rounded-lg",children:"暂无端口数据"}):t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:246:17",className:"overflow-x-auto",children:t.jsxs("table",{"code-path":"src/pages/HostMonitor.tsx:247:19",className:"w-full text-xs",children:[t.jsx("thead",{"code-path":"src/pages/HostMonitor.tsx:248:21",children:t.jsxs("tr",{"code-path":"src/pages/HostMonitor.tsx:249:23",className:"text-[var(--dg-text-muted)] border-b border-[var(--dg-border)]",children:[t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:250:25",className:"py-1.5 text-left font-medium",children:"端口"}),t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:251:25",className:"py-1.5 text-left font-medium",children:"协议"}),t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:252:25",className:"py-1.5 text-left font-medium",children:"进程"}),t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:253:25",className:"py-1.5 text-right font-medium",children:"状态"})]})}),t.jsx("tbody",{"code-path":"src/pages/HostMonitor.tsx:256:21",children:et.map((p,O)=>t.jsxs("tr",{"code-path":"src/pages/HostMonitor.tsx:258:25",className:"border-b border-[var(--dg-border)]/30 hover:bg-slate-800/30 transition-colors",children:[t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:259:27",className:"py-1.5 font-mono text-[var(--dg-text-primary)]",children:p.port}),t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:260:27",className:"py-1.5",children:t.jsx(Z,{"code-path":"src/pages/HostMonitor.tsx:261:29",variant:"outline",className:"text-[10px] font-mono",children:p.protocol||"tcp"})}),t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:265:27",className:"py-1.5 font-mono text-[var(--dg-text-muted)]",children:p.process||"—"}),t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:266:27",className:"py-1.5 text-right",children:t.jsx(Z,{"code-path":"src/pages/HostMonitor.tsx:267:29",variant:"default",className:"text-[10px] bg-emerald-500/20 text-emerald-400 border-emerald-500/30",children:"LISTEN"})})]},O))})]})})]})})}),t.jsxs(G,{"code-path":"src/pages/HostMonitor.tsx:281:9",value:"process",className:"mt-3 space-y-3",children:[t.jsx(I,{"code-path":"src/pages/HostMonitor.tsx:282:11",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsxs(F,{"code-path":"src/pages/HostMonitor.tsx:283:13",className:"p-4",children:[t.jsxs("h3",{"code-path":"src/pages/HostMonitor.tsx:284:15",className:"text-xs font-medium text-[var(--dg-text-primary)] mb-3 flex items-center gap-2",children:[t.jsx(At,{"code-path":"src/pages/HostMonitor.tsx:285:17",className:"h-4 w-4 text-cyan-400"}),"进程 TOP ",pt.length]}),pt.length===0?t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:288:17",className:"text-center py-6 text-xs text-[var(--dg-text-muted)] border border-dashed border-[var(--dg-border)] rounded-lg",children:"Agent v2.0+ 支持,等待数据上报…"}):t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:292:17",className:"overflow-x-auto",children:t.jsxs("table",{"code-path":"src/pages/HostMonitor.tsx:293:19",className:"w-full text-xs",children:[t.jsx("thead",{"code-path":"src/pages/HostMonitor.tsx:294:21",children:t.jsxs("tr",{"code-path":"src/pages/HostMonitor.tsx:295:23",className:"text-[var(--dg-text-muted)] border-b border-[var(--dg-border)]",children:[t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:296:25",className:"py-1.5 text-left font-medium w-[40%]",children:"进程名称 / CMD"}),t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:297:25",className:"py-1.5 text-right font-medium w-[8%]",children:"PID"}),t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:298:25",className:"py-1.5 text-right font-medium w-[16%]",children:"内存使用率(%)"}),t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:299:25",className:"py-1.5 text-right font-medium w-[16%]",children:"CPU使用率(%)"}),t.jsx("th",{"code-path":"src/pages/HostMonitor.tsx:300:25",className:"py-1.5 text-right font-medium w-[20%]",children:"打开文件数"})]})}),t.jsx("tbody",{"code-path":"src/pages/HostMonitor.tsx:303:21",children:pt.map((p,O)=>{const V=p.cmdline||p.name||"?",st=p.cpu_pct!=null?Number(p.cpu_pct):null,ot=p.mem_pct!=null?Number(p.mem_pct):null;return t.jsxs("tr",{"code-path":"src/pages/HostMonitor.tsx:309:27",className:"border-b border-[var(--dg-border)]/30 hover:bg-slate-800/30 transition-colors",children:[t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:310:29",className:"py-1.5 pr-2",children:t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:311:31",className:"flex items-center gap-1 group/cmd",children:[t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:312:33",className:"font-mono text-[var(--dg-text-primary)] truncate max-w-[320px] inline-block align-middle",title:V,children:V}),t.jsx("button",{"code-path":"src/pages/HostMonitor.tsx:315:33",className:"opacity-0 group-hover/cmd:opacity-100 transition-opacity p-0.5 hover:text-cyan-400 shrink-0",title:"复制命令行",onClick:async se=>{se.stopPropagation();try{await navigator.clipboard.writeText(V)}catch{const X=document.createElement("textarea");X.value=V,X.style.position="fixed",X.style.opacity="0",document.body.appendChild(X),X.select(),document.execCommand("copy"),document.body.removeChild(X)}},children:t.jsxs("svg",{"code-path":"src/pages/HostMonitor.tsx:330:35",className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("rect",{"code-path":"src/pages/HostMonitor.tsx:331:37",x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),t.jsx("path",{"code-path":"src/pages/HostMonitor.tsx:332:37",d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})}),t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:337:29",className:"py-1.5 text-right font-mono text-[var(--dg-text-muted)]",children:p.pid}),t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:338:29",className:"py-1.5 text-right font-mono",children:t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:339:31",className:ot!=null&&ot>50?"text-rose-400":"text-cyan-400",children:ot!=null?ot.toFixed(2):"--"})}),t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:343:29",className:"py-1.5 text-right font-mono",children:t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:344:31",className:st!=null&&st>50?"text-rose-400":"text-[var(--dg-text-primary)]",children:st!=null?st.toFixed(2):"--"})}),t.jsx("td",{"code-path":"src/pages/HostMonitor.tsx:348:29",className:"py-1.5 text-right font-mono text-[var(--dg-text-muted)]",children:p.fd_count??"--"})]},O)})})]})})]})}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:359:11",className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.jsx(I,{"code-path":"src/pages/HostMonitor.tsx:360:13",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsxs(F,{"code-path":"src/pages/HostMonitor.tsx:361:15",className:"p-4",children:[t.jsxs("h3",{"code-path":"src/pages/HostMonitor.tsx:362:17",className:"text-xs font-medium text-[var(--dg-text-primary)] mb-3 flex items-center gap-2",children:[t.jsx(Y,{"code-path":"src/pages/HostMonitor.tsx:363:19",className:"h-4 w-4 text-violet-400"}),"FD 文件句柄"]}),K?.allocated!=null?t.jsxs(t.Fragment,{children:[t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:367:21",className:"flex items-center gap-4 mb-3 text-xs",children:[t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:368:23",children:[t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:369:25",className:"text-[var(--dg-text-muted)]",children:"已分配 "}),t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:370:25",className:"font-mono text-[var(--dg-text-primary)] font-semibold",children:K.allocated.toLocaleString()})]}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:372:23",children:[t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:373:25",className:"text-[var(--dg-text-muted)]",children:"上限 "}),t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:374:25",className:"font-mono text-[var(--dg-text-primary)] font-semibold",children:K.max===-1?"无限制":K.max?.toLocaleString()||"—"})]}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:376:23",children:[t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:377:25",className:"text-[var(--dg-text-muted)]",children:"使用率 "}),t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:378:25",className:`font-mono font-semibold ${K.usage_pct>80?"text-rose-400":"text-violet-400"}`,children:K.usage_pct!=null?`${K.usage_pct.toFixed(1)}%`:"—"})]})]}),j.fd.length>0&&t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:384:23",className:"h-[120px]",children:t.jsx(yt,{"code-path":"src/pages/HostMonitor.tsx:385:25",width:"100%",height:"100%",children:t.jsxs(Mt,{"code-path":"src/pages/HostMonitor.tsx:386:27",data:j.fd,children:[t.jsx(_t,{"code-path":"src/pages/HostMonitor.tsx:387:29",strokeDasharray:"3 3",stroke:"var(--dg-border)"}),t.jsx(Nt,{"code-path":"src/pages/HostMonitor.tsx:388:29",dataKey:"time",tick:{fontSize:10,fill:"var(--dg-text-muted)"},interval:"preserveStartEnd"}),t.jsx(Ht,{"code-path":"src/pages/HostMonitor.tsx:389:29",tick:{fontSize:10,fill:"var(--dg-text-muted)"},unit:"%",domain:[0,"auto"]}),t.jsx(St,{"code-path":"src/pages/HostMonitor.tsx:390:29",contentStyle:{background:"#1e293b",border:"1px solid #334155",borderRadius:6,fontSize:11}}),t.jsx("defs",{"code-path":"src/pages/HostMonitor.tsx:391:29",children:t.jsxs("linearGradient",{"code-path":"src/pages/HostMonitor.tsx:392:31",id:"fdGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{"code-path":"src/pages/HostMonitor.tsx:393:33",offset:"0%",stopColor:"#a78bfa",stopOpacity:.3}),t.jsx("stop",{"code-path":"src/pages/HostMonitor.tsx:394:33",offset:"100%",stopColor:"#a78bfa",stopOpacity:.05})]})}),t.jsx(nt,{"code-path":"src/pages/HostMonitor.tsx:397:29",type:"monotone",dataKey:c,stroke:"#a78bfa",strokeWidth:1.5,fill:"url(#fdGrad)",name:"FD使用率"})]})})})]}):t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:404:19",className:"text-center py-4 text-xs text-[var(--dg-text-muted)]",children:"等待数据…"})]})}),t.jsx(I,{"code-path":"src/pages/HostMonitor.tsx:409:13",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:t.jsxs(F,{"code-path":"src/pages/HostMonitor.tsx:410:15",className:"p-4",children:[t.jsxs("h3",{"code-path":"src/pages/HostMonitor.tsx:411:17",className:"text-xs font-medium text-[var(--dg-text-primary)] mb-3 flex items-center gap-2",children:[t.jsx(Jt,{"code-path":"src/pages/HostMonitor.tsx:412:19",className:"h-4 w-4 text-emerald-400"}),"上下文切换"]}),D?.ctx_per_sec!=null?t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:415:19",className:"space-y-4",children:[t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:416:21",className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:417:23",className:"bg-[var(--dg-bg-primary)] rounded-lg p-3 text-center",children:[t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:418:25",className:"text-[10px] text-[var(--dg-text-muted)] mb-1",children:"CTX 切换/秒"}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:419:25",className:"text-lg font-bold font-mono text-emerald-400",children:[(D.ctx_per_sec/1e6).toFixed(1),t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:420:66",className:"text-xs font-normal text-[var(--dg-text-muted)] ml-0.5",children:"M"})]}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:422:25",className:"text-[10px] text-[var(--dg-text-muted)] mt-1 font-mono",children:[D.ctx_per_sec?.toLocaleString()," 次"]})]}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:424:23",className:"bg-[var(--dg-bg-primary)] rounded-lg p-3 text-center",children:[t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:425:25",className:"text-[10px] text-[var(--dg-text-muted)] mb-1",children:"IRQ 中断/秒"}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:426:25",className:"text-lg font-bold font-mono text-amber-400",children:[(D.irq_per_sec/1e6).toFixed(1),t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:427:66",className:"text-xs font-normal text-[var(--dg-text-muted)] ml-0.5",children:"M"})]}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:429:25",className:"text-[10px] text-[var(--dg-text-muted)] mt-1 font-mono",children:[D.irq_per_sec?.toLocaleString()," 次"]})]})]}),t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:432:21",className:"space-y-1",children:[t.jsxs("div",{"code-path":"src/pages/HostMonitor.tsx:433:23",className:"flex justify-between text-[10px]",children:[t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:434:25",className:"text-emerald-400",children:"CTX"}),t.jsx("span",{"code-path":"src/pages/HostMonitor.tsx:435:25",className:"text-amber-400",children:"IRQ"})]}),t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:437:23",className:"h-2 bg-[var(--dg-bg-primary)] rounded-full overflow-hidden flex",children:D.ctx_per_sec+D.irq_per_sec>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:440:29",className:"h-full bg-emerald-500/60 rounded-l-full transition-all",style:{width:`${(D.ctx_per_sec/(D.ctx_per_sec+D.irq_per_sec)*100).toFixed(1)}%`}}),t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:442:29",className:"h-full bg-amber-500/60 rounded-r-full transition-all",style:{width:`${(D.irq_per_sec/(D.ctx_per_sec+D.irq_per_sec)*100).toFixed(1)}%`}})]})})]})]}):t.jsx("div",{"code-path":"src/pages/HostMonitor.tsx:450:19",className:"text-center py-4 text-xs text-[var(--dg-text-muted)]",children:"等待数据…"})]})})]})]}),t.jsx(ze,{"code-path":"src/pages/HostMonitor.tsx:457:9",selectedHost:a,serverInfo:P,latest:b,heartbeatInfo:ee,portInfoCount:et.length}),t.jsx(Ue,{"code-path":"src/pages/HostMonitor.tsx:465:9",selectedHost:a})]}),t.jsx(Ke,{"code-path":"src/pages/HostMonitor.tsx:468:7",open:R,onOpenChange:A,portPolicyMode:u,onModeChange:g,portWhitelist:M,onWhitelistChange:r,onSave:T,saving:Q})]})}export{ds as HostMonitor};