Fix processlist renamed memory info property
This commit is contained in:
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…
Reference in New Issue
Block a user