Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/extend users table of admin control panel (#4076)

Thomas Kaulfc7e350cf7fa
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31fe9d11fd..bdd16fabca 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 4abd475659..fb6e90f5da 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 8675937698..d619f4dd41 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 2c806684e6..170b500ffd 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 @@
/>
</td>
</ng-container>
+ <ng-container matColumnDef="dailyApiRequests">
+ <th
+ *matHeaderCellDef
+ class="mat-mdc-header-cell px-1 py-2 text-right"
+ mat-header-cell
+ >
+ <ng-container i18n>API Requests Today</ng-container>
+ </th>
+ <td
+ *matCellDef="let element"
+ class="mat-mdc-cell px-1 py-2 text-right"
+ mat-cell
+ >
+ <gf-value
+ class="d-inline-block justify-content-end"
+ [locale]="user?.settings?.locale"
+ [precision]="0"
+ [value]="element.dailyApiRequests"
+ />
+ </td>
+ </ng-container>
}
@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 8fde15e18a..89e165752f 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;