Add application version to admin endpoint (#2423)

* Add application version to admin endpoint

* Update changelog
This commit is contained in:
Siddharth Singh 2023-10-04 19:45:08 +05:30 committed by GitHub
parent 692309988c
commit d9a6c22e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -5,12 +5,18 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- Added the application version to the endpoint `GET api/v1/admin`
## 2.8.0 - 2023-10-03 ## 2.8.0 - 2023-10-03
### Added ### Added
- Supported enter key press to submit the form of the create or update account dialog - Supported enter key press to submit the form of the create or update account dialog
- Added the version to the admin control panel - Added the application version to the admin control panel
- Added pagination parameters (`skip`, `take`) to the endpoint `GET api/v1/order` - Added pagination parameters (`skip`, `take`) to the endpoint `GET api/v1/order`
### Changed ### Changed

View File

@ -1,4 +1,5 @@
import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service'; import { SubscriptionService } from '@ghostfolio/api/app/subscription/subscription.service';
import { environment } from '@ghostfolio/api/environments/environment';
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { DataProviderService } from '@ghostfolio/api/services/data-provider/data-provider.service'; import { DataProviderService } from '@ghostfolio/api/services/data-provider/data-provider.service';
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service'; import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
@ -97,7 +98,8 @@ export class AdminService {
settings: await this.propertyService.get(), settings: await this.propertyService.get(),
transactionCount: await this.prismaService.order.count(), transactionCount: await this.prismaService.order.count(),
userCount: await this.prismaService.user.count(), userCount: await this.prismaService.user.count(),
users: await this.getUsersWithAnalytics() users: await this.getUsersWithAnalytics(),
version: environment.version
}; };
} }

View File

@ -12,4 +12,5 @@ export interface AdminData {
lastActivity: Date; lastActivity: Date;
transactionCount: number; transactionCount: number;
}[]; }[];
version: string;
} }