mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 14:59:41 +02:00
feat(docker/containers): migrate network tab to react [EE-5210] (#10344)
This commit is contained in:
parent
e92f067e42
commit
2b47b84e5e
13 changed files with 413 additions and 246 deletions
|
@ -10,6 +10,7 @@ import { withGlobalError } from '@/react-tools/react-query';
|
|||
import { urlBuilder } from '../containers.service';
|
||||
import { DockerContainerResponse } from '../types/response';
|
||||
import { parseListViewModel } from '../utils';
|
||||
import { DockerContainer } from '../types';
|
||||
|
||||
import { Filters } from './types';
|
||||
import { queryKeys } from './query-keys';
|
||||
|
@ -20,14 +21,15 @@ interface UseContainers {
|
|||
nodeName?: string;
|
||||
}
|
||||
|
||||
export function useContainers(
|
||||
export function useContainers<T = DockerContainer[]>(
|
||||
environmentId: EnvironmentId,
|
||||
{
|
||||
autoRefreshRate,
|
||||
|
||||
select,
|
||||
...params
|
||||
}: UseContainers & {
|
||||
autoRefreshRate?: number;
|
||||
select?: (data: DockerContainer[]) => T;
|
||||
} = {}
|
||||
) {
|
||||
return useQuery(
|
||||
|
@ -38,11 +40,12 @@ export function useContainers(
|
|||
refetchInterval() {
|
||||
return autoRefreshRate ?? false;
|
||||
},
|
||||
select,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async function getContainers(
|
||||
export async function getContainers(
|
||||
environmentId: EnvironmentId,
|
||||
{ all = true, filters, nodeName }: UseContainers = {}
|
||||
) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue