2022-08-27 00:55:13 +03:00
|
|
|
import Disk from "./disk";
|
|
|
|
import Cpu from "./cpu";
|
|
|
|
import Memory from "./memory";
|
2023-03-05 14:11:43 -08:00
|
|
|
import CpuTemp from "./cputemp";
|
2023-03-05 14:57:20 -08:00
|
|
|
import Uptime from "./uptime";
|
2022-08-24 10:44:35 +03:00
|
|
|
|
|
|
|
export default function Resources({ options }) {
|
2023-03-05 14:11:43 -08:00
|
|
|
const { expanded, units } = options;
|
2023-06-10 23:30:44 -07:00
|
|
|
return (
|
|
|
|
<div className="flex flex-col max-w:full sm:basis-auto self-center grow-0 flex-wrap">
|
2022-09-11 21:02:33 +03:00
|
|
|
<div className="flex flex-row self-center flex-wrap justify-between">
|
2022-09-12 21:13:57 +03:00
|
|
|
{options.cpu && <Cpu expanded={expanded} />}
|
|
|
|
{options.memory && <Memory expanded={expanded} />}
|
2022-09-11 14:21:16 +03:00
|
|
|
{Array.isArray(options.disk)
|
2022-09-12 21:13:57 +03:00
|
|
|
? options.disk.map((disk) => <Disk key={disk} options={{ disk }} expanded={expanded} />)
|
|
|
|
: options.disk && <Disk options={options} expanded={expanded} />}
|
2023-03-05 14:11:43 -08:00
|
|
|
{options.cputemp && <CpuTemp expanded={expanded} units={units} />}
|
2023-03-05 14:57:20 -08:00
|
|
|
{options.uptime && <Uptime />}
|
2022-08-27 00:55:13 +03:00
|
|
|
</div>
|
2022-09-07 16:53:24 +03:00
|
|
|
{options.label && (
|
2022-09-07 17:17:01 +03:00
|
|
|
<div className="ml-6 pt-1 text-center text-theme-800 dark:text-theme-200 text-xs">{options.label}</div>
|
2022-09-07 16:53:24 +03:00
|
|
|
)}
|
2023-06-10 23:30:44 -07:00
|
|
|
</div>
|
|
|
|
);
|
2022-08-24 10:44:35 +03:00
|
|
|
}
|