-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathoverview.jsx
44 lines (41 loc) · 1.11 KB
/
overview.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import ClusterMetric from "../../components/cluster_metric";
import { Button } from 'antd';
import InstallAgent from '@/components/Overview/Monitor/InstallAgent';
import { formatMessage } from "umi/locale";
const timezone = "local";
export default ({
hostID,
timeRange,
handleTimeChange,
info,
bucketSize,
timezone,
timeout,
refresh,
}) => {
const isAgent = info?.agent_id
return (
<ClusterMetric
timezone={timezone}
timeRange={timeRange}
timeout={timeout}
bucketSize={bucketSize}
refresh={refresh}
handleTimeChange={handleTimeChange}
overview={1}
fetchUrl={`/host/${hostID}/metrics`}
renderExtra={() => {
if (isAgent) return;
return <InstallAgent height={226} desc={formatMessage({ id: "cluster.metrics.host.uninstall_agent" })}/>
}}
metrics={[
'cpu_used_percent',
'memory_used_percent',
'disk_used_percent',
isAgent ? 'network_summary' : undefined,
isAgent ? 'disk_read_rate' : undefined,
isAgent ? 'disk_write_rate' : undefined
].filter((item) => !!item)}
/>
);
}