import { Box, Database, FileCode, Layers, Lock, Shuffle } from 'lucide-react'; import { useQueryClient } from 'react-query'; import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import Route from '@/assets/ico/route.svg?c'; import { DashboardGrid } from '@@/DashboardItem/DashboardGrid'; import { DashboardItem } from '@@/DashboardItem/DashboardItem'; import { PageHeader } from '@@/PageHeader'; import { useApplicationsQuery } from '../applications/application.queries'; import { usePVCsQuery } from '../volumes/usePVCsQuery'; import { useServicesForCluster } from '../services/service'; import { useIngresses } from '../ingresses/queries'; import { useConfigMapsForCluster } from '../configs/configmap.service'; import { useSecretsForCluster } from '../configs/secret.service'; import { useNamespacesQuery } from '../namespaces/queries/useNamespacesQuery'; import { EnvironmentInfo } from './EnvironmentInfo'; export function DashboardView() { const queryClient = useQueryClient(); const environmentId = useEnvironmentId(); const { data: namespaces, ...namespacesQuery } = useNamespacesQuery(environmentId); const namespaceNames = namespaces && Object.keys(namespaces); const { data: applications, ...applicationsQuery } = useApplicationsQuery( environmentId, namespaceNames ); const { data: pvcs, ...pvcsQuery } = usePVCsQuery( environmentId, namespaceNames ); const { data: services, ...servicesQuery } = useServicesForCluster( environmentId, namespaceNames ); const { data: ingresses, ...ingressesQuery } = useIngresses( environmentId, namespaceNames ); const { data: configMaps, ...configMapsQuery } = useConfigMapsForCluster( environmentId, namespaceNames ); const { data: secrets, ...secretsQuery } = useSecretsForCluster( environmentId, namespaceNames ); return ( <> queryClient.invalidateQueries(['environments', environmentId]) } />
); }