From de37286c46bd00cc387b59052e111e2042aa5f1b Mon Sep 17 00:00:00 2001 From: Chris Goller Date: Fri, 27 Jan 2017 13:15:50 -0600 Subject: [PATCH 1/2] Fix layout autoflow to handle multiple cells per layout --- ui/src/hosts/containers/HostPage.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/src/hosts/containers/HostPage.js b/ui/src/hosts/containers/HostPage.js index 5a19a57cf3..8c494288df 100644 --- a/ui/src/hosts/containers/HostPage.js +++ b/ui/src/hosts/containers/HostPage.js @@ -86,13 +86,17 @@ export const HostPage = React.createClass({ const cellHeight = 4; const pageWidth = 12; - const autoflowCells = autoflowLayouts.reduce((allCells, layout, i) => { - return allCells.concat(layout.cells.map((cell, j) => { + let cellCount = 0; + const autoflowCells = autoflowLayouts.reduce((allCells, layout) => { + return allCells.concat(layout.cells.map((cell) => { + const x = (cellCount * cellWidth % pageWidth); + const y = Math.floor(cellCount * cellWidth / pageWidth) * cellHeight; + cellCount += 1; return Object.assign(cell, { w: cellWidth, h: cellHeight, - x: ((i + j) * cellWidth % pageWidth), - y: Math.floor(((i + j) * cellWidth / pageWidth)) * cellHeight, + x, + y, }); })); }, []); From 62acebc5c49fde3ef81a47654c329270b6f9cf18 Mon Sep 17 00:00:00 2001 From: Chris Goller Date: Fri, 27 Jan 2017 13:18:56 -0600 Subject: [PATCH 2/2] Update CHANGELOG to add #774 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 872d869f62..d4e5d692ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Upcoming Bug Fixes 1. [#788](https://github.com/influxdata/chronograf/pull/788): Fix missing fields in data explorer when using non-default retention policy + 1. [#774](https://github.com/influxdata/chronograf/issues/774): Fix gaps in layouts for hosts ### Upcoming Features 1. [#779](https://github.com/influxdata/chronograf/issues/779): Add layout for telegraf's diskio system plugin