mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-11 23:58:46 +00:00
Merge pull request #931 from benphelps/unifi-improvements
Unifi improvements
This commit is contained in:
commit
f50f5c130e
4 changed files with 26 additions and 4 deletions
|
@ -15,7 +15,7 @@ export default function Component({ service }) {
|
|||
return <Container error={statsError} />;
|
||||
}
|
||||
|
||||
const defaultSite = statsData?.data?.find(s => s.name === "default");
|
||||
const defaultSite = widget.site ? statsData?.data.find(s => s.desc === widget.site) : statsData?.data?.find(s => s.name === "default");
|
||||
|
||||
if (!defaultSite) {
|
||||
return (
|
||||
|
@ -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 } />}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue