Compare commits
3 Commits
add_schedu
...
optimize_s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
357acd6f91 | ||
|
|
6ea9933d60 | ||
| 7984783cdf |
@@ -16,8 +16,6 @@ standard-minifiers # JS/CSS minifiers run for production mode
|
|||||||
es5-shim # ECMAScript 5 compatibility for older browsers.
|
es5-shim # ECMAScript 5 compatibility for older browsers.
|
||||||
ecmascript # Enable ECMAScript2015+ syntax in app code
|
ecmascript # Enable ECMAScript2015+ syntax in app code
|
||||||
|
|
||||||
autopublish # Publish all data to the clients (for prototyping)
|
|
||||||
insecure # Allow all DB writes from clients (for prototyping)
|
|
||||||
less
|
less
|
||||||
huttonr:bootstrap3
|
huttonr:bootstrap3
|
||||||
nimble:restivus
|
nimble:restivus
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
accounts-base@1.2.2
|
accounts-base@1.2.2
|
||||||
accounts-password@1.1.4
|
accounts-password@1.1.4
|
||||||
amplify@1.0.0
|
amplify@1.0.0
|
||||||
autopublish@1.0.4
|
|
||||||
autoupdate@1.2.4
|
autoupdate@1.2.4
|
||||||
babel-compiler@5.8.24_1
|
babel-compiler@5.8.24_1
|
||||||
babel-runtime@0.1.4
|
babel-runtime@0.1.4
|
||||||
@@ -38,7 +37,6 @@ http@1.1.1
|
|||||||
huttonr:bootstrap3@3.3.6_6
|
huttonr:bootstrap3@3.3.6_6
|
||||||
huttonr:bootstrap3-assets@3.3.6_2
|
huttonr:bootstrap3-assets@3.3.6_2
|
||||||
id-map@1.0.4
|
id-map@1.0.4
|
||||||
insecure@1.0.4
|
|
||||||
jquery@1.11.4
|
jquery@1.11.4
|
||||||
json@1.0.3
|
json@1.0.3
|
||||||
launch-screen@1.0.4
|
launch-screen@1.0.4
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
|
|
||||||
|
|
||||||
#bucket_image {
|
#bucket_image {
|
||||||
width: 30%;
|
width: 60%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ function sensor_data_collection() {
|
|||||||
}, {
|
}, {
|
||||||
sort: {
|
sort: {
|
||||||
created_at: -1
|
created_at: -1
|
||||||
}
|
},
|
||||||
|
limit: 100
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
app/client/startup.js
Normal file
8
app/client/startup.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Tracker.autorun(function () {
|
||||||
|
var id = Session.get('controller_id');
|
||||||
|
if (id) {
|
||||||
|
Meteor.subscribe("sensor_data", id);
|
||||||
|
var hamo = Meteor.subscribe("controller_state", id);
|
||||||
|
console.log(hamo);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -1,12 +1,7 @@
|
|||||||
function controller_state() {
|
function controller_state() {
|
||||||
var controller = Session.get('controller_id');
|
var controllerId = Session.get('controller_id');
|
||||||
var result = {}
|
result = ControllerState.findOne({});
|
||||||
if (controller) {
|
console.log("jupiii", result);
|
||||||
result = ControllerState.findOne({
|
|
||||||
controller_id: controller
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
result = {}
|
result = {}
|
||||||
};
|
};
|
||||||
@@ -20,7 +15,8 @@ function sensor_data_collection() {
|
|||||||
}, {
|
}, {
|
||||||
sort: {
|
sort: {
|
||||||
created_at: -1
|
created_at: -1
|
||||||
}
|
},
|
||||||
|
limit: 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
18
app/server/publications.js
Normal file
18
app/server/publications.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
// This code only runs on the server
|
||||||
|
Meteor.publish("sensor_data", function(controllerId) {
|
||||||
|
return SensorData.find({
|
||||||
|
controllerId: controllerId
|
||||||
|
}, {
|
||||||
|
sort: {
|
||||||
|
created_at: -1
|
||||||
|
},
|
||||||
|
limit: 100
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// This code only runs on the server
|
||||||
|
Meteor.publish("controller_state", function(controllerId) {
|
||||||
|
return ControllerState.find({
|
||||||
|
controller_id: controllerId
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user