Update Value Report.
This commit is contained in:
@@ -57,7 +57,7 @@ class HistoryValueController {
|
||||
}
|
||||
}
|
||||
|
||||
static async getHistoryValueReportPivot(req, res) {
|
||||
static async getHistoryValueReportPivot(req, res) {
|
||||
try {
|
||||
const queryParams = req.query;
|
||||
|
||||
@@ -77,7 +77,7 @@ static async getHistoryValueReportPivot(req, res) {
|
||||
message: error.message || 'Internal server error'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static async getHistoryValueTrendingPivot(req, res) {
|
||||
try {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -98,7 +98,7 @@ class HistoryValue {
|
||||
error.message || 'Error fetching history value report pivot'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static async getHistoryValueTrendingPivot(param) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user