Skip to content

Commit

Permalink
Fix #15 aggregate option is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
vseenivasan committed Sep 1, 2023
1 parent fe6fd3f commit 741308b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/influx.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ exports.readInflux = (indata) => {

const count = indata.id;

var aggfn = "\""+ indata.sdata+"\""
var pname = "\""+ indata.sdata+"\"" // parameter

let devid = "("
orflg = 0
Expand Down Expand Up @@ -276,7 +276,7 @@ exports.readInflux = (indata) => {
var todtstr = indata.todate.toISOString();

query = ""+indata.server+"/query?db="+indata.db+
"&q=select+mean("+aggfn+")+"+indata.math+"+from+"+
"&q=select+"+indata.aggfn+"("+pname+")+"+indata.math+"+from+"+
"\""+indata.measure+"\""+"+where+"+devid+"+and+time+>=+'"+fmdtstr+
"'+and+time+<=+'"+todtstr+"'+group+by+time("+indata.gbt+"m)"

Expand Down
1 change: 1 addition & 0 deletions app/controllers/sread.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ async function fetchFromInflux(req, res, fmdate, todate)

influxset.sdata = req.query.sdata
influxset.device = req.query.device
influxset.aggfn = req.query.aggfn
influxset.gbt = req.query.gbt


Expand Down
2 changes: 1 addition & 1 deletion app/misc/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

module.exports = Object.freeze({
APP_NAME: 'Excel Plugin API',
APP_VERSION: '1.1.2',
APP_VERSION: '1.1.3',
APP_PORT: 8892,

KEY_SECRET: 'mcciradweindiauspvp',
Expand Down

0 comments on commit 741308b

Please sign in to comment.