mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix allDomain
This commit is contained in:
1 parent
6385a7355b
commit
33b9b0b048
7 files changed
+21
-10
No files matched your search
@@ -0,0 +1,6 @@
|
||||
hydro.ac {
|
||||
reverse_proxy http://localhost:8888 {
|
||||
header_up x-real-ip {remote_host}
|
||||
header_up x-real-host {hostport}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.32.20",
|
||||
"version": "2.32.21",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -34,18 +34,21 @@ export async function postJudge(rdoc: RecordDoc) {
|
||||
const pdoc = (accept && updated)
|
||||
? await problem.inc(rdoc.pdomain, rdoc.pid, 'nAccept', 1)
|
||||
: await problem.get(rdoc.pdomain, rdoc.pid);
|
||||
const difficulty = difficultyAlgorithm(pdoc.nSubmit, pdoc.nAccept);
|
||||
await Promise.all([
|
||||
problem.edit(pdoc.domainId, pdoc.docId, { difficulty }),
|
||||
problem.inc(pdoc.domainId, pdoc.docId, `stats.${builtin.STATUS_SHORT_TEXTS[rdoc.status]}`, 1),
|
||||
problem.inc(pdoc.domainId, pdoc.docId, `stats.s${rdoc.score}`, 1),
|
||||
]);
|
||||
if (pdoc) {
|
||||
const difficulty = difficultyAlgorithm(pdoc.nSubmit, pdoc.nAccept);
|
||||
await Promise.all([
|
||||
problem.edit(pdoc.domainId, pdoc.docId, { difficulty }),
|
||||
problem.inc(pdoc.domainId, pdoc.docId, `stats.${builtin.STATUS_SHORT_TEXTS[rdoc.status]}`, 1),
|
||||
problem.inc(pdoc.domainId, pdoc.docId, `stats.s${rdoc.score}`, 1),
|
||||
]);
|
||||
}
|
||||
await bus.serial('record/judge', rdoc, updated);
|
||||
}
|
||||
|
||||
export async function next(body: JudgeResultBody) {
|
||||
body.rid = new ObjectID(body.rid);
|
||||
let rdoc = await record.get(body.rid);
|
||||
if (!rdoc) return;
|
||||
const $set: Partial<RecordDoc> = {};
|
||||
const $push: any = {};
|
||||
if (body.case) {
|
||||
@@ -72,7 +75,7 @@ export async function next(body: JudgeResultBody) {
|
||||
if (body.memory !== undefined) $set.memory = body.memory;
|
||||
if (body.progress !== undefined) $set.progress = body.progress;
|
||||
rdoc = await record.update(rdoc.domainId, body.rid, $set, $push);
|
||||
bus.broadcast('record/change', rdoc, $set, $push);
|
||||
bus.broadcast('record/change', rdoc!, $set, $push);
|
||||
}
|
||||
|
||||
export async function end(body: JudgeResultBody) {
|
||||
|
||||
@@ -141,7 +141,7 @@ class RecordModel {
|
||||
}
|
||||
|
||||
static getMulti(domainId: string, query: any) {
|
||||
return RecordModel.coll.find({ ...query, domainId });
|
||||
return RecordModel.coll.find({ domainId, ...query });
|
||||
}
|
||||
|
||||
static async update(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.17.4",
|
||||
"version": "4.17.5",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -22,6 +22,7 @@ const page = new NamedPage('record_main', async () => {
|
||||
$oldTr.trigger('vjContentNew');
|
||||
} else {
|
||||
$('.record_main__table tbody').prepend($newTr);
|
||||
$('.record_main__table tbody tr:last').remove();
|
||||
$newTr.trigger('vjContentNew');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
{% else %}
|
||||
*
|
||||
{% endif %}
|
||||
{% if rdoc.input %}({{ _('Pretest') }}){% endif %}
|
||||
</td>
|
||||
<td class="col--submit-by">
|
||||
<a href="{{ url('user_detail', uid=rdoc.uid) }}">
|
||||
|
||||
Reference in new issue
Block a user