webui ===== .. py:module:: webui .. autoapi-nested-parse:: Web interface for choosing what the six tiles show. The page (webpage.py) is static; it loads and saves the tiles through the JSON endpoints here. Storage, the data source's catalog and the reaction to a save are injected, so the handlers run on the host in tests. Classes ------- .. autoapisummary:: webui.WebUI Module Contents --------------- .. py:class:: WebUI(load_tiles, save_tiles, catalog, on_saved, link_tile, load_alerts=lambda: [], save_alerts=None, version=None) Handlers for the settings page and its JSON endpoints. .. py:method:: routes() Return the routes to serve with `webapi.handle`. .. py:method:: page() GET /: the settings page. .. py:method:: get_tiles() GET /api/tiles: the tiles, warning sources and their limits. .. py:method:: post_tiles(body) POST /api/tiles: save {"tiles": [...], "alerts": [...]}. "alerts" is optional. Both are checked before anything is stored. .. py:method:: get_catalog() GET /api/catalog: the source's values, fetched once and cached.