You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
homepage/src/widgets/glances/component.jsx

50 lines
1.1 KiB

import Memory from "./metrics/memory";
import Cpu from "./metrics/cpu";
import Sensor from "./metrics/sensor";
import Net from "./metrics/net";
import Process from "./metrics/process";
import Disk from "./metrics/disk";
1 year ago
import GPU from "./metrics/gpu";
import Info from "./metrics/info";
1 year ago
import Fs from "./metrics/fs";
export default function Component({ service }) {
const { widget } = service;
if (widget.metric === "info") {
return <Info service={service} />;
}
if (widget.metric === "memory") {
return <Memory service={service} />;
}
if (widget.metric === "process") {
return <Process service={service} />;
}
1 year ago
if (widget.metric === "cpu") {
return <Cpu service={service} />;
}
if (widget.metric.match(/^network:/)) {
return <Net service={service} />;
}
if (widget.metric.match(/^sensor:/)) {
return <Sensor service={service} />;
}
if (widget.metric.match(/^disk:/)) {
return <Disk service={service} />;
}
1 year ago
if (widget.metric.match(/^gpu:/)) {
return <GPU service={service} />;
}
1 year ago
if (widget.metric.match(/^fs:/)) {
return <Fs service={service} />;
}
}