core: 支持显示时空限制 (#65)

虽然有点丑,但是能用
This commit is contained in:
undefined committed 2021-04-10 18:44:07 +08:00
1 parent d5c5b3fd47
commit 1c89596cb3
20 files changed
+84 -59

No files matched your search

+7
View File
@@ -11,6 +11,7 @@ import {
import paginate from '../lib/paginate';
import { isPid } from '../lib/validator';
import difficultyAlgorithm from '../lib/difficulty';
import { parseConfig } from '../lib/testdataConfig';
import * as system from '../model/system';
import problem from '../model/problem';
import record from '../model/record';
@@ -189,6 +190,12 @@ export class ProblemDetailHandler extends ProblemHandler {
// e.g. ![img](a.jpg) will navigate to ![img](./pid/file/a.jpg)
this.response.body.pdoc.content = this.response.body.pdoc.content
.replace(/\(file:\/\//g, `(./${this.pdoc.docId}/file/`);
// Get time and memory limit
try {
this.response.body.pdoc.config = await parseConfig(this.pdoc.config);
} catch (e) {
this.response.body.pdoc.config = `Cannot parse: ${e.message}`;
}
}
@param('pid', Types.UnsignedInt)