Skip to content

Commit

Permalink
fix: challenge card -> hint
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Aug 28, 2022
1 parent 6039239 commit 00bc869
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions GZCTF/ClientApp/src/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ export interface ChallengeEditDetailModel {
/** 题目类型 */
type: ChallengeType

/** 题目提示,用";"分隔 */
/** 题目提示 */
hints?: string[]

/** 是否启用题目 */
Expand Down Expand Up @@ -827,7 +827,7 @@ export interface ChallengeUpdateModel {
/** 题目标签 */
tag?: ChallengeTag | null

/** 题目提示,用";"分隔 */
/** 题目提示 */
hints?: string[] | null

/** 是否启用题目 */
Expand Down Expand Up @@ -1333,7 +1333,7 @@ export interface ChallengeDetailModel {
/** 题目标签 */
tag?: ChallengeTag

/** 题目提示,用";"分隔 */
/** 题目提示 */
hints?: string[] | null

/**
Expand Down
24 changes: 12 additions & 12 deletions GZCTF/ClientApp/src/components/ChallengeDetailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,18 @@ const ChallengeDetailModal: FC<ChallengeDetailModalProps> = (props) => {
<div dangerouslySetInnerHTML={{ __html: marked(challenge?.content ?? '') }} />
</TypographyStylesProvider>
</Group>
{challenge?.hints && challenge.hints.length > 0 && (
<Stack spacing={2}>
{challenge.hints.map((hint) => (
<Group spacing="xs" align="flex-start" noWrap>
<Icon path={mdiLightbulbOnOutline} size={0.8} color={theme.colors.yellow[5]} />
<Text key={hint} size="sm" style={{ maxWidth: 'calc(100% - 2rem)' }}>
{hint}
</Text>
</Group>
))}
</Stack>
)}
{isDynamic && !challenge?.context?.instanceEntry && (
<Group position="center" spacing={2}>
<Button onClick={onCreateContainer} disabled={disabled} loading={disabled}>
Expand Down Expand Up @@ -340,18 +352,6 @@ const ChallengeDetailModal: FC<ChallengeDetailModalProps> = (props) => {
</Group>
</Stack>
)}
{challenge?.hints && (
<Stack spacing={2}>
{challenge.hints.map((hint) => (
<Group spacing="xs" align="flex-start" noWrap>
<Icon path={mdiLightbulbOnOutline} size={0.8} color={theme.colors.yellow[5]} />
<Text key={hint} size="sm" style={{ maxWidth: 'calc(100% - 2rem)' }}>
{hint}
</Text>
</Group>
))}
</Stack>
)}
</Stack>
<Divider />
{solved ? (
Expand Down
2 changes: 1 addition & 1 deletion GZCTF/Models/Request/Edit/ChallengeEditDetailModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ChallengeEditDetailModel
public ChallengeType Type { get; set; } = ChallengeType.StaticAttachment;

/// <summary>
/// 题目提示,用";"分隔
/// 题目提示
/// </summary>
public string[] Hints { get; set; } = Array.Empty<string>();

Expand Down
4 changes: 2 additions & 2 deletions GZCTF/Models/Request/Edit/ChallengeUpdateModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ChallengeUpdateModel
public ChallengeTag? Tag { get; set; }

/// <summary>
/// 题目提示,用";"分隔
/// 题目提示
/// </summary>
public List<string>? Hints { get; set; }

Expand Down Expand Up @@ -82,4 +82,4 @@ public class ChallengeUpdateModel
/// 统一文件名
/// </summary>
public string? FileName { get; set; }
}
}
4 changes: 2 additions & 2 deletions GZCTF/Models/Request/Game/ChallengeDetailModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ChallengeDetailModel
public ChallengeTag Tag { get; set; } = ChallengeTag.Misc;

/// <summary>
/// 题目提示,用";"分隔
/// 题目提示
/// </summary>
public List<string>? Hints { get; set; }

Expand Down Expand Up @@ -82,4 +82,4 @@ public class ClientFlagContext
/// 附件 Url
/// </summary>
public string? Url { get; set; } = null;
}
}

0 comments on commit 00bc869

Please sign in to comment.