Run pre-commit hooks over existing codebase

Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
shamoon 2023-10-17 23:26:55 -07:00
parent fa50bbad9c
commit 19c25713c4
387 changed files with 4785 additions and 4109 deletions

View file

@ -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>
);
}

View file

@ -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"],
},
},
};