first commit.

This commit is contained in:
2023-01-04 10:20:18 +08:00
commit 919fcf5ba9
39 changed files with 4196 additions and 0 deletions

129
src/utils/constants.ts Normal file
View File

@@ -0,0 +1,129 @@
export const JUDGE_STATUS = {
"-2": {
name: "Compile Error",
short: "CE",
color: "yellow",
type: "warning",
},
"-1": {
name: "Wrong Answer",
short: "WA",
color: "red",
type: "error",
},
"0": {
name: "Accepted",
short: "AC",
color: "green",
type: "success",
},
"1": {
name: "Time Limit Exceeded",
short: "TLE",
color: "red",
type: "error",
},
"2": {
name: "Time Limit Exceeded",
short: "TLE",
color: "red",
type: "error",
},
"3": {
name: "Memory Limit Exceeded",
short: "MLE",
color: "red",
type: "error",
},
"4": {
name: "Runtime Error",
short: "RE",
color: "red",
type: "error",
},
"5": {
name: "System Error",
short: "SE",
color: "red",
type: "error",
},
"6": {
name: "Pending",
color: "yellow",
type: "warning",
},
"7": {
name: "Judging",
color: "blue",
type: "info",
},
"8": {
name: "Partial Accepted",
short: "PAC",
color: "blue",
type: "info",
},
"9": {
name: "Submitting",
color: "yellow",
type: "warning",
},
};
export const CONTEST_STATUS = {
NOT_START: "1",
UNDERWAY: "0",
ENDED: "-1",
};
export const CONTEST_STATUS_REVERSE = {
"1": {
name: "Not Started",
color: "yellow",
},
"0": {
name: "Underway",
color: "green",
},
"-1": {
name: "Ended",
color: "red",
},
};
export const RULE_TYPE = {
ACM: "ACM",
OI: "OI",
};
export const CONTEST_TYPE = {
PUBLIC: "Public",
PRIVATE: "Password Protected",
};
export const USER_TYPE = {
REGULAR_USER: "Regular User",
ADMIN: "Admin",
SUPER_ADMIN: "Super Admin",
};
export const PROBLEM_PERMISSION = {
NONE: "None",
OWN: "Own",
ALL: "All",
};
export const STORAGE_KEY = {
AUTHED: "authed",
PROBLEM_CODE: "problemCode",
USER: "user",
};
export function buildProblemCodeKey(problemID: number, contestID = null) {
if (contestID) {
return `${STORAGE_KEY.PROBLEM_CODE}_${contestID}_${problemID}`;
}
return `${STORAGE_KEY.PROBLEM_CODE}_NaN_${problemID}`;
}
export const GOOGLE_ANALYTICS_ID = "UA-111499601-1";