diff --git a/ui/src/hosts/components/LayoutRenderer.js b/ui/src/hosts/components/LayoutRenderer.js index ff938cb69e..f314b59794 100644 --- a/ui/src/hosts/components/LayoutRenderer.js +++ b/ui/src/hosts/components/LayoutRenderer.js @@ -16,6 +16,7 @@ export const LayoutRenderer = React.createClass({ rp: PropTypes.string.isRequired, text: PropTypes.string.isRequired, database: PropTypes.string.isRequired, + groupBys: PropTypes.arrayOf(PropTypes.string), }).isRequired ).isRequired, x: PropTypes.number.isRequired, @@ -43,6 +44,9 @@ export const LayoutRenderer = React.createClass({ return this.props.cells.map((cell) => { const qs = cell.queries.map((q) => { _.merge(q, {host: source}); + if (q.groupBys && q.groupBys.length > 0) { + q.text += ` group by ${q.groupBys.join(' ')}`; + } q.text += ` where host = '${host}' and time > ${timeRange}`; return q; });