Update Value Report.

This commit is contained in:
Athif
2025-12-18 13:37:47 +07:00
parent c112ff165a
commit 1496b80fdf
3 changed files with 52 additions and 55 deletions

View File

@@ -385,10 +385,7 @@ const getHistoryValueReportPivotDb = async (tableName, searchParams = {}) => {
OPTION (MAXRECURSION 0);
`;
const request = pool.request();
request.timeout = 60000; // 60 detik
const result = await request.query(queryText, [from, to, interval]);
const result = await pool.query(queryText, [from, to, interval]);
if (result.recordsets && result.recordsets.length >= 2) {
console.log('Sample averaging data:');
@@ -551,7 +548,7 @@ const getHistoryValueTrendingPivotDb = async (tableName, searchParams = {}) => {
const tagList = Object.keys(rows[0]).filter(k => k !== timeKey);
const nivoData = tagList.map(tag => ({
name: tag,
id: tag,
data: rows.map(row => ({
x: row[timeKey],
y: row[tag] !== null ? Number(row[tag]) : null