inenvmon_server/webapp
2020-06-22 17:48:48 +02:00
..
static Merge branch 'master' into testing 2020-06-22 17:48:48 +02:00
templates major cleanup, added comments 2020-06-22 17:38:07 +02:00
inenvmon_web.ini add flask app files 2020-04-08 14:44:10 +02:00
inenvmon_web.py major cleanup, added comments 2020-06-22 17:38:07 +02:00
README.md updated readme 2020-06-22 17:41:39 +02:00
wsgi.py add flask app files 2020-04-08 14:44:10 +02:00

webapp

Flask web app for data visalization. Client side is built with Chart.js and justgage js libraries and jQuery.

The app exposes a simple api for querying the database and source sensor status available at /api/function. The functions are:

  • /api/getdata
    • Method: GET, POST
    • Number of samples can be specified with argument samples=desired number, defaults to 120 i.e 2 hours.
    • Returns json with the datasets and information about sensor status
  • /api/heartbeat
    • Method: GET
      • Returns json with status info and last received message timestamp
    • Method: POST
      • Reserved for internal use in reporting sensor status. Requires a secret to be set.

The client side comprises of several parts:

  • templates/index.html provides the basic html skeleton
  • static/styles/style.css takes care of some basic styling and responsive layout
  • static/js/main.js script taking care of creating the plots and gauges, requesting data from server and periodically updating the view