fix(dns-hole-summary): restore colors and fit compact cards (#7045)
Related to #7020 and #7018. Restore DNS summary colors, fit compact cards, and match preview text scaling.
This commit is contained in:
1 parent
d1c88b6821
commit
3f02da7b59
6 files changed
+76
-34
No files matched your search
@@ -57,4 +57,8 @@ import { technitiumDnsIntegration } from "@site/docs/integrations/technitium-dns
|
||||
|
||||
### Configuration
|
||||
|
||||
Enable **Use Pi-Hole colors** to color the four statistics red, yellow, cyan, and green with any supported DNS integration. Disable it to use the board's primary color. Both modes respect the board opacity.
|
||||
|
||||
Compact cards, including 1×1 widgets on scaled boards, show abbreviated values without icons or labels. Hover or focus a value to see its metric label; larger cards keep their icons and labels.
|
||||
|
||||
<WidgetConfig configuration={dnsHoleSummaryWidget.configuration} />
|
||||
@@ -5,8 +5,12 @@ import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
||||
import { Box } from "@mantine/core";
|
||||
import { useElementSize } from "@mantine/hooks";
|
||||
|
||||
import { calculateBoardUiScale } from "@homarr/boards/scale";
|
||||
|
||||
import classes from "./scaled-board-canvas.module.css";
|
||||
|
||||
export { calculateBoardUiScale } from "@homarr/boards/scale";
|
||||
|
||||
const BoardCanvasScaleContext = createContext(1);
|
||||
|
||||
export const useBoardCanvasScale = () => useContext(BoardCanvasScaleContext);
|
||||
@@ -18,12 +22,6 @@ export const calculateBoardCanvasScale = (availableWidth: number, logicalWidth:
|
||||
return availableWidth / logicalWidth;
|
||||
};
|
||||
|
||||
export const calculateBoardUiScale = (canvasScale: number) => {
|
||||
if (!Number.isFinite(canvasScale) || canvasScale <= 0) return 1;
|
||||
|
||||
return canvasScale < 1 ? 1 / canvasScale : 1;
|
||||
};
|
||||
|
||||
interface ScaledBoardCanvasProps {
|
||||
logicalWidth: number;
|
||||
initialLogicalHeight: number;
|
||||
|
||||
Reference in new issue
Block a user