mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
fix(apps): update associated resources on deletion [r8s-124] (#75)
This commit is contained in:
parent
d418784346
commit
c1316532eb
15 changed files with 281 additions and 90 deletions
|
@ -12,6 +12,7 @@ import { useAuthorizations } from '@/react/hooks/useUser';
|
|||
import { isSystemNamespace } from '@/react/kubernetes/namespaces/queries/useIsSystemNamespace';
|
||||
import { KubernetesApplicationTypes } from '@/kubernetes/models/application/models/appConstants';
|
||||
import { useEnvironment } from '@/react/portainer/environments/queries';
|
||||
import { useIngresses } from '@/react/kubernetes/ingresses/queries';
|
||||
|
||||
import { TableSettingsMenu } from '@@/datatables';
|
||||
import { DeleteButton } from '@@/buttons/DeleteButton';
|
||||
|
@ -58,6 +59,8 @@ export function ApplicationsDatatable({
|
|||
namespace: tableState.namespace,
|
||||
withDependencies: true,
|
||||
});
|
||||
const ingressesQuery = useIngresses(environmentId);
|
||||
const ingresses = ingressesQuery.data ?? [];
|
||||
const applications = useApplicationsRowData(applicationsQuery.data);
|
||||
const filteredApplications = tableState.showSystemResources
|
||||
? applications
|
||||
|
@ -69,6 +72,7 @@ export function ApplicationsDatatable({
|
|||
const removeApplicationsMutation = useDeleteApplicationsMutation({
|
||||
environmentId,
|
||||
stacks,
|
||||
ingresses,
|
||||
reportStacks: false,
|
||||
});
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import { Service } from 'kubernetes-types/core/v1';
|
||||
import { HorizontalPodAutoscaler } from 'kubernetes-types/autoscaling/v2';
|
||||
|
||||
import { AppType, DeploymentType } from '../../types';
|
||||
|
||||
export interface ApplicationRowData extends Application {
|
||||
|
@ -9,7 +12,7 @@ export interface Application {
|
|||
Name: string;
|
||||
Image: string;
|
||||
Containers?: Array<unknown>;
|
||||
Services?: Array<unknown>;
|
||||
Services?: Array<Service>;
|
||||
CreationDate: string;
|
||||
ApplicationOwner?: string;
|
||||
StackName?: string;
|
||||
|
@ -48,6 +51,7 @@ export interface Application {
|
|||
MemoryLimit?: number;
|
||||
MemoryRequest?: number;
|
||||
};
|
||||
HorizontalPodAutoscaler?: HorizontalPodAutoscaler;
|
||||
}
|
||||
|
||||
export enum ConfigKind {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue