mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +02:00
fix(app): improve perceived ingress load time [EE-5805] (#9946)
Co-authored-by: testa113 <testa113>
This commit is contained in:
parent
6a4e44ee0a
commit
b19800681f
4 changed files with 18 additions and 9 deletions
|
@ -2,6 +2,11 @@ import { useEffect, useMemo, useState } from 'react';
|
|||
import { FormikErrors } from 'formik';
|
||||
|
||||
import { KubernetesApplicationPublishingTypes } from '@/kubernetes/models/application/models';
|
||||
import { useEnvironmentId } from '@/react/hooks/useEnvironmentId';
|
||||
import {
|
||||
useIngressControllers,
|
||||
useIngresses,
|
||||
} from '@/react/kubernetes/ingresses/queries';
|
||||
|
||||
import { FormSection } from '@@/form-components/FormSection';
|
||||
|
||||
|
@ -50,6 +55,11 @@ export function KubeServicesForm({
|
|||
const [selectedServiceType, setSelectedServiceType] =
|
||||
useState<ServiceTypeValue>('ClusterIP');
|
||||
|
||||
// start loading ingresses and controllers early to reduce perceived loading time
|
||||
const environmentId = useEnvironmentId();
|
||||
useIngresses(environmentId, namespace ? [namespace] : []);
|
||||
useIngressControllers(environmentId, namespace);
|
||||
|
||||
// when the appName changes, update the names for each service
|
||||
// and the serviceNames for each service port
|
||||
const newServiceNames = useMemo(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue