1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 05:45:22 +02:00

refactor(nomad): sync frontend with EE [EE-3353] (#7758)

This commit is contained in:
Chaim Lev-Ari 2022-11-13 12:29:25 +02:00 committed by GitHub
parent 78dcba614d
commit 881e99df53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 1799 additions and 17 deletions

View file

@ -13,6 +13,7 @@ import { getPlatformType } from '@/react/portainer/environments/utils';
import { useEnvironment } from '@/react/portainer/environments/queries/useEnvironment';
import { useLocalStorage } from '@/react/hooks/useLocalStorage';
import { EndpointProviderInterface } from '@/portainer/services/endpointProvider';
import { isBE } from '@/react/portainer/feature-flags/feature-flags.service';
import { getPlatformIcon } from '../portainer/environments/utils/get-platform-icon';
@ -22,6 +23,7 @@ import { DockerSidebar } from './DockerSidebar';
import { KubernetesSidebar } from './KubernetesSidebar';
import { SidebarSection, SidebarSectionTitle } from './SidebarSection';
import { useSidebarState } from './useSidebarState';
import { NomadSidebar } from './NomadSidebar';
export function EnvironmentSidebar() {
const { query: currentEnvironmentQuery, clearEnvironment } =
@ -67,7 +69,9 @@ function Content({ environment, onClear }: ContentProps) {
showTitleWhenOpen
>
<div className="mt-2">
<Sidebar environmentId={environment.Id} environment={environment} />
{Sidebar && (
<Sidebar environmentId={environment.Id} environment={environment} />
)}
</div>
</SidebarSection>
);
@ -77,11 +81,12 @@ function Content({ environment, onClear }: ContentProps) {
[key in PlatformType]: React.ComponentType<{
environmentId: EnvironmentId;
environment: Environment;
}>;
}> | null;
} = {
[PlatformType.Azure]: AzureSidebar,
[PlatformType.Docker]: DockerSidebar,
[PlatformType.Kubernetes]: KubernetesSidebar,
[PlatformType.Nomad]: isBE ? NomadSidebar : null,
};
return sidebar[platform];