From fc7e350cf7fac805076fddc769966266f5805f01 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 27 Nov 2024 08:10:20 +0100 Subject: [PATCH] Feature/extend users table of admin control panel (#4076) * Extend users table * Update changelog --- CHANGELOG.md | 6 ++++++ apps/api/src/app/admin/admin.service.ts | 2 ++ .../admin-users/admin-users.component.ts | 1 + .../components/admin-users/admin-users.html | 21 +++++++++++++++++++ .../lib/interfaces/admin-users.interface.ts | 1 + 5 files changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31fe9d11f..bdd16fabc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Extended the users table in the admin control panel + ## 2.124.1 - 2024-11-25 ### Fixed diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 4abd47565..fb6e90f5d 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -705,6 +705,7 @@ export class AdminService { select: { activityCount: true, country: true, + dataProviderGhostfolioDailyRequests: true, updatedAt: true } }, @@ -740,6 +741,7 @@ export class AdminService { subscription, accountCount: _count.Account || 0, country: Analytics?.country, + dailyApiRequests: Analytics?.dataProviderGhostfolioDailyRequests || 0, lastActivity: Analytics?.updatedAt, transactionCount: _count.Order || 0 }; diff --git a/apps/client/src/app/components/admin-users/admin-users.component.ts b/apps/client/src/app/components/admin-users/admin-users.component.ts index 867593769..d619f4dd4 100644 --- a/apps/client/src/app/components/admin-users/admin-users.component.ts +++ b/apps/client/src/app/components/admin-users/admin-users.component.ts @@ -60,6 +60,7 @@ export class AdminUsersComponent implements OnDestroy, OnInit { 'accounts', 'activities', 'engagementPerDay', + 'dailyApiRequests', 'lastRequest', 'actions' ]; diff --git a/apps/client/src/app/components/admin-users/admin-users.html b/apps/client/src/app/components/admin-users/admin-users.html index 2c806684e..170b500ff 100644 --- a/apps/client/src/app/components/admin-users/admin-users.html +++ b/apps/client/src/app/components/admin-users/admin-users.html @@ -169,6 +169,27 @@ /> + + + API Requests Today + + + + + } @if (hasPermissionForSubscription) { diff --git a/libs/common/src/lib/interfaces/admin-users.interface.ts b/libs/common/src/lib/interfaces/admin-users.interface.ts index 8fde15e18..89e165752 100644 --- a/libs/common/src/lib/interfaces/admin-users.interface.ts +++ b/libs/common/src/lib/interfaces/admin-users.interface.ts @@ -6,6 +6,7 @@ export interface AdminUsers { accountCount: number; country: string; createdAt: Date; + dailyApiRequests: number; engagement: number; id: string; lastActivity: Date;