mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 23:38:46 +00:00
Allow specifying wan interface on opnsense widget
This commit is contained in:
parent
cdbdb86c9e
commit
ca4b5b131d
2 changed files with 8 additions and 6 deletions
|
@ -33,16 +33,14 @@ export default function Component({ service }) {
|
|||
const cpu = 100 - parseFloat(cpuIdle);
|
||||
const memory = activityData.headers[3].match(/Mem: (.+) Active,/)[1];
|
||||
|
||||
const wanUpload = interfaceData.interfaces.wan['bytes transmitted'];
|
||||
const wanDownload = interfaceData.interfaces.wan['bytes received'];
|
||||
const wan = widget.wan ? interfaceData.interfaces[widget.wan] : interfaceData.interfaces.wan;
|
||||
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block label="opnsense.cpu" value={t("common.percent", { value: cpu.toFixed(2) })} />
|
||||
<Block label="opnsense.memory" value={memory} />
|
||||
<Block label="opnsense.wanUpload" value={t("common.bytes", { value: wanUpload })} />
|
||||
<Block label="opnsense.wanDownload" value={t("common.bytes", { value: wanDownload })} />
|
||||
|
||||
{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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue