2023-05-02 06:42:16 +00:00
|
|
|
import { CellContext } from '@tanstack/react-table';
|
2022-09-21 04:49:42 +00:00
|
|
|
|
2022-11-13 08:10:18 +00:00
|
|
|
import { Authorized } from '@/react/hooks/useUser';
|
2022-10-17 21:46:27 +00:00
|
|
|
|
2022-09-21 04:49:42 +00:00
|
|
|
import { Link } from '@@/Link';
|
|
|
|
|
|
|
|
import { Ingress } from '../../types';
|
|
|
|
|
2023-05-02 06:42:16 +00:00
|
|
|
import { columnHelper } from './helper';
|
|
|
|
|
|
|
|
export const name = columnHelper.accessor('Name', {
|
|
|
|
header: 'Name',
|
|
|
|
cell: Cell,
|
|
|
|
id: 'name',
|
|
|
|
});
|
|
|
|
|
|
|
|
function Cell({ row, getValue }: CellContext<Ingress, string>) {
|
|
|
|
const name = getValue();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Authorized authorizations="K8sIngressesW" childrenUnauthorized={name}>
|
2022-10-17 21:46:27 +00:00
|
|
|
<Link
|
|
|
|
to="kubernetes.ingresses.edit"
|
|
|
|
params={{
|
|
|
|
uid: row.original.UID,
|
|
|
|
namespace: row.original.Namespace,
|
2023-05-02 06:42:16 +00:00
|
|
|
name,
|
2022-10-17 21:46:27 +00:00
|
|
|
}}
|
2023-05-02 06:42:16 +00:00
|
|
|
title={name}
|
2022-10-17 21:46:27 +00:00
|
|
|
>
|
2023-05-02 06:42:16 +00:00
|
|
|
{name}
|
2022-10-17 21:46:27 +00:00
|
|
|
</Link>
|
|
|
|
</Authorized>
|
2023-05-02 06:42:16 +00:00
|
|
|
);
|
|
|
|
}
|