Fixed styling & added game server to profile #130

This commit is contained in:
Sven Heidemann 2023-02-18 13:37:03 +01:00
parent 6149825101
commit 610ce42fa2
16 changed files with 2190 additions and 2036 deletions

View File

@ -38,6 +38,10 @@ class UserJoinedGameServer(TableABC):
def game_server(self) -> str: def game_server(self) -> str:
return self._game_server return self._game_server
@property
def time(self) -> float:
return round((self.leaved_on - self.joined_on).total_seconds() / 3600, 2)
@property @property
def joined_on(self) -> datetime: def joined_on(self) -> datetime:
return self._joined_on return self._joined_on

View File

@ -2,6 +2,7 @@ type UserJoinedGameServer implements TableQuery {
id: ID id: ID
gameServer: String gameServer: String
user: User user: User
time: Float
joinedOn: String joinedOn: String
leavedOn: String leavedOn: String

View File

@ -28,6 +28,10 @@ class UserJoinedGameServerQuery(DataQueryABC):
def resolve_user(x: UserJoinedGameServer, *_): def resolve_user(x: UserJoinedGameServer, *_):
return x.user return x.user
@staticmethod
def resolve_time(x: UserJoinedGameServer, *_):
return x.time
@staticmethod @staticmethod
def resolve_joined_on(x: UserJoinedGameServer, *_): def resolve_joined_on(x: UserJoinedGameServer, *_):
return x.joined_on return x.joined_on

View File

@ -3,6 +3,7 @@ import { Level, LevelFilter } from "./level.model";
import { Server, ServerFilter } from "./server.model"; import { Server, ServerFilter } from "./server.model";
import { UserJoinedServer } from "./user_joined_server.model"; import { UserJoinedServer } from "./user_joined_server.model";
import { UserJoinedVoiceChannel } from "./user_joined_voice_channel.model"; import { UserJoinedVoiceChannel } from "./user_joined_voice_channel.model";
import { UserJoinedGameServer } from "./user_joined_game_server.model";
export interface User extends Data { export interface User extends Data {
id?: number; id?: number;
@ -22,7 +23,7 @@ export interface User extends Data {
joinedVoiceChannels?: UserJoinedVoiceChannel[]; joinedVoiceChannels?: UserJoinedVoiceChannel[];
userJoinedGameServerCount?: number; userJoinedGameServerCount?: number;
userJoinedGameServers?: []; userJoinedGameServers?: UserJoinedGameServer[];
} }
export interface UserFilter { export interface UserFilter {

View File

@ -0,0 +1,11 @@
import { Data } from "./data.model";
import { User } from "./user.model";
export interface UserJoinedGameServer extends Data {
id: number;
gameServer: string;
user: User;
time: number;
joinedOn: string;
leavedOn: string;
}

View File

@ -122,6 +122,7 @@ export class Queries {
userJoinedGameServers { userJoinedGameServers {
id id
gameServer gameServer
time
joinedOn joinedOn
leavedOn leavedOn
} }

View File

@ -224,7 +224,7 @@
<ng-template pTemplate="emptymessage"> <ng-template pTemplate="emptymessage">
<tr> <tr>
<td colspan="7">{{'admin.auth_users.no_entries_found' | translate}}</td> <td colspan="9">{{'admin.auth_users.no_entries_found' | translate}}</td>
</tr> </tr>
</ng-template> </ng-template>

View File

@ -19,6 +19,7 @@ import { AuthRolePipe } from './pipes/auth-role.pipe';
import { IpAddressPipe } from './pipes/ip-address.pipe'; import { IpAddressPipe } from './pipes/ip-address.pipe';
import { BoolPipe } from './pipes/bool.pipe'; import { BoolPipe } from './pipes/bool.pipe';
import { PanelMenuModule } from 'primeng/panelmenu'; import { PanelMenuModule } from 'primeng/panelmenu';
import { PanelModule } from "primeng/panel";
@ -47,6 +48,7 @@ import { PanelMenuModule } from 'primeng/panelmenu';
TranslateModule, TranslateModule,
DynamicDialogModule, DynamicDialogModule,
PanelMenuModule, PanelMenuModule,
PanelModule,
], ],
exports: [ exports: [
ButtonModule, ButtonModule,
@ -66,6 +68,7 @@ import { PanelMenuModule } from 'primeng/panelmenu';
TranslateModule, TranslateModule,
DynamicDialogModule, DynamicDialogModule,
PanelMenuModule, PanelMenuModule,
PanelModule,
AuthRolePipe, AuthRolePipe,
IpAddressPipe, IpAddressPipe,
BoolPipe, BoolPipe,

View File

@ -238,7 +238,7 @@
<ng-template pTemplate="emptymessage"> <ng-template pTemplate="emptymessage">
<tr></tr> <tr></tr>
<tr> <tr>
<td colspan="7">{{'view.server.members.no_entries_found' | translate}}</td> <td colspan="10">{{'view.server.members.no_entries_found' | translate}}</td>
</tr> </tr>
<tr></tr> <tr></tr>
</ng-template> </ng-template>

View File

@ -77,51 +77,73 @@
</div> </div>
<div class="content-divider"></div> <div class="content-divider"></div>
<div class="content-row">
<h3>{{'view.server.profile.joined_voice_channel.header' | translate}}</h3>
</div>
<div *ngFor="let join of user.joinedVoiceChannels;"> <p-panel header="{{'view.server.profile.joined_voice_channel.header' | translate}}" [toggleable]="true">
<div class="content-row"> <div *ngFor="let join of user.joinedVoiceChannels;">
<div class="content-column"> <div class="content-row">
<div class="content-data-name">{{'view.server.profile.joined_voice_channel.time' | translate}}:</div> <div class="content-column">
<div class="content-data-value">{{join.time}} {{'general.hours' | translate}}</div> <div class="content-data-name">{{'view.server.profile.joined_voice_channel.time' | translate}}:</div>
</div> <div class="content-data-value">{{join.time}} {{'general.hours' | translate}}</div>
</div>
<div class="content-column"> <div class="content-column">
<div class="content-data-name">{{'view.server.profile.joined_voice_channel.channel' | translate}}:</div> <div class="content-data-name">{{'view.server.profile.joined_voice_channel.channel' | translate}}:</div>
<div class="content-data-value">{{join.channelName}}</div> <div class="content-data-value">{{join.channelName}}</div>
</div> </div>
<div class="content-column"> <div class="content-column">
<div class="content-data-name">{{'view.server.profile.joined_voice_channel.joined_at' | translate}}:</div> <div class="content-data-name">{{'common.joined_at' | translate}}:</div>
<div class="content-data-value">{{join.joinedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div> <div class="content-data-value">{{join.joinedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div>
</div> </div>
<div class="content-column"> <div class="content-column">
<div class="content-data-name">{{'view.server.profile.joined_voice_channel.leaved_at' | translate}}:</div> <div class="content-data-name">{{'common.leaved_at' | translate}}:</div>
<div class="content-data-value">{{join.leavedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div> <div class="content-data-value">{{join.leavedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div>
</div>
</div> </div>
</div> </div>
</div>
<div class="content-divider"></div> </p-panel>
<div class="content-row"> <p-panel header="{{'view.server.profile.joined_game_server.header' | translate}}" [toggleable]="true">
<h3>{{'view.server.profile.joined_server.header' | translate}}</h3> <div *ngFor="let join of user.userJoinedGameServers;">
</div> <div class="content-row">
<div class="content-column">
<div class="content-data-name">{{'view.server.profile.joined_game_server.time' | translate}}:</div>
<div class="content-data-value">{{join.time}} {{'general.hours' | translate}}</div>
</div>
<div *ngFor="let join of user.joinedServers;"> <div class="content-column">
<div class="content-row"> <div class="content-data-name">{{'view.server.profile.joined_game_server.name' | translate}}:</div>
<div class="content-column"> <div class="content-data-value">{{join.gameServer}}</div>
<div class="content-data-name">{{'view.server.profile.joined_server.joined_at' | translate}}:</div> </div>
<div class="content-data-value">{{join.joinedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div>
</div>
<div class="content-column"> <div class="content-column">
<div class="content-data-name">{{'view.server.profile.joined_server.leaved_at' | translate}}:</div> <div class="content-data-name">{{'common.joined_at' | translate}}:</div>
<div class="content-data-value">{{join.leavedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div> <div class="content-data-value">{{join.joinedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div>
</div>
<div class="content-column">
<div class="content-data-name">{{'common.leaved_at' | translate}}:</div>
<div class="content-data-value">{{join.leavedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div>
</div>
</div> </div>
</div> </div>
</div> </p-panel>
<p-panel header="{{'view.server.profile.joined_server.header' | translate}}" [toggleable]="true">
<div *ngFor="let join of user.joinedServers;">
<div class="content-row">
<div class="content-column">
<div class="content-data-name">{{'common.joined_at' | translate}}:</div>
<div class="content-data-value">{{join.joinedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div>
</div>
<div class="content-column">
<div class="content-data-name">{{'common.leaved_at' | translate}}:</div>
<div class="content-data-value">{{join.leavedOn | date:'dd.MM.yyyy HH:mm:ss'}}</div>
</div>
</div>
</div>
</p-panel>
</div> </div>
</div> </div>

View File

@ -173,15 +173,16 @@
"joined_voice_channel": { "joined_voice_channel": {
"header": "Sprachkanal-beitritte", "header": "Sprachkanal-beitritte",
"time": "Zeit", "time": "Zeit",
"channel": "Sprachkanal", "channel": "Sprachkanal"
"joined_at": "Beigetreten am", },
"leaved_at": "Verlassen am" "joined_game_server": {
"header": "Gameserver-beitritte",
"time": "Spielzeit",
"name": "Gameserver"
}, },
"joined_server": { "joined_server": {
"header": "Server-beitritte", "header": "Server-beitritte",
"time": "Zeit", "time": "Zeit"
"joined_at": "Beigetreten am",
"leaved_at": "Verlassen am"
}, },
"permission_denied": "Zugriff Verweigert!", "permission_denied": "Zugriff Verweigert!",
"permission_denied_d": "Du musst Moderator sein, um andere Profile sehen zu können!" "permission_denied_d": "Du musst Moderator sein, um andere Profile sehen zu können!"
@ -264,6 +265,8 @@
"common": { "common": {
"created_at": "Erstellt am", "created_at": "Erstellt am",
"modified_at": "Bearbeitet am", "modified_at": "Bearbeitet am",
"joined_at": "Beigetreten am",
"leaved_at": "Verlassen am",
"bool_as_string": { "bool_as_string": {
"true": "Ja", "true": "Ja",
"false": "Nein" "false": "Nein"

View File

@ -152,6 +152,10 @@ header {
margin: 5px 0; margin: 5px 0;
} }
p-panel {
margin: 5px 0;
}
.content-input-field { .content-input-field {
width: 50% !important; width: 50% !important;
margin: 0 !important; margin: 0 !important;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff