-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Add eui basic table and columns
- Loading branch information
1 parent
26710d6
commit 5a212ca
Showing
3 changed files
with
127 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table_columns.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiBasicTableColumn } from '@elastic/eui'; | ||
import React from 'react'; | ||
import { NumberCell } from '../../../../components/infrastructure_node_metrics_tables/shared/components'; | ||
|
||
export interface HostNodeRow { | ||
name: string; | ||
cpuCores: number | null; | ||
os: string; | ||
rx: { | ||
avg: number | null; | ||
}; | ||
tx: { | ||
avg: number | null; | ||
}; | ||
memory: { | ||
avg: number | null; | ||
}; | ||
servicesOnHost: number | null; | ||
averageMemoryUsagePercent: number | null; | ||
} | ||
|
||
export const HostsTableColumns: Array<EuiBasicTableColumn<HostNodeRow>> = [ | ||
{ | ||
name: 'Name', | ||
field: 'name', | ||
truncateText: true, | ||
render: (name: string) => <div>{name}</div>, | ||
}, | ||
{ | ||
name: 'Operating System', | ||
field: 'os', | ||
render: (os: string) => <div>{os}</div>, | ||
}, | ||
{ | ||
name: '# of CPUs', | ||
field: 'cpuCores', | ||
render: (cpuCores: number) => <NumberCell value={cpuCores} />, | ||
}, | ||
{ | ||
name: 'Disk Latency', | ||
field: 'cpuCores', | ||
render: (ds: number) => <NumberCell value={ds} unit=" ms" />, | ||
}, | ||
{ | ||
name: 'TX (avg.)', | ||
field: 'tx', | ||
render: (tx: { avg: number }) => <NumberCell value={tx.avg} />, | ||
}, | ||
{ | ||
name: 'RX (avg.)', | ||
field: 'rx', | ||
render: (rx: { avg: number }) => <NumberCell value={rx.avg} />, | ||
}, | ||
{ | ||
name: 'Memory total (avg.)', | ||
field: 'memory', | ||
render: (memory: { avg: number }) => <NumberCell value={memory.avg} unit=" MB" />, | ||
}, | ||
{ | ||
name: 'Services on Host', | ||
field: 'servicesOnHost', | ||
render: (servicesOnHost: number) => <NumberCell value={servicesOnHost} />, | ||
}, | ||
{ | ||
name: 'Memory usage (avg.)', | ||
field: 'averageMemoryUsagePercent', | ||
render: (averageMemoryUsagePercent: number) => ( | ||
<NumberCell value={averageMemoryUsagePercent} unit="%" /> | ||
), | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters