Skip to content

Commit

Permalink
truncating player's name in recent bans&mutes
Browse files Browse the repository at this point in the history
  • Loading branch information
originalaidn authored May 4, 2024
1 parent ee720f6 commit 0b5306c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions resources/js/dashboard/recent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function constructTableRows(data: any[]): string {
const progress = calculateProgress(item.created, item.ends);
html += `
<tr>
<td>${item.player_name}</td>
<td>${truncatePlayerName(item.player_name)}</td>
<td><a href="https://steamcommunity.com/profiles/${item.player_steamid}/">Profile</a></td>
<td>${formatDuration(item.created)}</td>
<td>${item.ends}</td>
Expand All @@ -50,7 +50,10 @@ function constructTableRows(data: any[]): string {
return html;
}





function truncatePlayerName(playerName: string): string {
if (playerName.length > 19) {
return playerName.substring(0, 16) + '...';
} else {
return playerName;
}
}

0 comments on commit 0b5306c

Please sign in to comment.