diff --git a/app/react/sidebar/EdgeComputeSidebar.tsx b/app/react/sidebar/EdgeComputeSidebar.tsx index e7614898b..d9924986f 100644 --- a/app/react/sidebar/EdgeComputeSidebar.tsx +++ b/app/react/sidebar/EdgeComputeSidebar.tsx @@ -1,11 +1,21 @@ -import { Box, Clock, LayoutGrid, Layers } from 'lucide-react'; +import { Box, Clock, LayoutGrid, Layers, Puzzle } from 'lucide-react'; import { isBE } from '../portainer/feature-flags/feature-flags.service'; +import { useSettings } from '../portainer/settings/queries'; import { SidebarItem } from './SidebarItem'; import { SidebarSection } from './SidebarSection'; export function EdgeComputeSidebar() { + // this sidebar is rendered only for admins, so we can safely assume that settingsQuery will succeed + const settingsQuery = useSettings(); + + if (!settingsQuery.data || !settingsQuery.data.EnableEdgeComputeFeatures) { + return null; + } + + const settings = settingsQuery.data; + return ( {isBE && ( + + )} + {isBE && !settings.TrustOnFirstConnect && ( - {isAdmin && EnableEdgeComputeFeatures && } + {isAdmin && }