From 69a824c25b005c83881a19a900ec605398ce3542 Mon Sep 17 00:00:00 2001 From: Rex Wang <109048808+RexWangPT@users.noreply.github.com> Date: Fri, 5 Aug 2022 10:17:31 +0800 Subject: [PATCH] Fix(UI) Update UI of docker dashboard EE-3845 (#7422) * EE-3846 fix alignment of left-hand side of fields --- .../dashboardClusterAgentInfo.html | 4 +- app/docker/views/dashboard/dashboard.html | 21 ++++----- .../docker/DashboardView/ContainerStatus.tsx | 44 ++++++++++++++----- .../docker/DashboardView/ImagesTotalSize.tsx | 7 ++- 4 files changed, 50 insertions(+), 26 deletions(-) diff --git a/app/docker/components/dashboard-cluster-agent-info/dashboardClusterAgentInfo.html b/app/docker/components/dashboard-cluster-agent-info/dashboardClusterAgentInfo.html index 734f8e487..3acc6e83c 100644 --- a/app/docker/components/dashboard-cluster-agent-info/dashboardClusterAgentInfo.html +++ b/app/docker/components/dashboard-cluster-agent-info/dashboardClusterAgentInfo.html @@ -1,6 +1,6 @@ - - + + diff --git a/app/docker/views/dashboard/dashboard.html b/app/docker/views/dashboard/dashboard.html index e925c0328..f9d9c6f0a 100644 --- a/app/docker/views/dashboard/dashboard.html +++ b/app/docker/views/dashboard/dashboard.html @@ -32,8 +32,8 @@
- - + +
@@ -41,7 +41,8 @@
{{ endpoint.Name }} - {{ endpoint.Snapshots[0].TotalCPU }} {{ endpoint.Snapshots[0].TotalMemory | humansize }} + {{ endpoint.Snapshots[0].TotalCPU }} + {{ endpoint.Snapshots[0].TotalMemory | humansize }} - {{ info.Swarm && info.Swarm.NodeID !== '' ? 'Swarm' : 'Standalone' }} {{ info.ServerVersion }} @@ -77,33 +78,33 @@ diff --git a/app/react/docker/DashboardView/ContainerStatus.tsx b/app/react/docker/DashboardView/ContainerStatus.tsx index 52209c276..d16387fbe 100644 --- a/app/react/docker/DashboardView/ContainerStatus.tsx +++ b/app/react/docker/DashboardView/ContainerStatus.tsx @@ -1,3 +1,7 @@ +import clsx from 'clsx'; + +import { Icon } from '@/react/components/Icon'; + import { DockerContainer } from '../containers/types'; interface Props { @@ -10,28 +14,44 @@ export function useContainerStatusComponent(containers: DockerContainer[]) { export function ContainerStatus({ containers }: Props) { return ( - <> -
-
- +
+
+
+ {runningContainersFilter(containers)} running
-
- +
+ {stoppedContainersFilter(containers)} stopped
-
-
- +
+
+ {healthyContainersFilter(containers)} healthy
-
- +
+ {unhealthyContainersFilter(containers)} unhealthy
- +
); } diff --git a/app/react/docker/DashboardView/ImagesTotalSize.tsx b/app/react/docker/DashboardView/ImagesTotalSize.tsx index 6746b88d0..8b86f0c71 100644 --- a/app/react/docker/DashboardView/ImagesTotalSize.tsx +++ b/app/react/docker/DashboardView/ImagesTotalSize.tsx @@ -1,3 +1,6 @@ +import clsx from 'clsx'; + +import { Icon } from '@/react/components/Icon'; import { humanize } from '@/portainer/filters/filters'; interface Props { @@ -10,8 +13,8 @@ export function useImagesTotalSizeComponent(imagesTotalSize: number) { export function ImagesTotalSize({ imagesTotalSize }: Props) { return ( -
- +
+ {humanize(imagesTotalSize)}
);