mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(helm): update helm view [r8s-256] (#582)
Co-authored-by: Cara Ryan <cara.ryan@portainer.io> Co-authored-by: James Player <james.player@portainer.io> Co-authored-by: stevensbkang <skan070@gmail.com>
This commit is contained in:
parent
46eddbe7b9
commit
0ca9321db1
57 changed files with 2635 additions and 222 deletions
|
@ -0,0 +1,38 @@
|
|||
import { Datatable } from '@@/datatables';
|
||||
import { createPersistedStore } from '@@/datatables/types';
|
||||
import { useTableState } from '@@/datatables/useTableState';
|
||||
import { Widget } from '@@/Widget';
|
||||
|
||||
import { GenericResource } from '../../../types';
|
||||
|
||||
import { columns } from './columns';
|
||||
import { useResourceRows } from './useResourceRows';
|
||||
|
||||
type Props = {
|
||||
resources: GenericResource[];
|
||||
};
|
||||
|
||||
const storageKey = 'helm-resources';
|
||||
const settingsStore = createPersistedStore(storageKey, 'resourceType');
|
||||
|
||||
export function ResourcesTable({ resources }: Props) {
|
||||
const tableState = useTableState(settingsStore, storageKey);
|
||||
const rows = useResourceRows(resources);
|
||||
|
||||
return (
|
||||
<Widget>
|
||||
<Datatable
|
||||
// no widget to avoid extra padding from app/react/components/datatables/TableContainer.tsx
|
||||
noWidget
|
||||
dataset={rows}
|
||||
columns={columns}
|
||||
includeSearch
|
||||
settingsManager={tableState}
|
||||
emptyContentLabel="No resources found"
|
||||
disableSelect
|
||||
getRowId={(row) => row.id}
|
||||
data-cy="helm-resources-datatable"
|
||||
/>
|
||||
</Widget>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue