-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0a21ee
commit 5e25e92
Showing
5 changed files
with
34 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
class DeviceListItemComponent extends CommonComponent { | ||
onCreated() { | ||
super.onCreated(); | ||
// onCreated() { | ||
// super.onCreated(); | ||
|
||
let device = Template.currentData(); | ||
// let device = Template.currentData(); | ||
|
||
this.autorun(computation => { | ||
let deviceUuid = device.uuid; | ||
if (!deviceUuid) { return; } | ||
// this.autorun(computation => { | ||
// let deviceUuid = device.uuid; | ||
// if (!deviceUuid) { return; } | ||
|
||
this.subscribe('Device.one', deviceUuid); | ||
// this.subscribe('Device.one', deviceUuid); | ||
|
||
this.subscribe('Data.points', deviceUuid); | ||
// this.subscribe('Data.points', deviceUuid); | ||
|
||
return this.dataPoint = () => { | ||
let dataPoint = Data.documents.findOne( | ||
{'device._id': device._id} | ||
, { | ||
'sort': { | ||
'insertedAt': -1 | ||
} | ||
}); | ||
if (!_.isUndefined(dataPoint)) { | ||
return dataPoint.data; | ||
} | ||
}; | ||
}); | ||
} | ||
// return this.dataPoint = () => { | ||
// let dataPoint = Data.documents.findOne( | ||
// {'device._id': device._id} | ||
// , { | ||
// 'sort': { | ||
// 'insertedAt': -1 | ||
// } | ||
// }); | ||
// if (!_.isUndefined(dataPoint)) { | ||
// return dataPoint.data; | ||
// } | ||
// }; | ||
// }); | ||
// } | ||
|
||
currentValue() { | ||
return this.dataPoint(); | ||
} | ||
}; | ||
// currentValue() { | ||
// return this.dataPoint(); | ||
// } | ||
} | ||
|
||
DeviceListItemComponent.register('DeviceListItemComponent'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters