mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-05 21:47:48 +01:00
Change: use glances memory available instead of free (#5923)
This commit is contained in:
@@ -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,
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -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,
|
||||||
})}{" "}
|
})}{" "}
|
||||||
|
|||||||
Reference in New Issue
Block a user