mirror of https://github.com/portainer/portainer
upgrade some badge components to match EE (#10451)
parent
57c45838d5
commit
7c4c985247
|
@ -63,15 +63,15 @@ function Cell({ row }: CellContext<ConfigMapRowData, string>) {
|
||||||
</Link>
|
</Link>
|
||||||
{isSystemConfigMap && (
|
{isSystemConfigMap && (
|
||||||
<Badge type="success" className="ml-2">
|
<Badge type="success" className="ml-2">
|
||||||
system
|
System
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
{!isSystemToken && !hasConfigurationOwner && (
|
{!isSystemToken && !hasConfigurationOwner && (
|
||||||
<Badge className="ml-2">external</Badge>
|
<Badge className="ml-2">External</Badge>
|
||||||
)}
|
)}
|
||||||
{!row.original.inUse && !isSystemConfigMap && (
|
{!row.original.inUse && !isSystemConfigMap && (
|
||||||
<Badge type="warn" className="ml-2">
|
<Badge type="warn" className="ml-2">
|
||||||
unused
|
Unused
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -66,15 +66,15 @@ function Cell({ row }: CellContext<SecretRowData, string>) {
|
||||||
</Link>
|
</Link>
|
||||||
{isSystemSecret && (
|
{isSystemSecret && (
|
||||||
<Badge type="success" className="ml-2">
|
<Badge type="success" className="ml-2">
|
||||||
system
|
System
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
{!isSystemToken && !hasConfigurationOwner && (
|
{!isSystemToken && !hasConfigurationOwner && (
|
||||||
<Badge className="ml-2">external</Badge>
|
<Badge className="ml-2">External</Badge>
|
||||||
)}
|
)}
|
||||||
{!row.original.inUse && !isSystemSecret && (
|
{!row.original.inUse && !isSystemSecret && (
|
||||||
<Badge type="warn" className="ml-2">
|
<Badge type="warn" className="ml-2">
|
||||||
unused
|
Unused
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,7 +22,7 @@ function Cell({ row, getValue }: CellContext<Ingress, string>) {
|
||||||
const isSystemIngress = isSystemNamespace(namespace);
|
const isSystemIngress = isSystemNamespace(namespace);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex whitespace-nowrap">
|
<div className="flex flex-nowrap whitespace-nowrap">
|
||||||
<Authorized authorizations="K8sIngressesW" childrenUnauthorized={name}>
|
<Authorized authorizations="K8sIngressesW" childrenUnauthorized={name}>
|
||||||
<Link
|
<Link
|
||||||
to="kubernetes.ingresses.edit"
|
to="kubernetes.ingresses.edit"
|
||||||
|
@ -38,7 +38,7 @@ function Cell({ row, getValue }: CellContext<Ingress, string>) {
|
||||||
</Authorized>
|
</Authorized>
|
||||||
{isSystemIngress && (
|
{isSystemIngress && (
|
||||||
<Badge type="success" className="ml-2">
|
<Badge type="success" className="ml-2">
|
||||||
system
|
System
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { Authorized } from '@/react/hooks/useUser';
|
import { Authorized } from '@/react/hooks/useUser';
|
||||||
import { isSystemNamespace } from '@/react/kubernetes/namespaces/utils';
|
import { isSystemNamespace } from '@/react/kubernetes/namespaces/utils';
|
||||||
|
|
||||||
|
import { Badge } from '@@/Badge';
|
||||||
|
|
||||||
import { columnHelper } from './helper';
|
import { columnHelper } from './helper';
|
||||||
|
|
||||||
export const name = columnHelper.accessor(
|
export const name = columnHelper.accessor(
|
||||||
|
@ -32,21 +34,21 @@ export const name = columnHelper.accessor(
|
||||||
!row.original.Labels['io.portainer.kubernetes.application.owner'];
|
!row.original.Labels['io.portainer.kubernetes.application.owner'];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className="flex">
|
||||||
<Authorized authorizations="K8sServiceW" childrenUnauthorized={name}>
|
<Authorized authorizations="K8sServiceW" childrenUnauthorized={name}>
|
||||||
{name}
|
{name}
|
||||||
|
|
||||||
{isSystem && (
|
{isSystem && (
|
||||||
<span className="label label-info image-tag label-margins">
|
<Badge type="success" className="ml-2">
|
||||||
system
|
System
|
||||||
</span>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isExternal && !isSystem && (
|
{isExternal && !isSystem && (
|
||||||
<span className="label label-primary image-tag label-margins">
|
<Badge className="ml-2">External</Badge>
|
||||||
external
|
|
||||||
</span>
|
|
||||||
)}
|
)}
|
||||||
</Authorized>
|
</Authorized>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue