From ac4cd8f0c38ac0a4485a8d490fca1a9a48f9bb97 Mon Sep 17 00:00:00 2001 From: Timo Volkmann Date: Sun, 26 Jul 2020 13:52:43 +0200 Subject: [PATCH] fixed dropdown when no data for device --- imports/ui/Overview.jsx | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/imports/ui/Overview.jsx b/imports/ui/Overview.jsx index 80272e1..970e268 100644 --- a/imports/ui/Overview.jsx +++ b/imports/ui/Overview.jsx @@ -20,8 +20,9 @@ export default function Overview() { return []; } else { return SensorDataCollection.find({device_id: activeDevice.deviceId}, { - sort: {timestamp: -1}, - limit: 1440 + timestamp: { $gt: moment(Date.now()).subtract(1, 'days').toDate() }, + sort: { timestamp: -1 }, + //limit: 1440 }).fetch().reverse(); } }); @@ -41,6 +42,31 @@ export default function Overview() { if ((sensorData.length <= 0)) { return ( + <> +

+ + +

Devices:

+ +
+ + +
+ + + + {configuredDevices.map((devices, index) => { + return + })} + + +
+ + +
active device: {!activeDevice === undefined && !ConfiguredDevicesCollection.findOne({ deviceId: activeDevice.deviceId }) === undefined ? ConfiguredDevicesCollection.findOne({ deviceId: activeDevice.deviceId }).alias : "No device selected"}
+ +
+ @@ -48,7 +74,8 @@ export default function Overview() { Please wait... - + + ) } else { return (