mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
rp;
This commit is contained in:
1 parent
51dc2e972d
commit
43ee86d34b
17 files changed
+177
-88
No files matched your search
@@ -13,7 +13,7 @@ class DomainRankHandler extends Handler {
|
||||
@param('page', Types.UnsignedInt, true)
|
||||
async get(domainId: string, page = 1) {
|
||||
const [dudocs, upcount, ucount] = await paginate(
|
||||
domain.getMultiInDomain(domainId).sort({ rating: -1 }),
|
||||
domain.getMultiInDomain(domainId).sort({ rp: -1 }),
|
||||
page,
|
||||
100,
|
||||
);
|
||||
|
||||
@@ -95,7 +95,7 @@ class SystemScriptHandler extends SystemHandler {
|
||||
validate(global.Hydro.script[id].validate, args);
|
||||
const rid = await record.add(domainId, -1, this.user._id, '-', id, false, { input: 'raw' });
|
||||
const report = (data) => judge.next({ domainId, rid, ...data });
|
||||
report({ message: `Running script: ${id}` });
|
||||
report({ message: `Running script: ${id}`, status: STATUS.STATUS_JUDGING });
|
||||
const start = new Date().getTime();
|
||||
// Maybe async?
|
||||
global.Hydro.script[id].run(args, report)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ObjectID } from 'mongodb';
|
||||
import { PermissionError } from '../error';
|
||||
import { PermissionError, RecordNotFoundError } from '../error';
|
||||
import { PERM } from '../model/builtin';
|
||||
import * as problem from '../model/problem';
|
||||
import * as record from '../model/record';
|
||||
@@ -63,6 +63,7 @@ class RecordDetailHandler extends RecordHandler {
|
||||
async get(domainId: string, rid: ObjectID) {
|
||||
this.response.template = 'record_detail.html';
|
||||
const rdoc = await record.get(domainId, rid);
|
||||
if (!rdoc) throw new RecordNotFoundError(rid);
|
||||
if (rdoc.contest) {
|
||||
const tdoc = await contest.get(domainId, rdoc.contest.tid, rdoc.contest.type);
|
||||
if (!this.canShowRecord(tdoc, true)) throw new PermissionError(rid);
|
||||
@@ -71,7 +72,7 @@ class RecordDetailHandler extends RecordHandler {
|
||||
rdoc.code = null;
|
||||
}
|
||||
const [pdoc, udoc] = await Promise.all([
|
||||
problem.get(domainId, rdoc.pid, null),
|
||||
problem.get(domainId, rdoc.pid),
|
||||
user.getById(domainId, rdoc.uid),
|
||||
]);
|
||||
this.response.body = {
|
||||
|
||||
Reference in new issue
Block a user