Persist vision log enabled setting on client side (#13)

This commit is contained in:
Peter Johnson 2018-12-28 22:48:07 -06:00 committed by GitHub
parent 170962deff
commit de6f59548a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,14 @@ $('#systemWritable').click(function() {
var visionSettingsServer = {};
var visionSettingsDisplay = {'cameras': []};
function pushVisionLogEnabled() {
var msg = {
type: 'visionLogEnabled',
value: visionLogEnabled.prop('checked')
};
connection.send(JSON.stringify(msg));
}
// WebSocket automatic reconnection timer
var reconnectTimerId = 0;
@ -132,6 +140,7 @@ function connect() {
reconnectTimerId = 0;
}
displayConnected();
pushVisionLogEnabled();
};
connection.onclose = function(evt) {
displayDisconnected();
@ -236,11 +245,7 @@ $('#visionKill').click(function() {
});
$('#visionLogEnabled').change(function() {
var msg = {
type: 'visionLogEnabled',
value: this.checked
};
connection.send(JSON.stringify(msg));
pushVisionLogEnabled();
});
//