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.
This commit is contained in:
jhartworks committed 2026-11-19 13:51:04 +01:00
1 parent 2f5f86452f
commit 3203577a9d
28 files changed
+1508 -758

No files matched your search

+4 -3
View File
@@ -1,7 +1,8 @@
FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
WORKDIR /app/runner
COPY runner/package*.json ./
RUN npm install
COPY src ./src
COPY runner/src ./src
COPY shared /app/shared
RUN mkdir -p /exports
CMD ["npm", "start"]
+9 -3
View File
@@ -5,6 +5,8 @@ import https from "node:https";
import path from "node:path";
import Redis from "ioredis";
import mysql from "mysql2/promise";
import { LEGACY_DATUM_UTC, LEGACY_TREND_TIME_ZONE, setUtcSession } from "../../shared/trend-time.mjs";
import { normalizeUnitSymbol } from "../../shared/engineering-units.mjs";
const redis = new Redis(process.env.REDIS_URL || "redis://redis:6379", { maxRetriesPerRequest: 2 });
const db = mysql.createPool({
@@ -14,9 +16,11 @@ const db = mysql.createPool({
user: process.env.DB_USER || "root",
password: process.env.DB_PASSWORD || "SE3112",
charset: "utf8mb4",
timezone: "Z",
waitForConnections: true,
connectionLimit: 3,
});
db.on("connection", setUtcSession);
const exportDir = process.env.EXPORT_DIR || "/exports";
const tickMs = Math.max(500, Number(process.env.RUNNER_TICK_MS || 1000));
const timeZone = process.env.RUNNER_TIMEZONE || "Europe/Berlin";
@@ -87,7 +91,7 @@ async function getPointMeta(isp, pointIndex) {
const point = Array.isArray(points)
? points.find((item) => Number(item.pointIndex) === Number(pointIndex))
: points[String(pointIndex)] || points[Number(pointIndex)];
return { alias: point?.alias || `Wert${pointIndex}`, unit: point?.unit || "" };
return { alias: point?.alias || `Wert${pointIndex}`, unit: normalizeUnitSymbol(point?.unit) };
}
async function exportSelection(job, selection) {
@@ -113,8 +117,10 @@ async function exportSelection(job, selection) {
} else {
const column = `Wert${pointIndex}`;
const [data] = await db.query(
`SELECT datum, \`${column}\` AS value FROM \`${table}\` WHERE datum >= ? ORDER BY datum ASC`,
[since],
`SELECT ${LEGACY_DATUM_UTC} AS datum, \`${column}\` AS value FROM \`${table}\`
WHERE datum >= DATE_SUB(?, INTERVAL 1 DAY) AND ${LEGACY_DATUM_UTC} >= ?
ORDER BY \`${table}\`.datum ASC`,
[LEGACY_TREND_TIME_ZONE, since, LEGACY_TREND_TIME_ZONE, since],
);
for (const item of data) {
const value = formatExportValue(item.value);