mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Run pre-commit hooks over existing codebase
Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
@@ -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"],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user