Merge pull request #432 from influxdata/time-selection
Create new queries rather than reusing old onespull/10616/head
commit
f0d768b201
|
@ -44,15 +44,18 @@ export const LayoutRenderer = React.createClass({
|
||||||
|
|
||||||
return this.props.cells.map((cell) => {
|
return this.props.cells.map((cell) => {
|
||||||
const qs = cell.queries.map((q) => {
|
const qs = cell.queries.map((q) => {
|
||||||
_.merge(q, {host: source});
|
let text = q.text;
|
||||||
q.text += ` where \"host\" = '${host}' and time > ${timeRange}`;
|
text += ` where \"host\" = '${host}' and time > ${timeRange}`;
|
||||||
if (q.wheres && q.wheres.length > 0) {
|
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) {
|
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 (
|
return (
|
||||||
<div key={cell.i}>
|
<div key={cell.i}>
|
||||||
|
|
Loading…
Reference in New Issue