Fix merge conflict.
This commit is contained in:
commit
0662649faf
@ -29,7 +29,5 @@ Meteor.startup(() => {
|
|||||||
Meteor.subscribe('activeDeviceCollection');
|
Meteor.subscribe('activeDeviceCollection');
|
||||||
}
|
}
|
||||||
|
|
||||||
Meteor.setTimeout(function() {
|
ReactDOM.render(<App />, document.getElementById('root'));
|
||||||
ReactDOM.render(<App />, document.getElementById('root'));
|
|
||||||
}, 1250);
|
|
||||||
});
|
});
|
||||||
@ -3,6 +3,7 @@ import {CartesianGrid, Legend, Line, LineChart, ResponsiveContainer, Tooltip, XA
|
|||||||
import SensorCardDeck from './SensorCardDeck'
|
import SensorCardDeck from './SensorCardDeck'
|
||||||
import {SensorDataCollection, ActiveDeviceCollection} from "../../client/main";
|
import {SensorDataCollection, ActiveDeviceCollection} from "../../client/main";
|
||||||
import {useTracker} from 'meteor/react-meteor-data';
|
import {useTracker} from 'meteor/react-meteor-data';
|
||||||
|
|
||||||
import {Col, Form, Row} from "react-bootstrap";
|
import {Col, Form, Row} from "react-bootstrap";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
@ -28,13 +29,25 @@ export default function Home() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
|
||||||
|
if (sensorData.length <= 0) {
|
||||||
|
return (
|
||||||
|
<CardDeck>
|
||||||
|
<Card>
|
||||||
|
<Card.Body>
|
||||||
|
<Card.Title>Loading!</Card.Title>
|
||||||
|
<Card.Text>Please wait...</Card.Text>
|
||||||
|
</Card.Body>
|
||||||
|
</Card>
|
||||||
|
</CardDeck>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
<>
|
<>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs lg="2">
|
<Col xs lg="2">
|
||||||
<h4>Devices:</h4>
|
<h4>Devices:</h4>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs lg="2">
|
<Col xs lg="2">
|
||||||
@ -55,7 +68,6 @@ export default function Home() {
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<SensorCardDeck/>
|
<SensorCardDeck/>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<ResponsiveContainer width='100%' height={350}>
|
<ResponsiveContainer width='100%' height={350}>
|
||||||
@ -109,5 +121,5 @@ export default function Home() {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</>
|
</>
|
||||||
)
|
)}
|
||||||
}
|
}
|
||||||
@ -11,33 +11,45 @@ export default function SensorCardDeck() {
|
|||||||
const sensorData = useTracker(() => {
|
const sensorData = useTracker(() => {
|
||||||
return SensorDataCollection.find({ device_id: deviceName.deviceName }, { sort: { timestamp: -1 }, limit: 1 }).fetch();
|
return SensorDataCollection.find({ device_id: deviceName.deviceName }, { sort: { timestamp: -1 }, limit: 1 }).fetch();
|
||||||
});
|
});
|
||||||
|
if (sensorData.length <= 0) {
|
||||||
return (
|
return (
|
||||||
<CardDeck>
|
<CardDeck>
|
||||||
<Card>
|
<Card>
|
||||||
<Card.Body>
|
<Card.Body>
|
||||||
<Card.Title>Temperature</Card.Title>
|
<Card.Title>Loading!</Card.Title>
|
||||||
<Card.Text>{sensorData[0].temperature} °C</Card.Text>
|
<Card.Text>Please wait...</Card.Text>
|
||||||
</Card.Body>
|
</Card.Body>
|
||||||
</Card>
|
</Card>
|
||||||
<Card>
|
</CardDeck>
|
||||||
<Card.Body>
|
)
|
||||||
<Card.Title>Humidity</Card.Title>
|
} else {
|
||||||
<Card.Text>{sensorData[0].humidity} %</Card.Text>
|
return (
|
||||||
</Card.Body>
|
<CardDeck>
|
||||||
</Card>
|
<Card>
|
||||||
<Card>
|
<Card.Body>
|
||||||
<Card.Body>
|
<Card.Title>Temperature</Card.Title>
|
||||||
<Card.Title>Brightness</Card.Title>
|
<Card.Text>{sensorData[0].temperature} °C</Card.Text>
|
||||||
<Card.Text>{sensorData[0].brightness} lux</Card.Text>
|
</Card.Body>
|
||||||
</Card.Body>
|
</Card>
|
||||||
</Card>
|
<Card>
|
||||||
<Card>
|
<Card.Body>
|
||||||
<Card.Body>
|
<Card.Title>Humidity</Card.Title>
|
||||||
<Card.Title>Moisture</Card.Title>
|
<Card.Text>{sensorData[0].humidity} %</Card.Text>
|
||||||
<Card.Text>{sensorData[0].moisture} %</Card.Text>
|
</Card.Body>
|
||||||
</Card.Body>
|
</Card>
|
||||||
</Card>
|
<Card>
|
||||||
</CardDeck>
|
<Card.Body>
|
||||||
)
|
<Card.Title>Brightness</Card.Title>
|
||||||
|
<Card.Text>{sensorData[0].brightness} lux</Card.Text>
|
||||||
|
</Card.Body>
|
||||||
|
</Card>
|
||||||
|
<Card>
|
||||||
|
<Card.Body>
|
||||||
|
<Card.Title>Moisture</Card.Title>
|
||||||
|
<Card.Text>{sensorData[0].moisture} %</Card.Text>
|
||||||
|
</Card.Body>
|
||||||
|
</Card>
|
||||||
|
</CardDeck>
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -2,7 +2,8 @@
|
|||||||
"name": "smart_garden_server",
|
"name": "smart_garden_server",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "meteor run",
|
"start": "MONGO_URL=mongodb://garden:99009911@cloud.timovolkmann.de:27017/Smart_Garden meteor run",
|
||||||
|
"plainstart": "meteor run",
|
||||||
"test": "meteor test --once --driver-package meteortesting:mocha",
|
"test": "meteor test --once --driver-package meteortesting:mocha",
|
||||||
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
|
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
|
||||||
"visualize": "meteor --production --extra-packages bundle-visualizer"
|
"visualize": "meteor --production --extra-packages bundle-visualizer"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user