From bb5721c47348f2bc7829652228c0c46ad5d4b4a5 Mon Sep 17 00:00:00 2001 From: Ben Phelps Date: Wed, 28 Sep 2022 02:32:39 +0300 Subject: [PATCH] ui polish --- src/components/services/widget/block.jsx | 9 ++++++++- src/components/widgets/resources/cpu.jsx | 16 +++++++++++++--- src/components/widgets/resources/disk.jsx | 16 +++++++++++++--- src/components/widgets/resources/memory.jsx | 16 +++++++++++++--- src/components/widgets/resources/usage-bar.jsx | 2 +- 5 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/components/services/widget/block.jsx b/src/components/services/widget/block.jsx index e0c1858a7..295330d65 100644 --- a/src/components/services/widget/block.jsx +++ b/src/components/services/widget/block.jsx @@ -1,6 +1,13 @@ +import classNames from "classnames"; + export default function Block({ value, label }) { return ( -
+
{value === undefined || value === null ? "-" : value}
{label}
diff --git a/src/components/widgets/resources/cpu.jsx b/src/components/widgets/resources/cpu.jsx index 7bb443215..741ffefd7 100644 --- a/src/components/widgets/resources/cpu.jsx +++ b/src/components/widgets/resources/cpu.jsx @@ -25,10 +25,20 @@ export default function Cpu({ expanded }) { if (!data) { return ( -
+
-
- - +
+
+
-
+
{t("docker.cpu")}
+
+ {expanded && ( +
+
-
+
{t("resources.load")}
+
+ )} +
); diff --git a/src/components/widgets/resources/disk.jsx b/src/components/widgets/resources/disk.jsx index 3d57bb19f..69f560f62 100644 --- a/src/components/widgets/resources/disk.jsx +++ b/src/components/widgets/resources/disk.jsx @@ -25,10 +25,20 @@ export default function Disk({ options, expanded }) { if (!data) { return ( -
+
-
- - +
+ +
-
+
{t("resources.free")}
+
+ {expanded && ( + +
-
+
{t("resources.total")}
+
+ )} +
); diff --git a/src/components/widgets/resources/memory.jsx b/src/components/widgets/resources/memory.jsx index 4eb007e47..452634565 100644 --- a/src/components/widgets/resources/memory.jsx +++ b/src/components/widgets/resources/memory.jsx @@ -25,10 +25,20 @@ export default function Memory({ expanded }) { if (!data) { return ( -
+
-
- - +
+ +
-
+
{t("resources.free")}
+
+ {expanded && ( + +
-
+
{t("resources.total")}
+
+ )} +
); diff --git a/src/components/widgets/resources/usage-bar.jsx b/src/components/widgets/resources/usage-bar.jsx index 27c7f5cc5..c817db4c4 100644 --- a/src/components/widgets/resources/usage-bar.jsx +++ b/src/components/widgets/resources/usage-bar.jsx @@ -2,7 +2,7 @@ export default function UsageBar({ percent }) { return (