fix(worker): default to disk 0 if /host/root not found

In order to avoid displaying 0 disk space on some systems, we default to the first disk found
This commit is contained in:
Nicolas Meienberger 2023-11-28 08:18:48 +01:00
parent 0f129a7809
commit bffa31c0b7

View file

@ -37,7 +37,7 @@ export class SystemExecutors {
}
const disks = await si.fsSize();
const disk0 = disks.find((disk) => disk.mount.startsWith('/host/root'));
const disk0 = disks.find((disk) => disk.mount.startsWith('/host/root')) || disks[0];
return {
cpu: { load: currentLoad },