mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 07:18:47 +00:00
Display Docker container's used memory instead of total memory
This commit is contained in:
parent
58bb5a2bbf
commit
e549a87719
4 changed files with 9 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
import useSWR from "swr";
|
||||
import { useTranslation } from "next-i18next";
|
||||
|
||||
import calculateCPUPercent from "./stats-helpers";
|
||||
import { calculateCPUPercent, calculateUsedMemory } from "./stats-helpers";
|
||||
|
||||
import Container from "components/services/widget/container";
|
||||
import Block from "components/services/widget/block";
|
||||
|
@ -47,7 +47,7 @@ export default function Component({ service }) {
|
|||
<Container service={service}>
|
||||
<Block label="docker.cpu" value={t("common.percent", { value: calculateCPUPercent(statsData.stats) })} />
|
||||
{statsData.stats.memory_stats.usage &&
|
||||
<Block label="docker.mem" value={t("common.bytes", { value: statsData.stats.memory_stats.usage })} />
|
||||
<Block label="docker.mem" value={t("common.bytes", { value: calculateUsedMemory(statsData.stats) })} />
|
||||
}
|
||||
{network && (
|
||||
<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue