Handle nextdns no devices setup, data pending
This commit is contained in:
parent
fb2492e577
commit
f7d5582f57
2 changed files with 14 additions and 2 deletions
|
@ -372,5 +372,9 @@
|
|||
"paperlessngx": {
|
||||
"inbox": "Inbox",
|
||||
"total": "Total"
|
||||
},
|
||||
"nextdns": {
|
||||
"wait": "Please Wait",
|
||||
"no_devices": "No Device Data Received"
|
||||
}
|
||||
}
|
|
@ -18,14 +18,22 @@ export default function Component({ service }) {
|
|||
if (!nextdnsData) {
|
||||
return (
|
||||
<Container service={service}>
|
||||
No data
|
||||
<Block key="status" label="widget.status" value={t("nextdns.wait")} />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
if (!nextdnsData?.data?.length) {
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block key="status" label="widget.status" value={t("nextdns.no_devices")} />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Container service={service}>
|
||||
{nextdnsData?.data?.map(d => <Block key={d.status} label={d.status} value={t("common.number", { value: d.queries })} />)}
|
||||
{nextdnsData.data.map(d => <Block key={d.status} label={d.status} value={t("common.number", { value: d.queries })} />)}
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue