Skip to content
Snippets Groups Projects
Commit 5d2f6c5c authored by Christoph Dornieden's avatar Christoph Dornieden
Browse files
parents b9d8879e 93c4f847
No related branches found
No related tags found
No related merge requests found
......@@ -48,8 +48,10 @@ export default Component.extend({
}
const $this = this.$();
// flot data points are tuples/arrays [x,y], graphs are arrays of these
// TODO: index is not enough, should show timestamp or other x-axis label
const plotData = this.get('timeSeries.series').map((valueObj, index) => [(Date.now() + index*10000), get(valueObj, 'value')]); // FIXME use timestamp from server
// converts unix timestamps to javascript timestamps (*1000)
// use Ember.get because it would work with Ember.Object and plain JS
const plotData = this.get('timeSeries.series')
.map((valueObj) => [get(valueObj, 'timestamp')*1000, get(valueObj, 'value')]);
this.debug('plotData', plotData);
// wrap in additional array since flot can handle multiple graphs at once, we only need one
const plot = $this.plot([plotData], this.get('options')).data('plot');
......
......@@ -17,7 +17,7 @@ Model.reopenClass({
"revisionNumber":0,
"systemId":"system123",
"name":"Inventory",
"status": "warning",
"status": "WARNING",
"nodeId":"test-system123-node-2",
"serviceId":"test-system123-service-4"
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment