from __future__ import annotations
from datetime import datetime, timedelta, timezone
from os import environ
from astrape_ems.classes.env import EnvLoader
from astrape_dashboard.classes.sample_data import WeatherSampleData
from astrape_oracle.classes.weather.store import WeatherStore, WeatherStoreConfigurationError
from astrape_dashboard.classes.displays.weather import WeatherDisplay
from astrape_dashboard.classes.displays.station import WeatherStationDisplay
from astrape_dashboard.classes.displays.oracle import OracleDisplay
from astrape_dashboard.classes.displays.oracle_quality import OracleQualityDisplay
class WebUI:
"""Composes Astrape web modules into a small control panel."""
def __init__(self) -> None:
self.weather_display = WeatherDisplay()
self.weather_station_display = WeatherStationDisplay()
self.oracle_display = OracleDisplay()
self.oracle_quality_display = OracleQualityDisplay()
def render_page(self, page: str = "oracle") -> str:
current_page = (
page
if page in {"oracle", "weather", "weather_station", "quality"}
else "oracle"
)
return f"""