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]
|
gameServers: [GameServer]
|
||||||
|
|
||||||
userCount: Int
|
userCount: Int
|
||||||
|
activeUserCount: Int
|
||||||
users(filter: UserFilter, page: Page, sort: Sort): [User]
|
users(filter: UserFilter, page: Page, sort: Sort): [User]
|
||||||
|
|
||||||
achievementCount: Int
|
achievementCount: Int
|
||||||
|
@ -76,6 +76,10 @@ class ServerQuery(DataQueryWithHistoryABC):
|
|||||||
lambda server, *_: self._levels.get_levels_by_server_id(server.id),
|
lambda server, *_: self._levels.get_levels_by_server_id(server.id),
|
||||||
LevelFilter,
|
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(
|
self.add_collection(
|
||||||
"user",
|
"user",
|
||||||
lambda server, *_: self._users.get_users_by_server_id(server.id),
|
lambda server, *_: self._users.get_users_by_server_id(server.id),
|
||||||
|
@ -23,6 +23,7 @@ export interface Server extends Data {
|
|||||||
levelCount?: number;
|
levelCount?: number;
|
||||||
levels?: Level[];
|
levels?: Level[];
|
||||||
userCount?: number;
|
userCount?: number;
|
||||||
|
activeUserCount?: number;
|
||||||
users?: User[];
|
users?: User[];
|
||||||
config?: ServerConfig;
|
config?: ServerConfig;
|
||||||
hasFeatureFlag?: FeatureFlag;
|
hasFeatureFlag?: FeatureFlag;
|
||||||
|
@ -68,6 +68,7 @@ export class Queries {
|
|||||||
name
|
name
|
||||||
iconURL
|
iconURL
|
||||||
userCount
|
userCount
|
||||||
|
activeUserCount
|
||||||
clients {
|
clients {
|
||||||
id
|
id
|
||||||
discordId
|
discordId
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
<i class="pi pi-users"></i>
|
<i class="pi pi-users"></i>
|
||||||
{{server.userCount}}
|
{{server.userCount}}
|
||||||
{{'view.dashboard.server.member_count' | translate}}
|
{{'view.dashboard.server.member_count' | translate}}
|
||||||
|
{{'view.dashboard.server.active_members' | translate}} {{server ? server.activeUserCount : ''}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="data">
|
<div class="data">
|
||||||
<i class="pi pi-users"></i>
|
<i class="pi pi-users"></i> {{server ? server.userCount : ''}}
|
||||||
{{server ? server.userCount : ''}}
|
|
||||||
{{'view.dashboard.server.member_count' | translate}}
|
{{'view.dashboard.server.member_count' | translate}}
|
||||||
|
{{'view.dashboard.server.active_members' | translate}} {{server ? server.activeUserCount : ''}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="client-data"
|
<div class="client-data"
|
||||||
|
@ -360,6 +360,7 @@
|
|||||||
},
|
},
|
||||||
"header": "Dashboard",
|
"header": "Dashboard",
|
||||||
"server": {
|
"server": {
|
||||||
|
"active_members": "davon aktiv:",
|
||||||
"header": "Server",
|
"header": "Server",
|
||||||
"member_count": "Mitglied(er)"
|
"member_count": "Mitglied(er)"
|
||||||
},
|
},
|
||||||
|
@ -360,6 +360,7 @@
|
|||||||
},
|
},
|
||||||
"header": "Dashboard",
|
"header": "Dashboard",
|
||||||
"server": {
|
"server": {
|
||||||
|
"active_members": "active:",
|
||||||
"header": "Server",
|
"header": "Server",
|
||||||
"member_count": "Member(s)"
|
"member_count": "Member(s)"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user