import { GaugeIcon } from 'lucide-react'; import { useCurrentEnvironment } from '@/react/hooks/useCurrentEnvironment'; import { stripProtocol } from '@/portainer/filters/filters'; import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { isAgentEnvironment, isEdgeEnvironment, } from '@/react/portainer/environments/utils'; import { DetailsTable } from '@@/DetailsTable'; import { Widget } from '@@/Widget'; import { useIsSwarmManager } from '../proxy/queries/useInfo'; import { GpuInfo } from './EnvironmentInfo.GpuInfo'; import { SnapshotStats } from './EnvironmentInfo.SnapshotStats'; import { DockerInfo } from './EnvironmentInfo.DockerInfo'; import { TagsInfo } from './EnvironmentInfo.TagsInfo'; import { ClusterVisualizerLink } from './ClusterVisualizerLink'; export function EnvironmentInfo() { const environmentId = useEnvironmentId(); const envQuery = useCurrentEnvironment(); const isSwarmManager = useIsSwarmManager(environmentId); if (!envQuery.data) { return null; } const environment = envQuery.data; const isAgent = isAgentEnvironment(environment.Type); const isEdgeAgent = isEdgeEnvironment(environment.Type); const isEnvUrlVisible = !isEdgeAgent; return (
{environment.Name} -
{isEnvUrlVisible && ( {stripProtocol(environment.URL)} )} {isSwarmManager && }
); }