mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
additional debug info
This commit is contained in:
parent
a5eac9242b
commit
4d41d8b66d
2 changed files with 24 additions and 1 deletions
|
@ -3,11 +3,26 @@ import json
|
|||
from fastapi import APIRouter, Depends
|
||||
from mealie.core.config import APP_VERSION, LOGGER_FILE, app_dirs, settings
|
||||
from mealie.routes.deps import get_current_user
|
||||
from mealie.schema.debug import AppInfo
|
||||
from mealie.schema.debug import AppInfo, DebugInfo
|
||||
|
||||
router = APIRouter(prefix="/api/debug", tags=["Debug"])
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def get_debug_info(current_user=Depends(get_current_user)):
|
||||
""" Returns general information about the application for debugging """
|
||||
|
||||
return DebugInfo(
|
||||
version=APP_VERSION,
|
||||
demo_status=settings.IS_DEMO,
|
||||
api_port=settings.API_PORT,
|
||||
api_docs=settings.API_DOCS,
|
||||
db_type=settings.DATABASE_TYPE,
|
||||
sqlite_file=settings.SQLITE_FILE,
|
||||
default_group=settings.DEFAULT_GROUP,
|
||||
)
|
||||
|
||||
|
||||
@router.get("/version")
|
||||
async def get_mealie_version():
|
||||
""" Returns the current version of mealie"""
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
from pathlib import Path
|
||||
from fastapi_camelcase import CamelModel
|
||||
|
||||
|
||||
class AppInfo(CamelModel):
|
||||
version: str
|
||||
demo_status: bool
|
||||
|
||||
class DebugInfo(AppInfo):
|
||||
api_port: int
|
||||
api_docs: bool
|
||||
db_type: str
|
||||
sqlite_file: Path
|
||||
default_group: str
|
Loading…
Add table
Add a link
Reference in a new issue