};
this._shouldConstructTable = true;
this._renderQueue = [];
+ this._configGroups = [];
- var current = Date.now();
- var timeRange = [current - 7 * 24 * 3600 * 1000, current];
for (var metricGroup of summarySettings.metricGroups) {
var group = {name: metricGroup.name, rows: []};
this._table.groups.push(group);
var row = {name: subMetricGroup.name, cells: []};
group.rows.push(row);
for (var platformGroup of summarySettings.platformGroups)
- row.cells.push(this._createConfigurationGroupAndStartFetchingData(platformGroup.platforms, subMetricGroup.metrics, timeRange));
+ row.cells.push(this._createConfigurationGroup(platformGroup.platforms, subMetricGroup.metrics));
}
}
}
open(state)
{
super.open(state);
+
+ var current = Date.now();
+ var timeRange = [current - 7 * 24 * 3600 * 1000, current];
+ for (var group of this._configGroups)
+ group.fetchAndComputeSummary(timeRange).then(this.render.bind(this));
}
render()
render();
}
- _createConfigurationGroupAndStartFetchingData(platformIdList, metricIdList, timeRange)
+ _createConfigurationGroup(platformIdList, metricIdList)
{
var platforms = platformIdList.map(function (id) { return Platform.findById(id); }).filter(function (obj) { return !!obj; });
var metrics = metricIdList.map(function (id) { return Metric.findById(id); }).filter(function (obj) { return !!obj; });
var configGroup = new SummaryPageConfigurationGroup(platforms, metrics);
- configGroup.fetchAndComputeSummary(timeRange).then(this.render.bind(this));
+ this._configGroups.push(configGroup);
return configGroup;
}