@ -325,6 +325,12 @@ app.post('/admin/other', async (req, res) => {
for (const a of articles) {
await a.resetReplyCountAndTime();
}
} else if (req.body.type === 'reset_codelen') {
const submissions = await JudgeState.query();
for (const s of submissions) {
s.code_length = s.code.length;
await s.save();
} else {
throw new ErrorMessage("操作类型不正确");
@ -3,6 +3,6 @@
<form method="post" class="ui form">
<p><button class="ui blue button" name="type" value="reset_count" type="submit">重新计算提交及 AC 数</button></p>
<p><button class="ui blue button" name="type" value="reset_discussion" type="submit">重新计算讨论版回复数和回复时间</button></p>
<!-- <button name="type" value="reset_size" type="submit">重新计算代码大小</button> -->
<p><button class="ui blue button" name="type" value="reset_codelen" type="submit">重新计算提交代码长度</button></p>
</form>
<% include admin_footer %>