From 469a08da49188bcbdda123070a3530848538a4df Mon Sep 17 00:00:00 2001 From: Kai Gillmann Date: Wed, 14 Dec 2016 20:24:51 +0100 Subject: [PATCH] Fix: Only first transformer used sometimes Reason is, that an internal dictionary uses only the rrd path to distinguish between entries. I appended the ds to the string. Example would be using the load rrd file which has 'shortterm', 'midterm' and 'longterm' --- jarmon/jarmon.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js index e30a228..016856d 100644 --- a/jarmon/jarmon.js +++ b/jarmon/jarmon.js @@ -722,11 +722,13 @@ jarmon.Chart.prototype.setup = function() { var unit = recipe.data[j][3]; var transformer = recipe.data[j][4]; - if(typeof(dataDict[rrd]) === 'undefined') { - dataDict[rrd] = new jarmon.RrdQueryRemote( + var key = rrd + "_" + ds; + + if(typeof(dataDict[key]) === 'undefined') { + dataDict[key] = new jarmon.RrdQueryRemote( rrd, unit, this.downloader, transformer); } - this.addData(label, new jarmon.RrdQueryDsProxy(dataDict[rrd], ds)); + this.addData(label, new jarmon.RrdQueryDsProxy(dataDict[key], ds)); } };