mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: scoreboard
This commit is contained in:
1 parent
5c01cc44d8
commit
476457ac23
5 files changed
+9
-5
No files matched your search
+1
-1
@@ -294,7 +294,7 @@ apt-get -qq update && apt-get -q install -y mongodb-org`, { retry: true }],
|
||||
operations: [
|
||||
`echo "MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}\nMINIO_SECRET_KEY=${MINIO_SECRET_KEY}" >/root/.hydro/env`,
|
||||
`pm2 start "MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY} MINIO_SECRET_KEY=${MINIO_SECRET_KEY} minio server /data/file" --name minio`,
|
||||
'pm2 start "mongod --auth --bind_ip 0.0.0.0" --name mongodb',
|
||||
'pm2 start mongod --name mongodb -- --auth --bind_ip 0.0.0.0',
|
||||
() => sleep(1000),
|
||||
'pm2 start hydro-sandbox',
|
||||
'pm2 start hydrooj',
|
||||
|
||||
@@ -149,7 +149,7 @@ if (argv.args[0] === 'restore') {
|
||||
return;
|
||||
}
|
||||
exec('unzip', [argv.args[1], '-d', dir], { stdio: 'inherit' });
|
||||
exec('mongorestore', [`--uri=${url}`, `--dir=${dir}/dump/${JSON.parse(dbConfig).name}`, '--drop'], { stdio: 'inherit' });
|
||||
exec('mongorestore', [`--uri=${url}`, `--dir=${dir}/dump/hydro`, '--drop'], { stdio: 'inherit' });
|
||||
if (fs.existsSync(`${dir}/file`)) {
|
||||
exec('rm', ['-rf', '/data/file/*'], { stdio: 'inherit' });
|
||||
exec('bash', ['-c', `mv ${dir}/file/* /data/file`], { stdio: 'inherit' });
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.11.7",
|
||||
"version": "3.11.8",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -208,7 +208,7 @@ export class ContestScoreboardDownloadHandler extends Handler {
|
||||
async get(domainId: string, tid: ObjectID, ext: string, ignoreLock = false) {
|
||||
await this.limitRate('scoreboard_download', 120, 3);
|
||||
const getContent = {
|
||||
csv: async (rows) => `\uFEFF${rows.map((c) => (c.map((i) => i.value).join(','))).join('\n')}`,
|
||||
csv: async (rows) => `\uFEFF${rows.map((c) => (c.map((i) => i.value.replace(/\n/g, ' ')).join(','))).join('\n')}`,
|
||||
html: (rows, tdoc) => this.renderHTML('contest_scoreboard_download_html.html', { rows, tdoc }),
|
||||
};
|
||||
const tdoc = await contest.get(domainId, tid);
|
||||
|
||||
@@ -210,6 +210,10 @@ class HomeworkScoreboardHandler extends Handler {
|
||||
const [tdoc, rows, udict, , nPages] = await contest.getScoreboard.call(
|
||||
this, domainId, tid, false, page,
|
||||
);
|
||||
const pdict = await problem.getList(domainId, tdoc.pids, true, undefined, false, [
|
||||
// Problem statistics display is allowed as we can view submission info in scoreboard.
|
||||
...problem.PROJECTION_CONTEST_LIST, 'nSubmit', 'nAccept',
|
||||
]);
|
||||
const path = [
|
||||
['Hydro', 'homepage'],
|
||||
['homework_main', 'homework_main'],
|
||||
@@ -218,7 +222,7 @@ class HomeworkScoreboardHandler extends Handler {
|
||||
];
|
||||
this.response.template = 'contest_scoreboard.html';
|
||||
this.response.body = {
|
||||
tdoc, rows, path, udict, page, nPages, page_name: 'homework_scoreboard',
|
||||
tdoc, rows, path, udict, pdict, page, nPages, page_name: 'homework_scoreboard',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user