mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-12 16:08:48 +00:00
Enhancement: improve fritzbox proxy perfomance (#2429)
--------- Co-authored-by: Thorben Grove <thorben.grove@tui.de> Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
77ed445da1
commit
0f3fc77ddf
4 changed files with 32 additions and 18 deletions
|
@ -4,6 +4,8 @@ import Container from "components/services/widget/container";
|
|||
import Block from "components/services/widget/block";
|
||||
import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||
|
||||
export const fritzboxDefaultFields = ["connectionStatus", "uptime", "maxDown", "maxUp"];
|
||||
|
||||
const formatUptime = (timestamp) => {
|
||||
const hours = Math.floor(timestamp / 3600);
|
||||
const minutes = Math.floor((timestamp % 3600) / 60);
|
||||
|
@ -27,7 +29,7 @@ export default function Component({ service }) {
|
|||
|
||||
// Default fields
|
||||
if (!widget.fields?.length > 0) {
|
||||
widget.fields = ["connectionStatus", "uptime", "maxDown", "maxUp"];
|
||||
widget.fields = fritzboxDefaultFields;
|
||||
}
|
||||
const MAX_ALLOWED_FIELDS = 4;
|
||||
// Limits max number of displayed fields
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue