From c72ca04fd21a46af4ffd311e7a4444a53e5ceed6 Mon Sep 17 00:00:00 2001 From: Gilles Soulier Date: Mon, 25 May 2026 16:44:31 +0200 Subject: [PATCH] =?UTF-8?q?feat(config):=20stats=20vid=C3=A9o=20+=20user?= =?UTF-8?q?=201000:1000=20dans=20docker-compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Admin stats : ajout video (count + size_bytes) dans /api/admin/stats. ConfigPage : grille médias 3 colonnes (Photos / Audio / Vidéos). docker-compose : backend et backend-worker tournent en user 1000:1000 pour que les fichiers écrits dans ./data/ appartiennent à l'utilisateur hôte et non à root. v0.5.6 Co-Authored-By: Claude Sonnet 4.6 --- backend/app/api/admin.py | 2 ++ docker-compose.yml | 2 ++ frontend/package.json | 2 +- frontend/src/api/admin.ts | 1 + frontend/src/pages/ConfigPage.tsx | 3 ++- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/app/api/admin.py b/backend/app/api/admin.py index eacf9a7..42a8a50 100644 --- a/backend/app/api/admin.py +++ b/backend/app/api/admin.py @@ -33,12 +33,14 @@ async def get_stats(session: AsyncSession = Depends(get_session)): uploads = settings.upload_path photos = _dir_stats(uploads / "images" / "originals") if (uploads / "images" / "originals").exists() else {"count": 0, "size_bytes": 0} audio = _dir_stats(uploads / "audio") if (uploads / "audio").exists() else {"count": 0, "size_bytes": 0} + video = _dir_stats(uploads / "videos") if (uploads / "videos").exists() else {"count": 0, "size_bytes": 0} return { "db_size_bytes": db_size, "media": { "photos": photos, "audio": audio, + "video": video, }, "counts": { "notes": notes_count, diff --git a/docker-compose.yml b/docker-compose.yml index 4ac542b..964cb99 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,7 @@ services: backend: build: ./backend + user: "1000:1000" environment: DATABASE_URL: postgresql+asyncpg://homehub:homehub@db:5432/homehub UPLOAD_DIR: /data/uploads @@ -44,6 +45,7 @@ services: backend-worker: build: ./backend + user: "1000:1000" command: arq app.workers.notes_worker.WorkerSettings environment: DATABASE_URL: postgresql+asyncpg://homehub:homehub@db:5432/homehub diff --git a/frontend/package.json b/frontend/package.json index c506c0d..ae3b9c0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "homehub-frontend", "private": true, - "version": "0.5.5", + "version": "0.5.6", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/api/admin.ts b/frontend/src/api/admin.ts index 3dd8d4a..ef1521a 100644 --- a/frontend/src/api/admin.ts +++ b/frontend/src/api/admin.ts @@ -3,6 +3,7 @@ export interface AppStats { media: { photos: { count: number; size_bytes: number } audio: { count: number; size_bytes: number } + video: { count: number; size_bytes: number } } counts: { notes: number diff --git a/frontend/src/pages/ConfigPage.tsx b/frontend/src/pages/ConfigPage.tsx index f407e75..888afc7 100644 --- a/frontend/src/pages/ConfigPage.tsx +++ b/frontend/src/pages/ConfigPage.tsx @@ -155,10 +155,11 @@ export default function ConfigPage() { {/* Médias */} -
+
{[ { icon: 'image', label: 'Photos', data: stats.media.photos }, { icon: 'microphone', label: 'Audio', data: stats.media.audio }, + { icon: 'video', label: 'Vidéos', data: stats.media.video }, ].map(item => (