Change: use glances memory available instead of free (#5923)

This commit is contained in:
shamoon
2025-11-03 15:32:36 -08:00
committed by GitHub
parent 937efc9f1b
commit 1383e22acd
2 changed files with 6 additions and 6 deletions

View File

@@ -113,7 +113,7 @@ export default function Widget({ options }) {
<Resource
icon={FaMemory}
value={t("common.bytes", {
value: data.mem.free,
value: data.mem.available,
maximumFractionDigits: 1,
binary: true,
})}

View File

@@ -27,7 +27,7 @@ export default function Component({ service }) {
useEffect(() => {
if (data) {
setDataPoints((prevDataPoints) => {
const newDataPoints = [...prevDataPoints, { a: data.used, b: data.free }];
const newDataPoints = [...prevDataPoints, { a: data.used, b: data.available }];
if (newDataPoints.length > pointsLimit) {
newDataPoints.shift();
}
@@ -67,10 +67,10 @@ export default function Component({ service }) {
{data && !error && (
<Block position="bottom-3 left-3">
{data.free && chart && (
{data.available && chart && (
<div className="text-xs opacity-50">
{t("common.bytes", {
value: data.free,
value: data.available,
maximumFractionDigits: 1,
binary: true,
})}{" "}
@@ -93,10 +93,10 @@ export default function Component({ service }) {
{!chart && (
<Block position="top-3 right-3">
{data.free && (
{data.available && (
<div className="text-xs opacity-50">
{t("common.bytes", {
value: data.free,
value: data.available,
maximumFractionDigits: 1,
binary: true,
})}{" "}