Feature/extend statistics section with users in slack community (#596)
* Extend statistics with users in Slack community * Update changelog
This commit is contained in:
parent
77065dac50
commit
6dcd801d05
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Added the date range component to the holdings tab
|
||||
|
||||
### Changed
|
||||
|
||||
- Extended the statistics section on the about page (users in Slack community)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed the creation of historical data in the admin control panel (upsert instead of update)
|
||||
|
@ -7,6 +7,7 @@ import { PrismaService } from '@ghostfolio/api/services/prisma.service';
|
||||
import { PropertyService } from '@ghostfolio/api/services/property/property.service';
|
||||
import {
|
||||
PROPERTY_IS_READ_ONLY_MODE,
|
||||
PROPERTY_SLACK_COMMUNITY_USERS,
|
||||
PROPERTY_STRIPE_CONFIG,
|
||||
PROPERTY_SYSTEM_MESSAGE
|
||||
} from '@ghostfolio/common/config';
|
||||
@ -187,6 +188,12 @@ export class InfoService {
|
||||
});
|
||||
}
|
||||
|
||||
private async countSlackCommunityUsers() {
|
||||
return (await this.propertyService.getByKey(
|
||||
PROPERTY_SLACK_COMMUNITY_USERS
|
||||
)) as string;
|
||||
}
|
||||
|
||||
private getDemoAuthToken() {
|
||||
return this.jwtService.sign({
|
||||
id: InfoService.DEMO_USER_ID
|
||||
@ -218,19 +225,19 @@ export class InfoService {
|
||||
} catch {}
|
||||
|
||||
const activeUsers1d = await this.countActiveUsers(1);
|
||||
const activeUsers7d = await this.countActiveUsers(7);
|
||||
const activeUsers30d = await this.countActiveUsers(30);
|
||||
const newUsers30d = await this.countNewUsers(30);
|
||||
const gitHubContributors = await this.countGitHubContributors();
|
||||
const gitHubStargazers = await this.countGitHubStargazers();
|
||||
const slackCommunityUsers = await this.countSlackCommunityUsers();
|
||||
|
||||
statistics = {
|
||||
activeUsers1d,
|
||||
activeUsers7d,
|
||||
activeUsers30d,
|
||||
gitHubContributors,
|
||||
gitHubStargazers,
|
||||
newUsers30d
|
||||
newUsers30d,
|
||||
slackCommunityUsers
|
||||
};
|
||||
|
||||
await this.redisCacheService.set(
|
||||
|
@ -35,8 +35,8 @@
|
||||
new feature, please join the Ghostfolio
|
||||
<a
|
||||
href="https://join.slack.com/t/ghostfolio/shared_invite/zt-vsaan64h-F_I0fEo5M0P88lP9ibCxFg"
|
||||
title="Join the Ghostfolio Slack channel"
|
||||
>Slack channel</a
|
||||
title="Join the Ghostfolio Slack community"
|
||||
>Slack community</a
|
||||
>, tweet to
|
||||
<a
|
||||
href="https://twitter.com/ghostfolio_"
|
||||
@ -108,12 +108,7 @@
|
||||
<mat-card-content>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4 my-2">
|
||||
<h3
|
||||
class="mb-0"
|
||||
[hidden]="statistics?.activeUsers1d === undefined"
|
||||
>
|
||||
{{ statistics?.activeUsers1d || '-' }}
|
||||
</h3>
|
||||
<h3 class="mb-0">{{ statistics?.activeUsers1d || '-' }}</h3>
|
||||
<div class="h6 mb-0">
|
||||
<span i18n>Active Users</span> <small class="text-muted"
|
||||
>(Last 24 hours)</small
|
||||
@ -121,35 +116,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 my-2">
|
||||
<h3
|
||||
class="mb-0"
|
||||
[hidden]="statistics?.activeUsers7d === undefined"
|
||||
>
|
||||
{{ statistics?.activeUsers7d ?? '-' }}
|
||||
</h3>
|
||||
<div class="h6 mb-0">
|
||||
<span i18n>Active Users</span> <small class="text-muted"
|
||||
>(Last 7 days)</small
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 my-2">
|
||||
<h3
|
||||
class="mb-0"
|
||||
[hidden]="statistics?.activeUsers30d === undefined"
|
||||
>
|
||||
{{ statistics?.activeUsers30d ?? '-' }}
|
||||
</h3>
|
||||
<div class="h6 mb-0">
|
||||
<span i18n>Active Users</span> <small class="text-muted"
|
||||
>(Last 30 days)</small
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 my-2">
|
||||
<h3 class="mb-0" [hidden]="statistics?.newUsers30d === undefined">
|
||||
{{ statistics?.newUsers30d ?? '-' }}
|
||||
</h3>
|
||||
<h3 class="mb-0">{{ statistics?.newUsers30d ?? '-' }}</h3>
|
||||
<div class="h6 mb-0">
|
||||
<span i18n>New Users</span> <small class="text-muted"
|
||||
>(Last 30 days)</small
|
||||
@ -157,21 +124,23 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 my-2">
|
||||
<h3
|
||||
class="mb-0"
|
||||
[hidden]="statistics?.gitHubContributors === undefined"
|
||||
>
|
||||
{{ statistics?.gitHubContributors ?? '-' }}
|
||||
</h3>
|
||||
<h3 class="mb-0">{{ statistics?.activeUsers30d ?? '-' }}</h3>
|
||||
<div class="h6 mb-0">
|
||||
<span i18n>Active Users</span> <small class="text-muted"
|
||||
>(Last 30 days)</small
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 my-2">
|
||||
<h3 class="mb-0">{{ statistics?.slackCommunityUsers ?? '-' }}</h3>
|
||||
<div class="h6 mb-0" i18n>Users in Slack community</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 my-2">
|
||||
<h3 class="mb-0">{{ statistics?.gitHubContributors ?? '-' }}</h3>
|
||||
<div class="h6 mb-0" i18n>Contributors on GitHub</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 my-2">
|
||||
<h3
|
||||
class="mb-0"
|
||||
[hidden]="statistics?.gitHubStargazers === undefined"
|
||||
>
|
||||
{{ statistics?.gitHubStargazers ?? '-' }}
|
||||
</h3>
|
||||
<h3 class="mb-0">{{ statistics?.gitHubStargazers ?? '-' }}</h3>
|
||||
<div class="h6 mb-0" i18n>Stars on GitHub</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -45,6 +45,7 @@ export const PROPERTY_CURRENCIES = 'CURRENCIES';
|
||||
export const PROPERTY_IS_READ_ONLY_MODE = 'IS_READ_ONLY_MODE';
|
||||
export const PROPERTY_LAST_DATA_GATHERING = 'LAST_DATA_GATHERING';
|
||||
export const PROPERTY_LOCKED_DATA_GATHERING = 'LOCKED_DATA_GATHERING';
|
||||
export const PROPERTY_SLACK_COMMUNITY_USERS = 'SLACK_COMMUNITY_USERS';
|
||||
export const PROPERTY_STRIPE_CONFIG = 'STRIPE_CONFIG';
|
||||
export const PROPERTY_SYSTEM_MESSAGE = 'SYSTEM_MESSAGE';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
export interface Statistics {
|
||||
activeUsers1d: number;
|
||||
activeUsers7d: number;
|
||||
activeUsers30d: number;
|
||||
gitHubContributors: number;
|
||||
gitHubStargazers: number;
|
||||
newUsers30d: number;
|
||||
slackCommunityUsers: string;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user