Files
SE-LTD/shared/trend-preferences.mjs
T
jhartworks 3203577a9d feat: enhance sidebar functionality and styling
- Updated sidebar component to support dynamic width based on collapsed state.
- Improved sidebar icon rendering and added user account management features.
- Introduced new trend chart settings component for better user interaction.
- Added utility functions for engineering units and trend chart settings.
- Implemented color assignment logic for trend series to enhance visual representation.
- Enhanced CSS styles for better responsiveness and usability across different screen sizes.
- Introduced new configuration for Vite server to allow shared directory access.
- Added .dockerignore file to optimize Docker build context.
2026-11-19 13:51:04 +01:00

25 lines
878 B
JavaScript

export const DEFAULT_TREND_PRESET = "1";
export const DEFAULT_MAX_TREND_SERIES = 10;
export const MAX_TREND_SERIES = 100;
export const TREND_PRESETS = [
{ value: "0.0034722222", label: "5 min" },
{ value: "0.0069444444", label: "10 min" },
{ value: "0.0208333333", label: "30 min" },
{ value: "0.0416666667", label: "1 h" },
{ value: "0.0833333333", label: "2 h" },
{ value: "0.25", label: "6 h" },
{ value: "0.5", label: "12 h" },
{ value: "1", label: "24 h" },
{ value: "2", label: "2 Tage" },
{ value: "3", label: "3 Tage" },
{ value: "7", label: "7 Tage" },
{ value: "14", label: "14 Tage" },
{ value: "30", label: "30 Tage" },
];
export function normalizeMaxTrendSeries(value, fallback = DEFAULT_MAX_TREND_SERIES) {
const count = Number(value);
return Number.isInteger(count) && count >= 1 && count <= MAX_TREND_SERIES ? count : fallback;
}