diff --git a/app/components/entity-chart.js b/app/components/entity-chart.js index 4619189..068677f 100644 --- a/app/components/entity-chart.js +++ b/app/components/entity-chart.js @@ -3,10 +3,13 @@ import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'div', classNames: ['layout-page'], + currentProperty: null, visibleProperty: function() { var properties = this.get('entity.properties'); - return properties.objectAt(0); + var prop = properties.objectAt(0); + this.setCurrentProperty(prop); + return prop; }.property('entity'), entityAvailable: function() { @@ -18,9 +21,19 @@ export default Ember.Component.extend({ } }.property('entity'), + setCurrentProperty: function(property) { + if (this.currentProperty) { + this.currentProperty.set('visible', false); + } + + this.currentProperty = property; + this.currentProperty.set('visible', true); + }, + actions: { showPropertyValues(_prop) { this.set('visibleProperty', _prop); + this.setCurrentProperty(_prop); } } }); diff --git a/app/components/line-chart.js b/app/components/line-chart.js index d3ed5de..7b7a4a4 100644 --- a/app/components/line-chart.js +++ b/app/components/line-chart.js @@ -39,7 +39,12 @@ export default Ember.Component.extend({ lastTimestamp = +firstTimestamp + +diffValue; } - $.plot('#' + element.id, [this.data], { + $.plot('#' + element.id, [ + { + data: this.data, + color: "rgb(51, 102, 204)" + } + ], { xaxis: { mode: 'time', timeformat: '%M:%S', diff --git a/app/serializers/application.js b/app/serializers/application.js index 98e9a6a..c824d7d 100644 --- a/app/serializers/application.js +++ b/app/serializers/application.js @@ -94,7 +94,6 @@ export default DS.RESTSerializer.extend({ if (timestamp === 0) { timestamp = (new Date()).getTime(); - console.log('Use local timestamp'); } diff --git a/app/templates/components/property-table.hbs b/app/templates/components/property-table.hbs index df07bf6..ce6d23d 100644 --- a/app/templates/components/property-table.hbs +++ b/app/templates/components/property-table.hbs @@ -1,8 +1,16 @@ - Name + Attributes {{#each model.properties as |property|}} - {{property.name}} + + + {{#if property.visible}} + {{property.name}} + {{else}} + {{property.name}} + {{/if}} + + {{/each}}