Compare commits

..

No commits in common. "43b75b8e746dbe3ece19672a5a3e91957efd8d1d" and "d54a7e51ee1424feaf6ceca22aa16524d609b4ac" have entirely different histories.

3 changed files with 20 additions and 5 deletions

View File

@ -32,7 +32,7 @@ export class HistoryFormatService {
public getExpiredTime(entry: PunishmentHistory): string {
let suffix: string = '';
if (entry.removedBy !== null && entry.removedBy !== undefined) {
suffix = '(Unbanned by ' + entry.removedBy + ')';
suffix = '(' + entry.removedBy + ')';
}
if (entry.expiryTime <= 0) {
return "Permanent " + this.getType(entry) + " " + suffix;

View File

@ -22,14 +22,14 @@
<td class="historyType" (click)="showDetailedPunishment(entry)">
{{ this.historyFormat.getType(entry) }}
</td>
<td class="historyPlayer" (click)="setSearch(entry.username, 'player')">
<td class="historyPlayer" (click)="setSearch(entry.type, entry.username, 'player')">
<div class="playerContainer">
<img class="avatar" [ngSrc]="this.historyFormat.getAvatarUrl(entry.uuid)" width="25" height="25"
alt="{{entry.username}}'s Minecraft skin">
<span class="username">{{ entry.username }}</span>
</div>
</td>
<td class="historyPlayer" (click)="setSearch(entry.punishedBy, 'staff')">
<td class="historyPlayer" (click)="setSearch(entry.type, entry.punishedBy, 'staff')">
<div class="playerContainer">
<img class="avatar" [ngSrc]="this.historyFormat.getAvatarUrl(entry.punishedByUuid)" width="25" height="25"
alt="{{entry.punishedBy}}'s Minecraft skin">

View File

@ -93,10 +93,25 @@ export class HistoryComponent implements OnInit, OnChanges {
).subscribe();
}
setSearch(name: string, userType: 'player' | 'staff') {
setSearch(type: PunishmentHistory.TypeEnum, name: string, userType: 'player' | 'staff') {
let punishmentType: 'all' | 'ban' | 'mute' | 'kick' | 'warn' = 'all';
switch (type) {
case 'ban':
punishmentType = 'ban';
break;
case 'mute':
punishmentType = 'mute';
break;
case 'kick':
punishmentType = 'kick';
break;
case 'warn':
punishmentType = 'warn';
break;
}
let searchParams: SearchParams = {
userType: userType,
punishmentType: 'all',
punishmentType: punishmentType,
searchTerm: name
}
this.selectItem.emit(searchParams);