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 <Resource
icon={FaMemory} icon={FaMemory}
value={t("common.bytes", { value={t("common.bytes", {
value: data.mem.free, value: data.mem.available,
maximumFractionDigits: 1, maximumFractionDigits: 1,
binary: true, binary: true,
})} })}

View File

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