1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00
portainer/app/react/kubernetes/cluster/HomeView/NodesDatatable/columns/cpu.tsx
2023-10-16 21:19:08 +01:00

14 lines
374 B
TypeScript

import { parseCpu } from '@/react/kubernetes/utils';
import { NodeRowData } from '../types';
import { columnHelper } from './helper';
export const cpu = columnHelper.accessor((row) => getCPU(row), {
header: 'CPU',
cell: ({ row: { original: node } }) => getCPU(node),
});
function getCPU(node: NodeRowData) {
return parseCpu(node.status?.allocatable?.cpu ?? '');
}