mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-17 18:29:48 +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
|
@ -14,7 +14,7 @@ export default function Component({ service }) {
|
|||
|
||||
if (activityError || interfaceError) {
|
||||
const finalError = activityError ?? interfaceError;
|
||||
return <Container service={service} error={ finalError } />;
|
||||
return <Container service={service} error={finalError} />;
|
||||
}
|
||||
|
||||
if (!activityData || !interfaceData) {
|
||||
|
@ -28,7 +28,6 @@ export default function Component({ service }) {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
const cpuIdle = activityData.headers[2].match(/ ([0-9.]+)% idle/)[1];
|
||||
const cpu = 100 - parseFloat(cpuIdle);
|
||||
const memory = activityData.headers[3].match(/Mem: (.+) Active,/)[1];
|
||||
|
@ -37,10 +36,10 @@ export default function Component({ service }) {
|
|||
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block label="opnsense.cpu" value={t("common.percent", { value: cpu.toFixed(2) })} />
|
||||
<Block label="opnsense.cpu" value={t("common.percent", { value: cpu.toFixed(2) })} />
|
||||
<Block label="opnsense.memory" value={memory} />
|
||||
{wan && <Block label="opnsense.wanUpload" value={t("common.bytes", { value: wan['bytes transmitted'] })} />}
|
||||
{wan && <Block label="opnsense.wanDownload" value={t("common.bytes", { value: wan['bytes received'] })} />}
|
||||
{wan && <Block label="opnsense.wanUpload" value={t("common.bytes", { value: wan["bytes transmitted"] })} />}
|
||||
{wan && <Block label="opnsense.wanDownload" value={t("common.bytes", { value: wan["bytes received"] })} />}
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
|
||||
const widget = {
|
||||
|
@ -8,16 +7,12 @@ const widget = {
|
|||
mappings: {
|
||||
activity: {
|
||||
endpoint: "diagnostics/activity/getActivity",
|
||||
validate: [
|
||||
"headers"
|
||||
]
|
||||
validate: ["headers"],
|
||||
},
|
||||
interface: {
|
||||
endpoint: "diagnostics/traffic/interface",
|
||||
validate: [
|
||||
"interfaces"
|
||||
]
|
||||
}
|
||||
validate: ["interfaces"],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue