feat(system-resources-widget): add label display mode option (#4086)

This commit is contained in:
Meier Lukas authored and GitHub committed 2025-09-19 16:19:58 +02:00
1 parent 2a67d2f9da
commit 312e084e2c
8 files changed
+108 -14

No files matched your search

@@ -1,17 +1,21 @@
import { Box, Group, Paper, Stack, Text } from "@mantine/core";
import { IconNetwork } from "@tabler/icons-react";
import { humanFileSize } from "@homarr/common";
import { useScopedI18n } from "@homarr/translation/client";
import type { LabelDisplayModeOption } from "..";
import { CommonChart } from "./common-chart";
export const CombinedNetworkTrafficChart = ({
usageOverTime,
labelDisplayMode,
}: {
usageOverTime: {
up: number;
down: number;
}[];
labelDisplayMode: LabelDisplayModeOption;
}) => {
const chartData = usageOverTime.map((usage, index) => ({ index, up: usage.up, down: usage.down }));
const t = useScopedI18n("widget.systemResources.card");
@@ -25,7 +29,9 @@ export const CombinedNetworkTrafficChart = ({
{ name: "down", color: "yellow.5" },
]}
title={t("network")}
icon={IconNetwork}
yAxisProps={{ domain: [0, "dataMax"] }}
labelDisplayMode={labelDisplayMode}
tooltipProps={{
content: ({ payload }) => {
if (!payload) {