mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(sidebar): implement new design [EE-3447] (#7118)
This commit is contained in:
parent
e5e57978af
commit
ed8f9b5931
54 changed files with 1928 additions and 857 deletions
|
@ -1,3 +1,16 @@
|
|||
import {
|
||||
Box,
|
||||
Clock,
|
||||
Layers,
|
||||
List,
|
||||
Lock,
|
||||
Share2,
|
||||
Shuffle,
|
||||
Trello,
|
||||
Clipboard,
|
||||
Edit,
|
||||
} from 'react-feather';
|
||||
|
||||
import {
|
||||
type Environment,
|
||||
type EnvironmentId,
|
||||
|
@ -11,6 +24,8 @@ import {
|
|||
import { useInfo, useVersion } from '@/docker/services/system.service';
|
||||
|
||||
import { SidebarItem } from './SidebarItem';
|
||||
import { DashboardLink } from './items/DashboardLink';
|
||||
import { VolumesLink } from './items/VolumesLink';
|
||||
|
||||
interface Props {
|
||||
environmentId: EnvironmentId;
|
||||
|
@ -41,44 +56,37 @@ export function DockerSidebar({ environmentId, environment }: Props) {
|
|||
const setupSubMenuProps = isSwarmManager
|
||||
? {
|
||||
label: 'Swarm',
|
||||
iconClass: 'fa-object-group fa-fw',
|
||||
icon: Trello,
|
||||
to: 'docker.swarm',
|
||||
}
|
||||
: {
|
||||
label: 'Host',
|
||||
iconClass: 'fa-th fa-fw',
|
||||
icon: Trello,
|
||||
to: 'docker.host',
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<SidebarItem
|
||||
to="docker.dashboard"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-tachometer-alt fa-fw"
|
||||
label="Dashboard"
|
||||
/>
|
||||
<DashboardLink environmentId={environmentId} platformPath="docker" />
|
||||
|
||||
{!offlineMode && (
|
||||
<SidebarItem
|
||||
label="App Templates"
|
||||
icon={Edit}
|
||||
to="docker.templates"
|
||||
params={{ endpointId: environmentId }}
|
||||
>
|
||||
<SidebarItem
|
||||
label="App Templates"
|
||||
iconClass="fa-rocket fa-fw"
|
||||
to="docker.templates"
|
||||
label="Custom Templates"
|
||||
to="docker.templates.custom"
|
||||
params={{ endpointId: environmentId }}
|
||||
>
|
||||
<SidebarItem
|
||||
label="Custom Templates"
|
||||
to="docker.templates.custom"
|
||||
params={{ endpointId: environmentId }}
|
||||
/>
|
||||
</SidebarItem>
|
||||
)}
|
||||
/>
|
||||
</SidebarItem>
|
||||
|
||||
{areStacksVisible && (
|
||||
<SidebarItem
|
||||
to="docker.stacks"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-th-list fa-fw"
|
||||
icon={Layers}
|
||||
label="Stacks"
|
||||
/>
|
||||
)}
|
||||
|
@ -87,7 +95,7 @@ export function DockerSidebar({ environmentId, environment }: Props) {
|
|||
<SidebarItem
|
||||
to="docker.services"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-list-alt fa-fw"
|
||||
icon={Shuffle}
|
||||
label="Services"
|
||||
/>
|
||||
)}
|
||||
|
@ -95,36 +103,31 @@ export function DockerSidebar({ environmentId, environment }: Props) {
|
|||
<SidebarItem
|
||||
to="docker.containers"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-cubes fa-fw"
|
||||
icon={Box}
|
||||
label="Containers"
|
||||
/>
|
||||
|
||||
<SidebarItem
|
||||
to="docker.images"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-clone fa-fw"
|
||||
icon={List}
|
||||
label="Images"
|
||||
/>
|
||||
|
||||
<SidebarItem
|
||||
to="docker.networks"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-sitemap fa-fw"
|
||||
icon={Share2}
|
||||
label="Networks"
|
||||
/>
|
||||
|
||||
<SidebarItem
|
||||
to="docker.volumes"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-hdd fa-fw"
|
||||
label="Volumes"
|
||||
/>
|
||||
<VolumesLink environmentId={environmentId} platformPath="docker" />
|
||||
|
||||
{apiVersion >= 1.3 && isSwarmManager && (
|
||||
<SidebarItem
|
||||
to="docker.configs"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-file-code fa-fw"
|
||||
icon={Clipboard}
|
||||
label="Configs"
|
||||
/>
|
||||
)}
|
||||
|
@ -133,7 +136,7 @@ export function DockerSidebar({ environmentId, environment }: Props) {
|
|||
<SidebarItem
|
||||
to="docker.secrets"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-user-secret fa-fw"
|
||||
icon={Lock}
|
||||
label="Secrets"
|
||||
/>
|
||||
)}
|
||||
|
@ -142,14 +145,14 @@ export function DockerSidebar({ environmentId, environment }: Props) {
|
|||
<SidebarItem
|
||||
to="docker.events"
|
||||
params={{ endpointId: environmentId }}
|
||||
iconClass="fa-history fa-fw"
|
||||
icon={Clock}
|
||||
label="Events"
|
||||
/>
|
||||
)}
|
||||
|
||||
<SidebarItem
|
||||
label={setupSubMenuProps.label}
|
||||
iconClass={setupSubMenuProps.iconClass}
|
||||
icon={setupSubMenuProps.icon}
|
||||
to={setupSubMenuProps.to}
|
||||
params={{ endpointId: environmentId }}
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue