|
|
@ -103,11 +103,24 @@ app.get('/submissions', async (req, res) => { |
|
|
|
isFiltered = true; |
|
|
|
isFiltered = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const queryResult = await JudgeState.queryPageWithLargeData(query, syzoj.utils.paginateLargeData( |
|
|
|
let judge_state, paginate; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (syzoj.config.submissions_page_fast_pagination) { |
|
|
|
|
|
|
|
const queryResult = await JudgeState.queryPageFast(query, syzoj.utils.paginateFast( |
|
|
|
req.query.currPageTop, req.query.currPageBottom, syzoj.config.page.judge_state |
|
|
|
req.query.currPageTop, req.query.currPageBottom, syzoj.config.page.judge_state |
|
|
|
), -1, parseInt(req.query.page)); |
|
|
|
), -1, parseInt(req.query.page)); |
|
|
|
|
|
|
|
|
|
|
|
const judge_state = queryResult.data; |
|
|
|
judge_state = queryResult.data; |
|
|
|
|
|
|
|
paginate = queryResult.meta; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
paginate = syzoj.utils.paginate( |
|
|
|
|
|
|
|
await JudgeState.countQuery(query), |
|
|
|
|
|
|
|
req.query.page, |
|
|
|
|
|
|
|
syzoj.config.page.judge_state |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
judge_state = await JudgeState.queryPage(paginate, query, { id: "DESC" }, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
await judge_state.forEachAsync(async obj => { |
|
|
|
await judge_state.forEachAsync(async obj => { |
|
|
|
await obj.loadRelationships(); |
|
|
|
await obj.loadRelationships(); |
|
|
|
if (obj.problem.type !== 'submit-answer') obj.code_length = Buffer.from(obj.code).length; |
|
|
|
if (obj.problem.type !== 'submit-answer') obj.code_length = Buffer.from(obj.code).length; |
|
|
@ -124,11 +137,12 @@ app.get('/submissions', async (req, res) => { |
|
|
|
result: getRoughResult(x, displayConfig, true), |
|
|
|
result: getRoughResult(x, displayConfig, true), |
|
|
|
running: false, |
|
|
|
running: false, |
|
|
|
})), |
|
|
|
})), |
|
|
|
paginate: queryResult.meta, |
|
|
|
paginate: paginate, |
|
|
|
pushType: 'rough', |
|
|
|
pushType: 'rough', |
|
|
|
form: req.query, |
|
|
|
form: req.query, |
|
|
|
displayConfig: displayConfig, |
|
|
|
displayConfig: displayConfig, |
|
|
|
isFiltered: isFiltered |
|
|
|
isFiltered: isFiltered, |
|
|
|
|
|
|
|
fast_pagination: syzoj.config.submissions_page_fast_pagination |
|
|
|
}); |
|
|
|
}); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
syzoj.log(e); |
|
|
|
syzoj.log(e); |
|
|
|