mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
fix(ingress): handle system resources [EE-4775] (#9972)
* fix(ingress): handle system resources [EE-4775]
This commit is contained in:
parent
5586910e9d
commit
1e61f7e305
9 changed files with 105 additions and 60 deletions
|
@ -1,8 +1,10 @@
|
|||
import { CellContext } from '@tanstack/react-table';
|
||||
|
||||
import { Authorized } from '@/react/hooks/useUser';
|
||||
import { isSystemNamespace } from '@/react/kubernetes/namespaces/utils';
|
||||
|
||||
import { Link } from '@@/Link';
|
||||
import { Badge } from '@@/Badge';
|
||||
|
||||
import { Ingress } from '../../types';
|
||||
|
||||
|
@ -16,20 +18,29 @@ export const name = columnHelper.accessor('Name', {
|
|||
|
||||
function Cell({ row, getValue }: CellContext<Ingress, string>) {
|
||||
const name = getValue();
|
||||
const namespace = row.original.Namespace;
|
||||
const isSystemIngress = isSystemNamespace(namespace);
|
||||
|
||||
return (
|
||||
<Authorized authorizations="K8sIngressesW" childrenUnauthorized={name}>
|
||||
<Link
|
||||
to="kubernetes.ingresses.edit"
|
||||
params={{
|
||||
uid: row.original.UID,
|
||||
namespace: row.original.Namespace,
|
||||
name,
|
||||
}}
|
||||
title={name}
|
||||
>
|
||||
{name}
|
||||
</Link>
|
||||
</Authorized>
|
||||
<div className="flex whitespace-nowrap">
|
||||
<Authorized authorizations="K8sIngressesW" childrenUnauthorized={name}>
|
||||
<Link
|
||||
to="kubernetes.ingresses.edit"
|
||||
params={{
|
||||
uid: row.original.UID,
|
||||
namespace,
|
||||
name,
|
||||
}}
|
||||
title={name}
|
||||
>
|
||||
{name}
|
||||
</Link>
|
||||
</Authorized>
|
||||
{isSystemIngress && (
|
||||
<Badge type="success" className="ml-2">
|
||||
system
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue