1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 14:55:27 +02:00

fix(kube): improve dashboard load speed [EE-4941] (#8572)

* apply changes from EE

* clear query cache when logging out

* Text transitions in smoother
This commit is contained in:
Ali 2023-03-08 11:22:08 +13:00 committed by GitHub
parent 5f0af62521
commit 89194405ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 569 additions and 210 deletions

View file

@ -121,7 +121,17 @@ export const componentsModule = angular
.component('reactQueryDevTools', r2a(ReactQueryDevtoolsWrapper, []))
.component(
'dashboardItem',
r2a(DashboardItem, ['icon', 'type', 'value', 'children'])
r2a(DashboardItem, [
'icon',
'type',
'value',
'to',
'children',
'pluralType',
'isLoading',
'isRefetching',
'dataCy',
])
)
.component(
'datatableSearchbar',

View file

@ -5,6 +5,7 @@ import {
withError,
withInvalidate,
} from '@/react-tools/react-query';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { createTag, getTags } from './tags.service';
import { Tag, TagId } from './types';
@ -24,6 +25,14 @@ export function useTags<T = Tag[]>({
});
}
export function useTagsForEnvironment(environmentId: EnvironmentId) {
const { data: tags, isLoading } = useTags({
select: (tags) => tags.filter((tag) => tag.Endpoints[environmentId]),
});
return { tags, isLoading };
}
export function useCreateTagMutation() {
const queryClient = useQueryClient();

View file

@ -3,4 +3,5 @@ export type TagId = number;
export interface Tag {
ID: TagId;
Name: string;
Endpoints: Record<number, boolean>;
}