mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +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
|
@ -3,4 +3,5 @@ import { columnHelper } from './helper';
|
|||
export const className = columnHelper.accessor('ClassName', {
|
||||
header: 'Class Name',
|
||||
id: 'className',
|
||||
cell: ({ row }) => row.original.ClassName || '-',
|
||||
});
|
||||
|
|
|
@ -32,7 +32,7 @@ function Cell({ row }: CellContext<Ingress, string>) {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-y-0.5">
|
||||
<div className="flex flex-col gap-y-0.5 whitespace-nowrap">
|
||||
{paths.map((path) => (
|
||||
<div key={`${path.Host}${path.Path}${path.ServiceName}:${path.Port}`}>
|
||||
<span className="flex flex-nowrap items-center gap-1 px-2">
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,4 +3,5 @@ import { columnHelper } from './helper';
|
|||
export const type = columnHelper.accessor('Type', {
|
||||
header: 'Type',
|
||||
id: 'type',
|
||||
cell: ({ row }) => row.original.Type || '-',
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue