From e4304ae8d930d809edafd39decd2c4b9cfbdc311 Mon Sep 17 00:00:00 2001 From: Will Piers Date: Tue, 8 Nov 2016 16:34:55 -0800 Subject: [PATCH] Create new queries rather than reusing old ones --- ui/src/hosts/components/LayoutRenderer.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/src/hosts/components/LayoutRenderer.js b/ui/src/hosts/components/LayoutRenderer.js index 0412111490..22af06997f 100644 --- a/ui/src/hosts/components/LayoutRenderer.js +++ b/ui/src/hosts/components/LayoutRenderer.js @@ -44,15 +44,18 @@ export const LayoutRenderer = React.createClass({ return this.props.cells.map((cell) => { const qs = cell.queries.map((q) => { - _.merge(q, {host: source}); - q.text += ` where \"host\" = '${host}' and time > ${timeRange}`; + let text = q.text; + text += ` where \"host\" = '${host}' and time > ${timeRange}`; if (q.wheres && q.wheres.length > 0) { - q.text += ` and ${q.wheres.join(' and ')}`; + text += ` and ${q.wheres.join(' and ')}`; } if (q.groupbys && q.groupbys.length > 0) { - q.text += ` group by ${q.groupbys.join(',')}`; + text += ` group by ${q.groupbys.join(',')}`; } - return q; + return { + host: source, + text, + }; }); return (