mirror of https://github.com/portainer/portainer
fix(app/images): nodeName on images list links (#484)
parent
52bb06eb7b
commit
2bccb3589e
|
@ -1,5 +1,4 @@
|
||||||
import { CellContext, Column } from '@tanstack/react-table';
|
import { CellContext, Column } from '@tanstack/react-table';
|
||||||
import { useSref } from '@uirouter/react';
|
|
||||||
|
|
||||||
import { truncate } from '@/portainer/filters/filters';
|
import { truncate } from '@/portainer/filters/filters';
|
||||||
import { getValueAsArrayOfStrings } from '@/portainer/helpers/array';
|
import { getValueAsArrayOfStrings } from '@/portainer/helpers/array';
|
||||||
|
@ -7,6 +6,7 @@ import { ImagesListResponse } from '@/react/docker/images/queries/useImages';
|
||||||
|
|
||||||
import { MultipleSelectionFilter } from '@@/datatables/Filter';
|
import { MultipleSelectionFilter } from '@@/datatables/Filter';
|
||||||
import { UnusedBadge } from '@@/Badge/UnusedBadge';
|
import { UnusedBadge } from '@@/Badge/UnusedBadge';
|
||||||
|
import { Link } from '@@/Link';
|
||||||
|
|
||||||
import { columnHelper } from './helper';
|
import { columnHelper } from './helper';
|
||||||
|
|
||||||
|
@ -62,22 +62,20 @@ function FilterByUsage<TData extends { Used: boolean }>({
|
||||||
}
|
}
|
||||||
|
|
||||||
function Cell({
|
function Cell({
|
||||||
getValue,
|
row: { original: item },
|
||||||
row: { original: image },
|
|
||||||
}: CellContext<ImagesListResponse, string>) {
|
}: CellContext<ImagesListResponse, string>) {
|
||||||
const name = getValue();
|
|
||||||
|
|
||||||
const linkProps = useSref('.image', {
|
|
||||||
id: image.id,
|
|
||||||
imageId: image.id,
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex gap-1">
|
<>
|
||||||
<a href={linkProps.href} onClick={linkProps.onClick} title={name}>
|
<Link
|
||||||
{truncate(name, 40)}
|
to=".image"
|
||||||
</a>
|
params={{ id: item.id, nodeName: item.nodeName }}
|
||||||
{!image.used && <UnusedBadge />}
|
title={item.id}
|
||||||
</div>
|
data-cy={`image-link-${item.id}`}
|
||||||
|
className="mr-2"
|
||||||
|
>
|
||||||
|
{truncate(item.id, 40)}
|
||||||
|
</Link>
|
||||||
|
{!item.used && <UnusedBadge />}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue