1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 13:55:21 +02:00

fix(edge-stack): URI too large error for edge stacks with a large amount of environments [EE-5583] (#9085)

* refactor(edge-stacks): filter endpoints by edgeStack

* feat(api/endpoints): edge stack filter support filtering on status in stack

* refactor(endpoints): use separate query params and not JSON query param when querying for an edge stack

* feat(api/endpoints): handle stack filter on dynamic groups + unique list with multiple groups sharing environments

* fix(app/endpoints): edge stack related query params type definition

* fix(api/endpoints): rebase conflicts on imports
This commit is contained in:
LP B 2023-06-19 11:55:33 +02:00 committed by GitHub
parent 223dfe89dd
commit 2eca5e05d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 167 additions and 35 deletions

View file

@ -17,7 +17,7 @@ interface EdgeStackStatusDetails {
ImagesPulled: boolean;
}
interface EdgeStackStatus {
export interface EdgeStackStatus {
Details: EdgeStackStatusDetails;
Error: string;
EndpointID: EnvironmentId;

View file

@ -3,6 +3,7 @@ import { type EnvironmentGroupId } from '@/react/portainer/environments/environm
import { type TagId } from '@/portainer/tags/types';
import { UserId } from '@/portainer/users/types';
import { TeamId } from '@/react/portainer/users/teams/types';
import { EdgeStack, EdgeStackStatus } from '@/react/edge/edge-stacks/types';
import type {
Environment,
@ -14,7 +15,16 @@ import type {
import { buildUrl } from './utils';
export interface EnvironmentsQueryParams {
export type EdgeStackEnvironmentsQueryParams =
| {
edgeStackId?: EdgeStack['Id'];
}
| {
edgeStackId: EdgeStack['Id'];
edgeStackStatus?: keyof EdgeStackStatus['Details'];
};
export interface BaseEnvironmentsQueryParams {
search?: string;
types?: EnvironmentType[] | readonly EnvironmentType[];
tagIds?: TagId[];
@ -32,6 +42,9 @@ export interface EnvironmentsQueryParams {
edgeCheckInPassedSeconds?: number;
}
export type EnvironmentsQueryParams = BaseEnvironmentsQueryParams &
EdgeStackEnvironmentsQueryParams;
export interface GetEnvironmentsOptions {
start?: number;
limit?: number;

View file

@ -12,12 +12,12 @@ import { queryKeys } from './query-keys';
export const ENVIRONMENTS_POLLING_INTERVAL = 30000; // in ms
export interface Query extends EnvironmentsQueryParams {
export type Query = EnvironmentsQueryParams & {
page?: number;
pageLimit?: number;
sort?: string;
order?: 'asc' | 'desc';
}
};
type GetEndpointsResponse = Awaited<ReturnType<typeof getEnvironments>>;