mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: fix contest problem ref
This commit is contained in:
1 parent
7a9dc95377
commit
715e564971
8 files changed
+10
-14
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.28.17",
|
"version": "2.28.18",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ export class ContestDetailHandler extends Handler {
|
|||||||
['contest_main', 'contest_main'],
|
['contest_main', 'contest_main'],
|
||||||
[tdoc.title, null, null, true],
|
[tdoc.title, null, null, true],
|
||||||
];
|
];
|
||||||
|
const index = tdoc.pids.map((i) => i.toString());
|
||||||
for (const key in pdict) {
|
for (const key in pdict) {
|
||||||
// @ts-ignore
|
const i = (index.indexOf(key) + 10).toString(36).toUpperCase();
|
||||||
if (pdict[key].domainId !== domainId) pdict[key].docId = `${pdict[key].domainId}:${pdict[key].docId}`;
|
if (i !== '9') pdict[key].pid = i;
|
||||||
pdict[key].pid = (tdoc.pids.indexOf(pdict[key].docId) + 10).toString(36).toUpperCase();
|
|
||||||
}
|
}
|
||||||
this.response.body = {
|
this.response.body = {
|
||||||
path, tdoc, tsdoc, attended, udict, pdict, psdict, rdict, page,
|
path, tdoc, tsdoc, attended, udict, pdict, psdict, rdict, page,
|
||||||
|
|||||||
@@ -90,10 +90,10 @@ class HomeworkDetailHandler extends Handler {
|
|||||||
['homework_main', 'homework_main'],
|
['homework_main', 'homework_main'],
|
||||||
[tdoc.title, null, null, true],
|
[tdoc.title, null, null, true],
|
||||||
];
|
];
|
||||||
|
const index = tdoc.pids.map((i) => i.toString());
|
||||||
for (const key in pdict) {
|
for (const key in pdict) {
|
||||||
// @ts-ignore
|
const i = (index.indexOf(key) + 10).toString(36).toUpperCase();
|
||||||
if (pdict[key].domainId !== domainId) pdict[key].docId = `${pdict[key].domainId}:${pdict[key].docId}`;
|
if (i !== '9') pdict[key].pid = i;
|
||||||
pdict[key].pid = (tdoc.pids.indexOf(pdict[key].docId) + 10).toString(36).toUpperCase();
|
|
||||||
}
|
}
|
||||||
this.response.template = 'homework_detail.html';
|
this.response.template = 'homework_detail.html';
|
||||||
this.response.body = {
|
this.response.body = {
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ export async function parseConfig(config: string | ProblemConfigFile = {}) {
|
|||||||
result.timeMax = result.timeMin = 1000;
|
result.timeMax = result.timeMin = 1000;
|
||||||
}
|
}
|
||||||
if (cfg.langs) result.langs = cfg.langs;
|
if (cfg.langs) result.langs = cfg.langs;
|
||||||
console.log(result);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import cache from 'koa-static-cache';
|
|||||||
import sockjs from 'sockjs';
|
import sockjs from 'sockjs';
|
||||||
import cac from 'cac';
|
import cac from 'cac';
|
||||||
import { createHash } from 'crypto';
|
import { createHash } from 'crypto';
|
||||||
import type { SetOption } from 'cookies';
|
|
||||||
import * as bus from './bus';
|
import * as bus from './bus';
|
||||||
import { errorMessage } from '../utils';
|
import { errorMessage } from '../utils';
|
||||||
import { User, DomainDoc } from '../interface';
|
import { User, DomainDoc } from '../interface';
|
||||||
@@ -611,7 +610,7 @@ export class Handler extends HandlerCommon {
|
|||||||
} else {
|
} else {
|
||||||
[, this.session] = await token.add(token.TYPE_SESSION, expireSeconds, { ...this.session, ...$update, ...$create });
|
[, this.session] = await token.add(token.TYPE_SESSION, expireSeconds, { ...this.session, ...$update, ...$create });
|
||||||
}
|
}
|
||||||
const cookie: SetOption = {
|
const cookie = {
|
||||||
secure: !!system.get('session.secure'),
|
secure: !!system.get('session.secure'),
|
||||||
httpOnly: false,
|
httpOnly: false,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.11.9",
|
"version": "4.11.10",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -40,12 +40,10 @@ const page = new NamedPage('user_detail', async () => {
|
|||||||
toolbox: {
|
toolbox: {
|
||||||
right: 10,
|
right: 10,
|
||||||
feature: {
|
feature: {
|
||||||
dataZoom: { yAxisIndex: 'none' },
|
|
||||||
restore: {},
|
restore: {},
|
||||||
saveAsImage: {},
|
saveAsImage: {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dataZoom: [{ type: 'inside' }],
|
|
||||||
visualMap: {
|
visualMap: {
|
||||||
show: false,
|
show: false,
|
||||||
pieces: [{
|
pieces: [{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
{{ set(UiContext, 'postSubmitUrl', url('contest_detail_problem_submit' if tdoc.docType == model.document.TYPE_CONTEST else 'homework_detail_problem_submit', pid=pdoc.pid, tid=tdoc.docId)) }}
|
{{ set(UiContext, 'postSubmitUrl', url('contest_detail_problem_submit' if tdoc.docType == model.document.TYPE_CONTEST else 'homework_detail_problem_submit', pid=pdoc.pid, tid=tdoc.docId)) }}
|
||||||
{{ set(UiContext, 'getSubmissionsUrl', url('contest_detail_problem_submit' if tdoc.docType == model.document.TYPE_CONTEST else 'homework_detail_problem_submit', pid=pdoc.pid, tid=tdoc.docId)) }}
|
{{ set(UiContext, 'getSubmissionsUrl', url('contest_detail_problem_submit' if tdoc.docType == model.document.TYPE_CONTEST else 'homework_detail_problem_submit', pid=pdoc.pid, tid=tdoc.docId)) }}
|
||||||
{{ set(UiContext, 'getRecordDetailUrl', url('record_detail', rid='{rid}', query={tid:tdoc.docId})) }}
|
{{ set(UiContext, 'getRecordDetailUrl', url('record_detail', rid='{rid}', query={tid:tdoc.docId})) }}
|
||||||
{{ set(UiContext, 'pretestConnUrl', "/record-conn?pretest=1&uid=" + handler.user._id + "&pid=" + pdoc.docId + "&domainId=" + handler.domainId + "&tid=" + tdoc.docId) }}
|
{{ set(UiContext, 'pretestConnUrl', "/record-conn?pretest=1&uid=" + handler.user._id + "&pid=" + pdoc.domainId + ":" + pdoc.docId + "&domainId=" + handler.domainId + "&tid=" + tdoc.docId) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ set(UiContext, 'canViewRecord', true) }}
|
{{ set(UiContext, 'canViewRecord', true) }}
|
||||||
{{ set(UiContext, 'postSubmitUrl', url('problem_submit', pid=pdoc.docId)) }}
|
{{ set(UiContext, 'postSubmitUrl', url('problem_submit', pid=pdoc.docId)) }}
|
||||||
|
|||||||
Reference in new issue
Block a user