From 411023021da35087e3c84ece714d80c179933a58 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Wed, 30 Dec 2020 22:12:36 +0100 Subject: [PATCH] Adding persons statistic to ui --- src/backend/middlewares/admin/AdminMWs.ts | 5 ++-- .../database/interfaces/IIndexingManager.ts | 2 +- .../model/database/memory/IndexingManager.ts | 2 ++ src/common/entities/settings/StatisticDTO.ts | 1 + .../indexing/indexing.settings.component.html | 6 +++- src/frontend/translate/messages.en.xlf | 26 +++++++++++------ src/frontend/translate/messages.fr.xlf | 26 +++++++++++------ src/frontend/translate/messages.hu.xlf | 28 ++++++++++++------- src/frontend/translate/messages.ro.xlf | 26 +++++++++++------ src/frontend/translate/messages.ru.xlf | 26 +++++++++++------ 10 files changed, 98 insertions(+), 50 deletions(-) diff --git a/src/backend/middlewares/admin/AdminMWs.ts b/src/backend/middlewares/admin/AdminMWs.ts index 3596b261..f7f3e2dd 100644 --- a/src/backend/middlewares/admin/AdminMWs.ts +++ b/src/backend/middlewares/admin/AdminMWs.ts @@ -5,6 +5,7 @@ import {Config} from '../../../common/config/private/Config'; import {ISQLGalleryManager} from '../../model/database/sql/IGalleryManager'; import {ServerConfig} from '../../../common/config/private/PrivateConfig'; import {ISQLPersonManager} from '../../model/database/sql/IPersonManager'; +import {StatisticDTO} from '../../../common/entities/settings/StatisticDTO'; export class AdminMWs { @@ -18,12 +19,12 @@ export class AdminMWs { const galleryManager = ObjectManagers.getInstance().GalleryManager; const personManager = ObjectManagers.getInstance().PersonManager; try { - req.resultPipe = { + req.resultPipe = { directories: await galleryManager.countDirectories(), photos: await galleryManager.countPhotos(), videos: await galleryManager.countVideos(), diskUsage: await galleryManager.countMediaSize(), - faces: await personManager.countFaces(), + persons: await personManager.countFaces(), }; return next(); } catch (err) { diff --git a/src/backend/model/database/interfaces/IIndexingManager.ts b/src/backend/model/database/interfaces/IIndexingManager.ts index faf0e2a3..5c4a23b3 100644 --- a/src/backend/model/database/interfaces/IIndexingManager.ts +++ b/src/backend/model/database/interfaces/IIndexingManager.ts @@ -1,7 +1,7 @@ import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; export interface IIndexingManager { - SavingReady: Promise + SavingReady: Promise; IsSavingInProgress: boolean; indexDirectory(relativeDirectoryName: string): Promise; diff --git a/src/backend/model/database/memory/IndexingManager.ts b/src/backend/model/database/memory/IndexingManager.ts index 7eee4fef..3cdf52b0 100644 --- a/src/backend/model/database/memory/IndexingManager.ts +++ b/src/backend/model/database/memory/IndexingManager.ts @@ -2,6 +2,8 @@ import {IIndexingManager} from '../interfaces/IIndexingManager'; import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; export class IndexingManager implements IIndexingManager { + IsSavingInProgress: boolean; + SavingReady: Promise; indexDirectory(relativeDirectoryName: string): Promise { throw new Error('not supported by memory DB'); diff --git a/src/common/entities/settings/StatisticDTO.ts b/src/common/entities/settings/StatisticDTO.ts index 8c8b6a5a..73cc4891 100644 --- a/src/common/entities/settings/StatisticDTO.ts +++ b/src/common/entities/settings/StatisticDTO.ts @@ -3,4 +3,5 @@ export interface StatisticDTO { photos: number; videos: number; diskUsage: number; + persons: number; } diff --git a/src/frontend/app/ui/settings/indexing/indexing.settings.component.html b/src/frontend/app/ui/settings/indexing/indexing.settings.component.html index 0b6fc4d9..af6390ff 100644 --- a/src/frontend/app/ui/settings/indexing/indexing.settings.component.html +++ b/src/frontend/app/ui/settings/indexing/indexing.settings.component.html @@ -109,7 +109,7 @@
-
+
Statistic:
@@ -125,6 +125,10 @@ {{_settingsService.statistic.value ? _settingsService.statistic.value.videos : '...'}}
+
+ + {{_settingsService.statistic.value ? _settingsService.statistic.value.persons : '...'}} +
{{_settingsService.statistic.value ? (_settingsService.statistic.value.diskUsage | fileSize) : '...'}} diff --git a/src/frontend/translate/messages.en.xlf b/src/frontend/translate/messages.en.xlf index 669d4e0d..1f8c8b31 100644 --- a/src/frontend/translate/messages.en.xlf +++ b/src/frontend/translate/messages.en.xlf @@ -68,7 +68,7 @@ Remember me app/ui/login/login.component.html - 56 + 58 Remember me @@ -77,7 +77,7 @@ app/ui/login/login.component.html - 66 + 68 Login @@ -419,7 +419,7 @@ app/ui/admin/admin.component.html - 30 + 34 To dismiss these notifications, restart the server. @@ -427,7 +427,7 @@ App version: app/ui/admin/admin.component.html - 43 + 47 App version: @@ -435,7 +435,7 @@ Mode app/ui/admin/admin.component.html - 47 + 51 Mode @@ -443,7 +443,7 @@ Advanced app/ui/admin/admin.component.html - 55 + 59 Advanced @@ -451,7 +451,7 @@ Simplified app/ui/admin/admin.component.html - 56 + 60 Simplified @@ -459,7 +459,7 @@ Up time app/ui/admin/admin.component.html - 135 + 139 Up time @@ -1926,11 +1926,19 @@ Videos + + Persons + + app/ui/settings/indexing/indexing.settings.component.html + 129 + + Persons + Size app/ui/settings/indexing/indexing.settings.component.html - 129 + 133 Size diff --git a/src/frontend/translate/messages.fr.xlf b/src/frontend/translate/messages.fr.xlf index 90bbe165..bffe401f 100644 --- a/src/frontend/translate/messages.fr.xlf +++ b/src/frontend/translate/messages.fr.xlf @@ -68,7 +68,7 @@ Remember me app/ui/login/login.component.html - 56 + 58 Se souvenir de moi @@ -77,7 +77,7 @@ app/ui/login/login.component.html - 66 + 68 Connexion @@ -419,7 +419,7 @@ app/ui/admin/admin.component.html - 30 + 34 Pour supprimer ces notifications, redémarrez le serveur. @@ -427,7 +427,7 @@ App version: app/ui/admin/admin.component.html - 43 + 47 App version: @@ -435,7 +435,7 @@ Mode app/ui/admin/admin.component.html - 47 + 51 Mode @@ -443,7 +443,7 @@ Advanced app/ui/admin/admin.component.html - 55 + 59 Avancé @@ -451,7 +451,7 @@ Simplified app/ui/admin/admin.component.html - 56 + 60 Simplifié @@ -459,7 +459,7 @@ Up time app/ui/admin/admin.component.html - 135 + 139 Up time @@ -1926,11 +1926,19 @@ Vidéos + + Persons + + app/ui/settings/indexing/indexing.settings.component.html + 129 + + Persons + Size app/ui/settings/indexing/indexing.settings.component.html - 129 + 133 Taille diff --git a/src/frontend/translate/messages.hu.xlf b/src/frontend/translate/messages.hu.xlf index 0c292214..c92accd8 100644 --- a/src/frontend/translate/messages.hu.xlf +++ b/src/frontend/translate/messages.hu.xlf @@ -68,7 +68,7 @@ Remember me app/ui/login/login.component.html - 56 + 58 Emlékezz rám @@ -77,7 +77,7 @@ app/ui/login/login.component.html - 66 + 68 Belépés @@ -419,7 +419,7 @@ app/ui/admin/admin.component.html - 30 + 34 Az ilyen értesítések elutasításához indítsa újra a kiszolgálót. @@ -427,7 +427,7 @@ App version: app/ui/admin/admin.component.html - 43 + 47 Verzió: @@ -435,7 +435,7 @@ Mode app/ui/admin/admin.component.html - 47 + 51 Mód @@ -443,7 +443,7 @@ Advanced app/ui/admin/admin.component.html - 55 + 59 Részletes @@ -451,7 +451,7 @@ Simplified app/ui/admin/admin.component.html - 56 + 60 Egyszerűsített @@ -459,7 +459,7 @@ Up time app/ui/admin/admin.component.html - 135 + 139 Szerver futás kezdete @@ -1926,11 +1926,19 @@ Videók + + Persons + + app/ui/settings/indexing/indexing.settings.component.html + 129 + + Emberek + Size app/ui/settings/indexing/indexing.settings.component.html - 129 + 133 Méret @@ -2822,4 +2830,4 @@ - \ No newline at end of file + diff --git a/src/frontend/translate/messages.ro.xlf b/src/frontend/translate/messages.ro.xlf index 2ac9c99a..d753f614 100644 --- a/src/frontend/translate/messages.ro.xlf +++ b/src/frontend/translate/messages.ro.xlf @@ -68,7 +68,7 @@ Remember me app/ui/login/login.component.html - 56 + 58 Reține-mă @@ -77,7 +77,7 @@ app/ui/login/login.component.html - 66 + 68 Autentificare @@ -419,7 +419,7 @@ app/ui/admin/admin.component.html - 30 + 34 Pentru a respinge aceste notificări, reporniți serverul. @@ -427,7 +427,7 @@ App version: app/ui/admin/admin.component.html - 43 + 47 Versiunea aplicației: @@ -435,7 +435,7 @@ Mode app/ui/admin/admin.component.html - 47 + 51 Mod @@ -443,7 +443,7 @@ Advanced app/ui/admin/admin.component.html - 55 + 59 Avansat @@ -451,7 +451,7 @@ Simplified app/ui/admin/admin.component.html - 56 + 60 Simplificat @@ -459,7 +459,7 @@ Up time app/ui/admin/admin.component.html - 135 + 139 Up time @@ -1926,11 +1926,19 @@ Videoclipuri + + Persons + + app/ui/settings/indexing/indexing.settings.component.html + 129 + + Persons + Size app/ui/settings/indexing/indexing.settings.component.html - 129 + 133 Dimensiuni diff --git a/src/frontend/translate/messages.ru.xlf b/src/frontend/translate/messages.ru.xlf index 4555a28f..2f72022d 100644 --- a/src/frontend/translate/messages.ru.xlf +++ b/src/frontend/translate/messages.ru.xlf @@ -68,7 +68,7 @@ Remember me app/ui/login/login.component.html - 56 + 58 Запомнить меня @@ -77,7 +77,7 @@ app/ui/login/login.component.html - 66 + 68 Войти @@ -419,7 +419,7 @@ app/ui/admin/admin.component.html - 30 + 34 Чтобы отключить эти уведомления, перезапустите сервер. @@ -427,7 +427,7 @@ App version: app/ui/admin/admin.component.html - 43 + 47 App version: @@ -435,7 +435,7 @@ Mode app/ui/admin/admin.component.html - 47 + 51 Режим @@ -443,7 +443,7 @@ Advanced app/ui/admin/admin.component.html - 55 + 59 Advanced @@ -451,7 +451,7 @@ Simplified app/ui/admin/admin.component.html - 56 + 60 Simplified @@ -459,7 +459,7 @@ Up time app/ui/admin/admin.component.html - 135 + 139 Up time @@ -1926,11 +1926,19 @@ Видео + + Persons + + app/ui/settings/indexing/indexing.settings.component.html + 129 + + Persons + Size app/ui/settings/indexing/indexing.settings.component.html - 129 + 133 Размер