mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(docker/images): show used tag correctly [EE-5396] (#10305)
This commit is contained in:
parent
b895e88075
commit
9bf2957ea7
29 changed files with 383 additions and 287 deletions
|
@ -1,17 +1,14 @@
|
|||
import { useQuery } from 'react-query';
|
||||
import { Loader } from 'lucide-react';
|
||||
|
||||
import {
|
||||
getContainerImagesStatus,
|
||||
getServiceImagesStatus,
|
||||
} from '@/react/docker/images/image.service';
|
||||
import { useEnvironment } from '@/react/portainer/environments/queries';
|
||||
import { statusIcon } from '@/react/docker/components/ImageStatus/helpers';
|
||||
import { ResourceID, ResourceType } from '@/react/docker/images/types';
|
||||
import { EnvironmentId } from '@/react/portainer/environments/types';
|
||||
|
||||
import { Icon } from '@@/Icon';
|
||||
|
||||
import { ResourceID, ResourceType } from './types';
|
||||
import { useImageNotification } from './useImageNotification';
|
||||
|
||||
export interface Props {
|
||||
environmentId: EnvironmentId;
|
||||
resourceId: ResourceID;
|
||||
|
@ -56,30 +53,3 @@ export function ImageStatus({
|
|||
<Icon icon={statusIcon(data)} size="sm" className="!mr-1 align-middle" />
|
||||
);
|
||||
}
|
||||
|
||||
export function useImageNotification(
|
||||
environmentId: number,
|
||||
resourceId: ResourceID,
|
||||
resourceType: ResourceType,
|
||||
nodeName: string,
|
||||
enabled = false
|
||||
) {
|
||||
return useQuery(
|
||||
[
|
||||
'environments',
|
||||
environmentId,
|
||||
'docker',
|
||||
'images',
|
||||
resourceType,
|
||||
resourceId,
|
||||
'status',
|
||||
],
|
||||
() =>
|
||||
resourceType === ResourceType.SERVICE
|
||||
? getServiceImagesStatus(environmentId, resourceId)
|
||||
: getContainerImagesStatus(environmentId, resourceId, nodeName),
|
||||
{
|
||||
enabled,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue