Unifi widgets show warning with no data

This commit is contained in:
shamoon 2023-02-03 01:01:30 -08:00
parent aee8ba1e1d
commit c2983197a0
3 changed files with 20 additions and 1 deletions

View file

@ -38,6 +38,14 @@ export default function Component({ service }) {
const uptime = wan["gw_system-stats"] ? `${t("common.number", { value: wan["gw_system-stats"].uptime / 86400, maximumFractionDigits: 1 })} ${t("unifi.days")}` : null;
if (!(wan.show || lan.show || wlan.show || uptime)) {
return (
<Container service={service}>
<Block value={ t("unifi.empty_data") } />
</Container>
)
}
return (
<Container service={service}>
{uptime && <Block label="unifi.uptime" value={ uptime } />}