Skip to content

Commit

Permalink
Merge pull request #2620 from headlamp-k8s/table-perf
Browse files Browse the repository at this point in the history
frontend: Improve Table performance and update styles
  • Loading branch information
sniok authored Dec 6, 2024
2 parents 70eff80 + 912876f commit 45c3b59
Show file tree
Hide file tree
Showing 53 changed files with 24,676 additions and 36,787 deletions.
3 changes: 2 additions & 1 deletion frontend/src/components/App/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ function HomeComponent(props: HomeComponentProps) {
},
{
label: t('Status'),
getValue: cluster => cluster.name,
getValue: cluster =>
errors[cluster.name] === null ? 'Active' : errors[cluster.name]?.message,
render: ({ name }) => <ClusterStatus error={errors[name]} />,
},
{
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions frontend/src/components/common/Resource/ResourceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function ResourceTableContent<RowItem extends KubeObject>(props: ResourceTablePr
mrtColumn.accessorFn = (item: RowItem) => item[column.datum];
}
if ('render' in column) {
mrtColumn.Cell = ({ row }: { row: MRT_Row<any> }) =>
mrtColumn.Cell = ({ row }: { row: MRT_Row<RowItem> }) =>
column.render?.(row.original) ?? null;
}
if (sort && typeof sort === 'function') {
Expand All @@ -333,7 +333,7 @@ function ResourceTableContent<RowItem extends KubeObject>(props: ResourceTablePr
header: t('translation|Name'),
gridTemplate: 1.5,
accessorFn: (item: RowItem) => item.metadata.name,
Cell: ({ row }: { row: MRT_Row<any> }) =>
Cell: ({ row }: { row: MRT_Row<RowItem> }) =>
row.original && <Link kubeObject={row.original} />,
};
case 'age':
Expand Down Expand Up @@ -514,6 +514,7 @@ function ResourceTableContent<RowItem extends KubeObject>(props: ResourceTablePr
}}
globalFilterFn="kubeObjectSearch"
filterFunction={filterFunc as any}
getRowId={item => item?.metadata?.uid}
/>
</>
);
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 45c3b59

Please sign in to comment.