diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..5a9e97f16 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.exclude": { + "**/.next": true, + "**/node_modules": true + } +} \ No newline at end of file diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 669ebd276..b1097904d 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -36,8 +36,8 @@ "uptime": "System Uptime", "days": "Days", "wan": "WAN", - "lan": "LAN", - "wlan": "WLAN", + "lan_users": "LAN Users", + "wlan_users": "WLAN Users", "up": "UP", "down": "DOWN", "wait": "Please wait" diff --git a/src/utils/proxy/cached-fetch.js b/src/utils/proxy/cached-fetch.js index 22eba37f2..0ed39562f 100644 --- a/src/utils/proxy/cached-fetch.js +++ b/src/utils/proxy/cached-fetch.js @@ -1,8 +1,13 @@ import cache from "memory-cache"; +const defaultDuration = 5; + export default async function cachedFetch(url, duration) { const cached = cache.get(url); + // eslint-disable-next-line no-param-reassign + duration = duration || defaultDuration; + if (cached) { return cached; } diff --git a/src/widgets/unifi/component.jsx b/src/widgets/unifi/component.jsx index 8a654a516..e2db8e77f 100644 --- a/src/widgets/unifi/component.jsx +++ b/src/widgets/unifi/component.jsx @@ -15,9 +15,6 @@ export default function Component({ service }) { return ; } - const wlanLabel = `${t("unifi.wlan")} ${t("unifi.users")}` - const lanLabel = `${t("unifi.lan")} ${t("unifi.users")}` - const defaultSite = statsData?.data?.find(s => s.name === "default"); if (!defaultSite) { @@ -25,8 +22,8 @@ export default function Component({ service }) { - - + + ); } @@ -45,7 +42,7 @@ export default function Component({ service }) { lan: { users: lan.num_user, status: lan.status - } + }, }; const uptime = `${t("common.number", { value: data.uptime / 86400, maximumFractionDigits: 1 })} ${t("unifi.days")}`; @@ -54,8 +51,8 @@ export default function Component({ service }) { - - + + ); }