Michal Sojka [Thu, 20 Aug 2020 11:21:09 +0000 (13:21 +0200)]
Enable ntpd
We need the time on the terminal to be synchronized with the server so
that events are not reported in the future. Currently, we had terminal
time running 10 minutes ahead, which caused problems with the new
"event logging" commits.
Michal Sojka [Sun, 2 Aug 2020 22:25:50 +0000 (00:25 +0200)]
Update submodules
* coffee-flask e21678b...9a9446d (28):
> Add comments
> Workaround the incompatibility created by Matplotlib 3.3.0
> Suppress Matplotlib's deprecation warning
> Add TODO
> Add doc string
> Add `type` for flavors and build current consumption dynamically
> Add new beverage `tea` and make buttons larger
> Add missing quotes in JS handler for disabling identifier
> Include constant SQL values directly in queries
> Update debug message
> Rename DB field identifiers.status to identifiers.active
> Add support for multiple identifiers per user
> Wrap long line and unify upper-casing of SQL keywords
> Separate counting of coffees and club-mate
> Remove last coffe pack opened button
> Add support for another beverages (namely club mate)
> Change the name of the configuration file
> Fix column name in UNIQUE index
> Fix duplicate recording of coffees
> English fixes
> Make config-related error message more informative
> Add last coffee pack button
> Fix data acquisition for flavor graph.
> Add TODO
> Add graphs with total coffee consumption on login screen
> Fix tag in 'user' template
> Remove unused function
> Fix incorrect counting of coffees made during time close to midnight
Michal Sojka [Mon, 3 Sep 2018 16:20:15 +0000 (18:20 +0200)]
coffee-flask: Fix coffee graph for start of the month
An error was found during the start of new month. To fix this I have
changed the SQL query to use '%s' (unix time) instead of '%d' (day
number).
How does this work?
The SQL query is using relation between two tables based on the date.
This relation is created using these parts of query:
> "select num,date('now',-num || ' days')" as d from days
> d = date(c.time)
First line creates timestampes of last 7 days -- time is set to
UTC midnight.
Second line converts data in 'c.time' to date struct - BUT! Even
here the time is set to midnight. This behaviour makes the relation
possible.
How does it behave in app.py?
Result of the query contains data that are ordered by time.
Unfortunately this order is lost during recasting the data to
list/dict (which are unordered). To solve this sorting is used.
Sorting data with unix time is safe, because it is always increasing.
To highlight this change, 'days' variable is refactored to 'unix_days'.
Michal Sojka [Thu, 16 Aug 2018 22:16:41 +0000 (00:16 +0200)]
Fix offline mode and make it a bit more user friendly
Hopefully, there are not many new bugs :)
The notable changes in submodules are:
Submodule coffee-flask 9b74ccb..d99857c:
> Center all content
> Show current content of the offline queue when going offline
> Do not allow multiple reconnect timers running simultaneously
> When replaying offline queue, use the original event time rather than now()
> Remove unused variable
> Replace "fuck" with "ajax_failure"
> Logout automatically even without selecting any beverage
> Implement clean switching between online and offline mode
> Catch all exceptions in JS function updateUI
> Use new data structure for offline-collected data
> Remove commented out code
Submodule terminal/src/mt-apps 89b7898..8a4c5fe:
> Make it easier to call showOfflineQueue() from remote scripts
> Replace tabs with spaces
> Do not generate "empty" messages
> Rework offline mode
> Store offline data in an array rather than in a hash
> Use more distinguishable user ids for simulated users
> Replace tabs with spaces
Michal Sojka [Mon, 6 Aug 2018 10:46:28 +0000 (12:46 +0200)]
terminal/src/buildroot: Use specific version of ufr-lib
Using just master can mean that we will not be able to build our
software later, when ufr-lib changes its interface. Use current
version, where build works.