add website config.

This commit is contained in:
2023-04-03 13:31:00 +08:00
parent 70a4b67b58
commit b6ae429052
6 changed files with 286 additions and 5 deletions

View File

@@ -4,8 +4,10 @@ import {
BlankContest,
BlankProblem,
Contest,
Server,
TestcaseUploadedReturns,
User,
WebsiteConfig,
} from "~/utils/types"
export function getBaseInfo() {
@@ -149,3 +151,27 @@ export function addProblemForContest(
display_id: displayID,
})
}
export function getWebsite() {
return http.get<WebsiteConfig>("admin/website")
}
export function editWebsite(data: WebsiteConfig) {
return http.post("admin/website", data)
}
export function listInvalidTestcases() {
return http.get("admin/prune_test_case")
}
export function pruneInvalidTestcases(id?: string) {
return http.delete("admin/prune_test_case", { params: { id } })
}
export function getJudgeServer() {
return http.get<{ token: string; servers: Server[] }>("admin/judge_server")
}
export function deleteJudgeServer(hostname: string) {
return http.delete("admin/judge_server", { params: { hostname } })
}