-
- {{ showButtonText }}
-
+
+
+
+ {{ showButtonText }}
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/UI/TheSidebar.vue b/frontend/src/components/UI/TheSidebar.vue
index 834c60d97..69cfad552 100644
--- a/frontend/src/components/UI/TheSidebar.vue
+++ b/frontend/src/components/UI/TheSidebar.vue
@@ -147,6 +147,11 @@ export default {
},
adminLinks() {
return [
+ {
+ icon: "mdi-view-dashboard",
+ to: "/admin/dashboard",
+ title: this.$t("general.dashboard"),
+ },
{
icon: "mdi-cog",
to: "/admin/settings",
diff --git a/frontend/src/locales/messages/en-US.json b/frontend/src/locales/messages/en-US.json
index bf316dd25..e107c98f7 100644
--- a/frontend/src/locales/messages/en-US.json
+++ b/frontend/src/locales/messages/en-US.json
@@ -14,7 +14,7 @@
"demo-status": "Demo Status",
"development": "Development",
"download-log": "Download Log",
- "download-recipe-json": "Download Recipe JSON",
+ "download-recipe-json": "Last Scraped JSON",
"not-demo": "Not Demo",
"production": "Production",
"database-url": "Database URL",
@@ -36,6 +36,7 @@
"confirm": "Confirm",
"create": "Create",
"current-parenthesis": "(Current)",
+ "dashboard": "Dashboard",
"delete": "Delete",
"disabled": "Disabled",
"download": "Download",
diff --git a/mealie/core/root_logger.py b/mealie/core/root_logger.py
index dfa652f40..9d40bfdb1 100644
--- a/mealie/core/root_logger.py
+++ b/mealie/core/root_logger.py
@@ -4,8 +4,8 @@ import sys
from mealie.core.config import DATA_DIR
LOGGER_FILE = DATA_DIR.joinpath("mealie.log")
-LOGGER_FORMAT = "%(levelname)s: \t%(message)s"
DATE_FORMAT = "%d-%b-%y %H:%M:%S"
+LOGGER_FORMAT = "%(levelname)s: %(asctime)s \t%(message)s"
logging.basicConfig(level=logging.INFO, format=LOGGER_FORMAT, datefmt="%d-%b-%y %H:%M:%S")
@@ -30,6 +30,9 @@ def logger_init() -> logging.Logger:
return logger
+root_logger = logger_init()
+
+
def get_logger(module=None) -> logging.Logger:
""" Returns a child logger for mealie """
global root_logger
@@ -38,6 +41,3 @@ def get_logger(module=None) -> logging.Logger:
return root_logger
return root_logger.getChild(module)
-
-
-root_logger = logger_init()
diff --git a/mealie/routes/debug_routes.py b/mealie/routes/debug_routes.py
index cbcc32bcf..04f1516bb 100644
--- a/mealie/routes/debug_routes.py
+++ b/mealie/routes/debug_routes.py
@@ -2,8 +2,11 @@ from fastapi import APIRouter, Depends
from mealie.core.config import APP_VERSION, app_dirs, settings
from mealie.core.root_logger import LOGGER_FILE
from mealie.core.security import create_file_token
+from mealie.db.database import db
+from mealie.db.db_setup import generate_session
from mealie.routes.deps import get_current_user
-from mealie.schema.debug import AppInfo, DebugInfo
+from mealie.schema.about import AppInfo, AppStatistics, DebugInfo
+from sqlalchemy.orm.session import Session
router = APIRouter(prefix="/api/debug", tags=["Debug"])
@@ -24,6 +27,17 @@ async def get_debug_info(current_user=Depends(get_current_user)):
)
+@router.get("/statistics")
+async def get_app_statistics(session: Session = Depends(generate_session)):
+ return AppStatistics(
+ total_recipes=db.recipes.count_all(session),
+ uncategorized_recipes=db.recipes.count_uncategorized(session),
+ untagged_recipes=db.recipes.count_untagged(session),
+ total_users=db.users.count_all(session),
+ total_groups=db.groups.count_all(session),
+ )
+
+
@router.get("/version")
async def get_mealie_version():
""" Returns the current version of mealie"""
diff --git a/mealie/schema/debug.py b/mealie/schema/about.py
similarity index 63%
rename from mealie/schema/debug.py
rename to mealie/schema/about.py
index 5d9c20211..e9f07c365 100644
--- a/mealie/schema/debug.py
+++ b/mealie/schema/about.py
@@ -2,6 +2,13 @@ from pathlib import Path
from fastapi_camelcase import CamelModel
+class AppStatistics(CamelModel):
+ total_recipes: int
+ total_users: int
+ total_groups: int
+ uncategorized_recipes: int
+ untagged_recipes: int
+
class AppInfo(CamelModel):
production: bool
diff --git a/mealie/services/recipe/media.py b/mealie/services/recipe/media.py
index 2cd5b38b8..d4fe93df3 100644
--- a/mealie/services/recipe/media.py
+++ b/mealie/services/recipe/media.py
@@ -27,3 +27,4 @@ def check_assets(original_slug, recipe: Recipe) -> Path:
def delete_assets(recipe_slug):
recipe_dir = Recipe(slug=recipe_slug).directory
rmtree(recipe_dir, ignore_errors=True)
+ logger.info(f"Recipe Directory Removed: {recipe_slug}")