refactor(quality): Q27 前端巨型组件拆分 — HostMonitor 547L→224L (-59%), 提取 host-monitor/tabs/ 8 个文件 (BasicTab + DiskTab + NetworkTab + PortMonitorTab + ProcessTable + FDUsageCard + ContextSwitchCard + ProcessTab), TABS 常量数组提取为模块级, PCT_REF_LINES 常量提升到 types.ts, 端口/进程数组类型 JsonData→JsonData[] 类型安全升级, 零逻辑变更, ESLint errors=0/warnings=65/any=0, tsc -b=0, npm build✓ (17.64s), go build=0, 17/17 测试通过
This commit is contained in:
1 parent
03a84049fb
commit
470832342e
12 files changed
+563
-378
No files matched your search
@@ -0,0 +1,39 @@
|
||||
// 主机监控 — 进程监控 Tab (进程TOP表 + FD卡片 + CTX/IRQ卡片)
|
||||
import type { RefObject } from 'react';
|
||||
import type { AggType, BucketPoint } from '../types';
|
||||
import type { JsonData } from '@/types/common';
|
||||
import { ProcessTable } from './ProcessTable';
|
||||
import { FDUsageCard } from './FDUsageCard';
|
||||
import { ContextSwitchCard } from './ContextSwitchCard';
|
||||
import type { ZoomableChartHandle } from '../ZoomableAreaChart';
|
||||
|
||||
export interface ProcessTabProps {
|
||||
processTop: JsonData[];
|
||||
fdInfo: JsonData;
|
||||
csInfo: JsonData;
|
||||
fdMetrics: BucketPoint[];
|
||||
aggType: AggType;
|
||||
fdChartRef: RefObject<ZoomableChartHandle | null>;
|
||||
fdChartZoomed: boolean;
|
||||
setFdChartZoomed: (v: boolean) => void;
|
||||
}
|
||||
|
||||
export function ProcessTab(props: ProcessTabProps) {
|
||||
const { processTop, fdInfo, csInfo, fdMetrics, aggType, fdChartRef, fdChartZoomed, setFdChartZoomed } = props;
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<ProcessTable processTop={processTop} />
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||
<FDUsageCard
|
||||
fdInfo={fdInfo}
|
||||
fdMetrics={fdMetrics}
|
||||
aggType={aggType}
|
||||
fdChartRef={fdChartRef}
|
||||
fdChartZoomed={fdChartZoomed}
|
||||
setFdChartZoomed={setFdChartZoomed}
|
||||
/>
|
||||
<ContextSwitchCard csInfo={csInfo} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user