mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 06:48:47 +00:00
Run pre-commit hooks over existing codebase
Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
parent
fa50bbad9c
commit
19c25713c4
387 changed files with 4785 additions and 4109 deletions
|
@ -13,31 +13,35 @@ export default function Disk({ options, expanded, refresh = 1500 }) {
|
|||
});
|
||||
|
||||
if (error || data?.error) {
|
||||
return <Error options={options} />
|
||||
return <Error options={options} />;
|
||||
}
|
||||
|
||||
if (!data || !data.drive) {
|
||||
return <Resource
|
||||
icon={FiHardDrive}
|
||||
value="-"
|
||||
label={t("resources.free")}
|
||||
expandedValue="-"
|
||||
expandedLabel={t("resources.total")}
|
||||
expanded={expanded}
|
||||
percentage="0"
|
||||
/>;
|
||||
return (
|
||||
<Resource
|
||||
icon={FiHardDrive}
|
||||
value="-"
|
||||
label={t("resources.free")}
|
||||
expandedValue="-"
|
||||
expandedLabel={t("resources.total")}
|
||||
expanded={expanded}
|
||||
percentage="0"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// data.drive.used not accurate?
|
||||
const percent = Math.round(((data.drive.size - data.drive.available) / data.drive.size) * 100);
|
||||
|
||||
return <Resource
|
||||
icon={FiHardDrive}
|
||||
value={t("common.bytes", { value: data.drive.available })}
|
||||
label={t("resources.free")}
|
||||
expandedValue={t("common.bytes", { value: data.drive.size })}
|
||||
expandedLabel={t("resources.total")}
|
||||
percentage={percent}
|
||||
expanded={expanded}
|
||||
/>;
|
||||
return (
|
||||
<Resource
|
||||
icon={FiHardDrive}
|
||||
value={t("common.bytes", { value: data.drive.available })}
|
||||
label={t("resources.free")}
|
||||
expandedValue={t("common.bytes", { value: data.drive.size })}
|
||||
expandedLabel={t("resources.total")}
|
||||
percentage={percent}
|
||||
expanded={expanded}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue