mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-30 05:47:09 -05:00
* add tail log viewer routes * add log viewer * add _mealie to ignore directories * add detailed breakdown of storage * generate types * add dialog to view breakdown * cleanup mobile UI * move migrations page * spelling * init analytics page * move route up * add remove temp files function * analytics API client * stub out analytics pages * generate types * stub out analytics routes * update names * ignore types * temporary remove analytics from sidebar
21 lines
621 B
Python
21 lines
621 B
Python
from functools import cached_property
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from mealie.routes._base import BaseAdminController, controller
|
|
from mealie.schema.analytics.analytics import MealieAnalytics
|
|
from mealie.services.analytics.service_analytics import AnalyticsService
|
|
|
|
router = APIRouter(prefix="/analytics")
|
|
|
|
|
|
@controller(router)
|
|
class AdminAboutController(BaseAdminController):
|
|
@cached_property
|
|
def service(self) -> AnalyticsService:
|
|
return AnalyticsService(self.repos)
|
|
|
|
@router.get("", response_model=MealieAnalytics)
|
|
def get_analytics(self):
|
|
return self.service.calculate_analytics()
|