Skip to content

Commit 94c2f41

Browse files
committed
feat: show team bio on scoreboard
1 parent f53e00f commit 94c2f41

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

GZCTF/ClientApp/src/Api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,8 @@ export interface ScoreboardItem {
10871087
id?: number
10881088
/** 队伍名称 */
10891089
name?: string
1090+
/** 队伍 Bio */
1091+
bio?: string | null
10901092
/** 参赛所属组织 */
10911093
organization?: string | null
10921094
/** 队伍头像 */

GZCTF/ClientApp/src/components/ScoreboardItemModal.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
LoadingOverlay,
1414
Avatar,
1515
Title,
16+
Badge,
1617
} from '@mantine/core'
1718
import { BloodsTypes, BonusLabel } from '@Utils/ChallengeItem'
1819
import { useTableStyles } from '@Utils/ThemeOverride'
@@ -69,14 +70,19 @@ const ScoreboardItemModal: FC<ScoreboardItemModalProps> = (props) => {
6970
{item?.name?.slice(0, 1) ?? 'T'}
7071
</Avatar>
7172
<Stack spacing={0}>
72-
<Title order={4} lineClamp={1}>
73-
{item?.name ?? 'Team'}
74-
</Title>
75-
{item?.organization && (
76-
<Text size="sm" lineClamp={1}>
77-
{item.organization}
78-
</Text>
79-
)}
73+
<Group spacing={4}>
74+
<Title order={4} lineClamp={1}>
75+
{item?.name ?? 'Team'}
76+
</Title>
77+
{item?.organization && (
78+
<Badge size="sm" variant="outline">
79+
{item.organization}
80+
</Badge>
81+
)}
82+
</Group>
83+
<Text size="sm" lineClamp={1}>
84+
{item?.bio ?? '这只队伍很懒,什么都没留下'}
85+
</Text>
8086
</Stack>
8187
</Group>
8288
}

GZCTF/Models/Request/Game/ScoreboardModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ public partial class ScoreboardItem
8787
/// </summary>
8888
public string Name { get; set; } = string.Empty;
8989

90+
/// <summary>
91+
/// 队伍 Bio
92+
/// </summary>
93+
public string? Bio { get; set; } = string.Empty;
94+
9095
/// <summary>
9196
/// 参赛所属组织
9297
/// </summary>

GZCTF/Repositories/GameRepository.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ private static IEnumerable<ScoreboardItem> GenScoreboardItems(Data[] data, Game
165165
return new ScoreboardItem
166166
{
167167
Id = j.Key.Team.Id,
168+
Bio = j.Key.Team.Bio,
168169
Name = j.Key.Team.Name,
169170
Avatar = j.Key.Team.AvatarUrl,
170171
Organization = j.Key.Organization,

0 commit comments

Comments
 (0)