Fix processlist renamed memory info property

pull/3196/head
shamoon 2 months ago
parent b91a674dd4
commit 79cde96a7a

@ -24,6 +24,8 @@ export default function Component({ service }) {
const { widget } = service;
const { chart, refreshInterval = defaultInterval, version = 3 } = widget;
const memoryInfoKey = version === 3 ? 0 : "data";
const { data, error } = useWidgetAPI(service.widget, "processlist", {
refreshInterval: Math.max(defaultInterval, refreshInterval),
version,
@ -67,7 +69,7 @@ export default function Component({ service }) {
<div className="opacity-25 w-14 text-right">{item.cpu_percent.toFixed(1)}%</div>
<div className="opacity-25 w-14 text-right">
{t("common.bytes", {
value: item.memory_info[0],
value: item.memory_info[memoryInfoKey],
maximumFractionDigits: 0,
})}
</div>

Loading…
Cancel
Save