1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00
portainer/app/react/sidebar/KubernetesSidebar/KubernetesSidebar.tsx
Chaim Lev-Ari 84611a90a1
refactor(sidebar): migrate sidebar to react [EE-2907] (#6725)
* refactor(sidebar): migrate sidebar to react [EE-2907]

fixes [EE-2907]

feat(sidebar): show label for help

fix(sidebar): apply changes from ddExtension

fix(sidebar): resolve conflicts

style(ts): add explanation for ddExtension

fix(sidebar): use enum for status

refactor(sidebar): rename to EdgeComputeSidebar

refactor(sidebar): removed the need of `ident` prop

style(sidebar): add ref for mobile breakpoint

refactor(app): document testing props

refactor(sidebar): use single sidebar item

refactor(sidebar): use section for nav

refactor(sidebar): rename sidebarlink to link

refactor(sidebar): memoize menu paths

fix(kubectl-shell): infinite loop on hooks dependencies

refactor(sidebar): use authorized element

feat(k8s/shell): track open shell

refactor(k8s/shell): remove memoization

refactor(settings): move settings queries to queries

fix(sidebar): close sidebar on mobile

refactor(settings): use mutation helpers

refactor(sidebar): remove memo

refactor(sidebar): rename sidebar item for storybook

refactor(sidebar): move to react

gprefactor(sidebar): remove dependence on EndProvider

feat(environments): rename settings type

feat(kube): move kubeconfig button

fix(sidebar): open submenus

fix(sidebar): open on expand

fix(sibebar): show kube shell correctly

* fix(sidebar): import from react component

* chore(tests): fix missing prop
2022-06-23 10:25:56 +03:00

98 lines
2.6 KiB
TypeScript

import { EnvironmentId } from '@/portainer/environments/types';
import { Authorized } from '@/portainer/hooks/useUser';
import { SidebarItem } from '../SidebarItem';
import { KubectlShellButton } from './KubectlShell';
interface Props {
environmentId: EnvironmentId;
}
export function KubernetesSidebar({ environmentId }: Props) {
return (
<>
<KubectlShellButton environmentId={environmentId} />
<SidebarItem
to="kubernetes.dashboard"
params={{ endpointId: environmentId }}
iconClass="fa-tachometer-alt fa-fw"
label="Dashboard"
/>
<SidebarItem
to="kubernetes.templates.custom"
params={{ endpointId: environmentId }}
iconClass="fa-rocket fa-fw"
label="Custom Templates"
/>
<SidebarItem
to="kubernetes.resourcePools"
params={{ endpointId: environmentId }}
iconClass="fa-layer-group fa-fw"
label="Namespaces"
/>
<Authorized authorizations="HelmInstallChart">
<SidebarItem
to="kubernetes.templates.helm"
params={{ endpointId: environmentId }}
iconClass="fa-dharmachakra fa-fw"
label="Helm"
/>
</Authorized>
<SidebarItem
to="kubernetes.applications"
params={{ endpointId: environmentId }}
iconClass="fa-laptop-code fa-fw"
label="Applications"
/>
<SidebarItem
to="kubernetes.configurations"
params={{ endpointId: environmentId }}
iconClass="fa-file-code fa-fw"
label="ConfigMaps & Secrets"
/>
<SidebarItem
to="kubernetes.volumes"
params={{ endpointId: environmentId }}
iconClass="fa-database fa-fw"
label="Volumes"
/>
<SidebarItem
iconClass="fa-server fa-fw"
label="Cluster"
to="kubernetes.cluster"
params={{ endpointId: environmentId }}
>
<Authorized authorizations="K8sClusterSetupRW" adminOnlyCE>
<SidebarItem
to="portainer.k8sendpoint.kubernetesConfig"
params={{ id: environmentId }}
label="Setup"
/>
</Authorized>
<Authorized authorizations="K8sClusterSetupRW" adminOnlyCE>
<SidebarItem
to="portainer.k8sendpoint.securityConstraint"
params={{ id: environmentId }}
label="Security constraints"
/>
</Authorized>
<SidebarItem
to="kubernetes.registries"
params={{ endpointId: environmentId }}
label="Registries"
/>
</SidebarItem>
</>
);
}