ui: file upload support

This commit is contained in:
undefined committed 2021-04-18 00:41:16 +08:00
1 parent 2539dfa412
commit 595f28b1df
5 files changed
+64 -22

No files matched your search

+2 -2
View File
@@ -21,8 +21,8 @@ export async function parseConfig(config: string | ProblemConfig = {}) {
let cfg: ProblemConfig = {};
if (typeof config === 'string' && config.length) {
// TODO should validate here?
cfg = await readYamlCases(load(config) as Record<string, any>) as ProblemConfig;
} else if (typeof config === 'object') cfg = config;
cfg = await readYamlCases(load(config) as Record<string, any>);
} else if (typeof config === 'object') cfg = await readYamlCases(config);
if (cfg.subtasks.length) {
for (const subtask of cfg.subtasks) {
result.memoryMax = Math.max(result.memoryMax, subtask.memory);