Added active member count #413
All checks were successful
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 6m38s
All checks were successful
Deploy dev on push / on-push-deploy_sh-edraft (push) Successful in 6m38s
This commit is contained in:
parent
665e524aa9
commit
8e55ebc4b7
@ -26,6 +26,7 @@ type Server implements TableWithHistoryQuery {
|
||||
gameServers: [GameServer]
|
||||
|
||||
userCount: Int
|
||||
activeUserCount: Int
|
||||
users(filter: UserFilter, page: Page, sort: Sort): [User]
|
||||
|
||||
achievementCount: Int
|
||||
|
@ -76,6 +76,10 @@ class ServerQuery(DataQueryWithHistoryABC):
|
||||
lambda server, *_: self._levels.get_levels_by_server_id(server.id),
|
||||
LevelFilter,
|
||||
)
|
||||
self.set_field(
|
||||
"activeUserCount",
|
||||
lambda server, *_: self._users.get_users_by_server_id(server.id).where(lambda x: not x.left_server).count(),
|
||||
)
|
||||
self.add_collection(
|
||||
"user",
|
||||
lambda server, *_: self._users.get_users_by_server_id(server.id),
|
||||
|
@ -23,6 +23,7 @@ export interface Server extends Data {
|
||||
levelCount?: number;
|
||||
levels?: Level[];
|
||||
userCount?: number;
|
||||
activeUserCount?: number;
|
||||
users?: User[];
|
||||
config?: ServerConfig;
|
||||
hasFeatureFlag?: FeatureFlag;
|
||||
|
@ -68,6 +68,7 @@ export class Queries {
|
||||
name
|
||||
iconURL
|
||||
userCount
|
||||
activeUserCount
|
||||
clients {
|
||||
id
|
||||
discordId
|
||||
|
@ -40,6 +40,7 @@
|
||||
<i class="pi pi-users"></i>
|
||||
{{server.userCount}}
|
||||
{{'view.dashboard.server.member_count' | translate}}
|
||||
{{'view.dashboard.server.active_members' | translate}} {{server ? server.activeUserCount : ''}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -23,9 +23,9 @@
|
||||
</h3>
|
||||
|
||||
<div class="data">
|
||||
<i class="pi pi-users"></i>
|
||||
{{server ? server.userCount : ''}}
|
||||
<i class="pi pi-users"></i> {{server ? server.userCount : ''}}
|
||||
{{'view.dashboard.server.member_count' | translate}}
|
||||
{{'view.dashboard.server.active_members' | translate}} {{server ? server.activeUserCount : ''}}
|
||||
</div>
|
||||
|
||||
<div class="client-data"
|
||||
|
@ -360,6 +360,7 @@
|
||||
},
|
||||
"header": "Dashboard",
|
||||
"server": {
|
||||
"active_members": "davon aktiv:",
|
||||
"header": "Server",
|
||||
"member_count": "Mitglied(er)"
|
||||
},
|
||||
|
@ -360,6 +360,7 @@
|
||||
},
|
||||
"header": "Dashboard",
|
||||
"server": {
|
||||
"active_members": "active:",
|
||||
"header": "Server",
|
||||
"member_count": "Member(s)"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user