mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add pod actions menu
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
894e0435d9
commit
b9f3083281
@ -33,6 +33,7 @@ import { ColumnDef, createColumnHelper, getCoreRowModel } from '@tanstack/react-
|
|||||||
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
|
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
|
||||||
import type { SubscribableStore, SubscribeStores } from "../../kube-watch-api/kube-watch-api";
|
import type { SubscribableStore, SubscribeStores } from "../../kube-watch-api/kube-watch-api";
|
||||||
import subscribeToStoresDisposersInjectable from "../../kube-watch-api/subscribe-to-stores-disposers.injectable";
|
import subscribeToStoresDisposersInjectable from "../../kube-watch-api/subscribe-to-stores-disposers.injectable";
|
||||||
|
import { KubeObjectMenu } from "../kube-object-menu";
|
||||||
|
|
||||||
enum columnId {
|
enum columnId {
|
||||||
name = "name",
|
name = "name",
|
||||||
@ -233,6 +234,12 @@ class NonInjectedPods extends React.Component<Dependencies> {
|
|||||||
header: "Status",
|
header: "Status",
|
||||||
cell: info => info.getValue(),
|
cell: info => info.getValue(),
|
||||||
}),
|
}),
|
||||||
|
columnHelper.display({
|
||||||
|
id: "actions",
|
||||||
|
size: 30,
|
||||||
|
cell: row => <KubeObjectMenu object={row.row.original} />,
|
||||||
|
enableResizing: false,
|
||||||
|
})
|
||||||
]
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -58,15 +58,8 @@ export function TableList<Data>({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configurable) {
|
if (configurable && cols.findIndex(({ id }) => id == 'actions') !== -1) {
|
||||||
cols.push(
|
cols[cols.findIndex(({ id }) => id == 'actions')].header = () => <ColumnConfigMenu table={table}/>
|
||||||
columnHelper.display({
|
|
||||||
id: "config",
|
|
||||||
header: () => <ColumnConfigMenu table={table}/>,
|
|
||||||
size: 30,
|
|
||||||
enableResizing: false,
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cols;
|
return cols;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user