Skip to content

Commit

Permalink
feat: Add Challenge Scheduled Start
Browse files Browse the repository at this point in the history
总而言之, 就是早上起不来, 不能准点开题
  • Loading branch information
kengwang committed Aug 25, 2024
1 parent 1ad15ee commit 9f2d889
Show file tree
Hide file tree
Showing 10 changed files with 1,788 additions and 4 deletions.
20 changes: 20 additions & 0 deletions src/GZCTF/ClientApp/src/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,16 @@ export interface ChallengeEditDetailModel {
*/
difficulty: number;
canSubmit?: boolean;
/**
* 开始时间
* @format date-time
*/
enableAt?: string | null;
/**
* 结束时间
* @format date-time
*/
endAt?: string | null;
}

export enum ChallengeType {
Expand Down Expand Up @@ -1067,6 +1077,16 @@ export interface ChallengeUpdateModel {
isEnabled?: boolean | null;
/** 是否可提交 */
canSubmit?: boolean | null;
/**
* 开启时间
* @format date-time
*/
enableAt?: string | null;
/**
* 结束时间
* @format date-time
*/
endAt?: string | null;
/** 统一文件名 */
fileName?: string | null;
/** 镜像名称与标签 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
} from '@Utils/Shared'
import { useEditChallenge, useEditChallenges } from '@Utils/useEdit'
import api, { ChallengeTag, ChallengeType, ChallengeUpdateModel } from '@Api'
import {DateTimePicker} from "@mantine/dates";

const GameChallengeEdit: FC = () => {
const navigate = useNavigate()
Expand Down Expand Up @@ -323,6 +324,18 @@ const GameChallengeEdit: FC = () => {
onChange={(e) => setChallengeInfo({...challengeInfo, canSubmit: e.target.checked})}
checked={challengeInfo.canSubmit == true}
/>
<DateTimePicker
label="开始时间"
clearable
value={challengeInfo.enableAt == null ? null : new Date(challengeInfo.enableAt)}
onChange={(e) => setChallengeInfo({ ...challengeInfo, enableAt: e?.toISOString() })}
/>
<DateTimePicker
label="结束时间"
clearable
value={challengeInfo.endAt == null ? null : new Date(challengeInfo.endAt)}
onChange={(e) => setChallengeInfo({...challengeInfo, endAt: e?.toISOString()})}
/>
<HintList
label={
<Group gap="sm">
Expand Down
Loading

0 comments on commit 9f2d889

Please sign in to comment.