diff --git a/web/src/app/models/data/server.model.ts b/web/src/app/models/data/server.model.ts index 024a1a6e..9c9891c3 100644 --- a/web/src/app/models/data/server.model.ts +++ b/web/src/app/models/data/server.model.ts @@ -20,6 +20,7 @@ export interface Server extends Data { autoRoles?: AutoRole[]; clientCount?: number; clients?: Client[]; + statistic?: ServerStatistic; levelCount?: number; levels?: Level[]; userCount?: number; @@ -35,3 +36,16 @@ export interface ServerFilter { discordId?: String; name?: String; } + +export interface ServerStatistic { + achievementsAchieved?: Number + messageCount?: Number + userCount?: Number + activeUserCount?: Number + userJoinedVoiceChannelCount?: Number + userJoinedVoiceChannelOntime?: Number + userJoinedGameServerCount?: Number + userJoinedGameServerOntime?: Number + userWarningCount?: Number + activityScore?: Number +} diff --git a/web/src/app/models/graphql/queries.model.ts b/web/src/app/models/graphql/queries.model.ts index d16e94c1..1f6bb6a9 100644 --- a/web/src/app/models/graphql/queries.model.ts +++ b/web/src/app/models/graphql/queries.model.ts @@ -79,6 +79,18 @@ export class Queries { receivedCommandCount movedUsersCount } + statistic { + achievementsAchieved + messageCount + userCount + activeUserCount + userJoinedVoiceChannelCount + userJoinedVoiceChannelOntime + userJoinedGameServerCount + userJoinedGameServerOntime + userWarningCount + activityScore + } } } `; diff --git a/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.html b/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.html new file mode 100644 index 00000000..5721a2e8 --- /dev/null +++ b/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.html @@ -0,0 +1,35 @@ +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
diff --git a/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.scss b/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.spec.ts b/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.spec.ts new file mode 100644 index 00000000..d88c711b --- /dev/null +++ b/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ServerStatisticComponent } from './server-statistic.component'; + +describe('ServerStatisticComponent', () => { + let component: ServerStatisticComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ServerStatisticComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ServerStatisticComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.ts b/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.ts new file mode 100644 index 00000000..369d0e9b --- /dev/null +++ b/web/src/app/modules/view/server/server-dashboard/components/server-statistic/server-statistic.component.ts @@ -0,0 +1,22 @@ +import { Component, Input } from "@angular/core"; +import { ServerStatistic } from "../../../../../../models/data/server.model"; + +@Component({ + selector: 'app-server-statistic', + templateUrl: './server-statistic.component.html', + styleUrls: ['./server-statistic.component.scss'] +}) +export class ServerStatisticComponent { + @Input() stats?: ServerStatistic = { + achievementsAchieved: 0, + messageCount: 0, + userCount: 0, + activeUserCount: 0, + userJoinedVoiceChannelCount: 0, + userJoinedVoiceChannelOntime: 0, + userJoinedGameServerCount: 0, + userJoinedGameServerOntime: 0, + userWarningCount: 0, + activityScore: 0, + }; +} diff --git a/web/src/app/modules/view/server/server-dashboard/server-dashboard.component.html b/web/src/app/modules/view/server/server-dashboard/server-dashboard.component.html index 69fe099e..dfd2c275 100644 --- a/web/src/app/modules/view/server/server-dashboard/server-dashboard.component.html +++ b/web/src/app/modules/view/server/server-dashboard/server-dashboard.component.html @@ -28,6 +28,13 @@ {{'view.dashboard.server.active_members' | translate}} {{server ? server.activeUserCount : ''}} + +
+
+ +
+ +
diff --git a/web/src/app/modules/view/server/server.module.ts b/web/src/app/modules/view/server/server.module.ts index 5ac78d1c..d1810268 100644 --- a/web/src/app/modules/view/server/server.module.ts +++ b/web/src/app/modules/view/server/server.module.ts @@ -6,6 +6,7 @@ import { SharedModule } from "../../shared/shared.module"; import { ProfileComponent } from "./profile/profile.component"; import { MembersComponent } from "./members/members.component"; import { ClientComponent } from "./server-dashboard/components/client/client.component"; +import { ServerStatisticComponent } from './server-dashboard/components/server-statistic/server-statistic.component'; @NgModule({ @@ -14,6 +15,7 @@ import { ClientComponent } from "./server-dashboard/components/client/client.com ProfileComponent, MembersComponent, ClientComponent, + ServerStatisticComponent, ], imports: [ CommonModule, diff --git a/web/src/assets/i18n/de.json b/web/src/assets/i18n/de.json index aec55e53..471a0893 100644 --- a/web/src/assets/i18n/de.json +++ b/web/src/assets/i18n/de.json @@ -454,13 +454,21 @@ } }, "dashboard": { + "achievements_achieved": "Errungenschaften vergeben", + "activity_score": "Aktivitätsbewertung", "deleted_message_count": "Gelöschte Nachrichten", "header": "Server dashboard", + "message_count": "Anzahl Nachrichten", "moved_users_count": "Verschobene Benutzer", "name": "Name", "received_command_count": "Empfangene Befehle", "received_message_count": "Empfangene Nachrichten", - "sent_message_count": "Gesendete Nachrichten" + "sent_message_count": "Gesendete Nachrichten", + "user_joined_game_server_count": "Anzahl Gameserver beitritte", + "user_joined_game_server_ontime": "Gameserver Ontime", + "user_joined_voice_channel_count": "Anzahl Sprachkanal beitritte", + "user_joined_voice_channel_ontime": "Sprachkanal Ontime", + "user_warning_count": "Anzahl Verwarnungen" }, "header": "Server", "levels": { diff --git a/web/src/assets/i18n/en.json b/web/src/assets/i18n/en.json index a236d8e3..539f3570 100644 --- a/web/src/assets/i18n/en.json +++ b/web/src/assets/i18n/en.json @@ -454,13 +454,21 @@ } }, "dashboard": { + "achievements_achieved": "Achievements achieved", + "activity_score": "Activity score", "deleted_message_count": "Deleted messages", "header": "Server dashboard", + "message_count": "Message count", "moved_users_count": "Moved users", "name": "Name", "received_command_count": "Received commands", "received_message_count": "Received messages", - "sent_message_count": "Sent messages" + "sent_message_count": "Sent messages", + "user_joined_game_server_count": "Joined Gameserver count", + "user_joined_game_server_ontime": "Gameserver ontime", + "user_joined_voice_channel_count": "Joined voice channel count", + "user_joined_voice_channel_ontime": "Joined voice channel ontime", + "user_warning_count": "User warning count" }, "header": "Server", "levels": {