mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(helm): helm actions [r8s-259] (#715)
Co-authored-by: James Player <james.player@portainer.io> Co-authored-by: Cara Ryan <cara.ryan@portainer.io> Co-authored-by: stevensbkang <skan070@gmail.com>
This commit is contained in:
parent
dfa32b6755
commit
4ee349bd6b
117 changed files with 4161 additions and 696 deletions
|
@ -1,4 +1,8 @@
|
|||
import { Row } from '@tanstack/react-table';
|
||||
import { Event } from 'kubernetes-types/core/v1';
|
||||
|
||||
import { Badge, BadgeType } from '@@/Badge';
|
||||
import { filterHOC } from '@@/datatables/Filter';
|
||||
|
||||
import { columnHelper } from './helper';
|
||||
|
||||
|
@ -7,6 +11,14 @@ export const eventType = columnHelper.accessor('type', {
|
|||
cell: ({ getValue }) => (
|
||||
<Badge type={getBadgeColor(getValue())}>{getValue()}</Badge>
|
||||
),
|
||||
|
||||
meta: {
|
||||
filter: filterHOC('Filter by event type'),
|
||||
},
|
||||
enableColumnFilter: true,
|
||||
filterFn: (row: Row<Event>, _: string, filterValue: string[]) =>
|
||||
filterValue.length === 0 ||
|
||||
(!!row.original.type && filterValue.includes(row.original.type)),
|
||||
});
|
||||
|
||||
function getBadgeColor(status?: string): BadgeType {
|
||||
|
|
|
@ -2,5 +2,6 @@ import { date } from './date';
|
|||
import { kind } from './kind';
|
||||
import { eventType } from './eventType';
|
||||
import { message } from './message';
|
||||
import { name } from './name';
|
||||
|
||||
export const columns = [date, kind, eventType, message];
|
||||
export const columns = [date, name, kind, eventType, message];
|
||||
|
|
|
@ -1,8 +1,21 @@
|
|||
import { Row } from '@tanstack/react-table';
|
||||
import { Event } from 'kubernetes-types/core/v1';
|
||||
|
||||
import { filterHOC } from '@@/datatables/Filter';
|
||||
|
||||
import { columnHelper } from './helper';
|
||||
|
||||
export const kind = columnHelper.accessor(
|
||||
(event) => event.involvedObject.kind,
|
||||
{
|
||||
header: 'Kind',
|
||||
meta: {
|
||||
filter: filterHOC('Filter by kind'),
|
||||
},
|
||||
enableColumnFilter: true,
|
||||
filterFn: (row: Row<Event>, _: string, filterValue: string[]) =>
|
||||
filterValue.length === 0 ||
|
||||
(!!row.original.involvedObject.kind &&
|
||||
filterValue.includes(row.original.involvedObject.kind)),
|
||||
}
|
||||
);
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import { columnHelper } from './helper';
|
||||
|
||||
export const name = columnHelper.accessor(
|
||||
(event) => event.involvedObject.name ?? '-',
|
||||
{
|
||||
header: 'Name',
|
||||
cell: ({ getValue }) => {
|
||||
const name = getValue();
|
||||
return (
|
||||
<span title={name} className="ellipsis max-w-sm">
|
||||
{name}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
}
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue