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:
parent
5f0af62521
commit
89194405ee
36 changed files with 569 additions and 210 deletions
|
@ -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',
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -3,4 +3,5 @@ export type TagId = number;
|
|||
export interface Tag {
|
||||
ID: TagId;
|
||||
Name: string;
|
||||
Endpoints: Record<number, boolean>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue