core: 比赛时自动隐藏题目标签

This commit is contained in:
undefined committed 2021-06-09 01:38:53 +08:00
1 parent 2b52930e9a
commit 2cc2c88b8a
7 files changed
+21 -12

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@
},
"devDependencies": {
"@types/js-yaml": "^4.0.1",
"@types/node": "^15.12.0"
"@types/node": "^15.12.2"
},
"peerDependencies": {
"hydrooj": "*"
+8 -1
View File
@@ -48,7 +48,14 @@ if (!cluster.isMaster) {
const arg1 = argv.args[1];
const arg2 = argv.args[2];
if (operation === 'addon') {
if (arg1 === 'add') addons.push(arg2);
if (arg1 === 'create') {
fs.mkdirSync('/root/addon');
child.execSync('yarn init -y', { cwd: '/root/addon' });
fs.mkdirSync('/root/addon/templates');
fs.mkdirSync('/root/addon/locales');
fs.mkdirSync('/root/addon/public');
addons.push('/root/addon');
} else if (arg1 === 'add') addons.push(arg2);
else if (arg1 === 'remove') {
for (let i = 0; i < addons.length; i++) {
if (addons[i] === arg2) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.28.24",
"version": "2.28.25",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+2
View File
@@ -76,6 +76,7 @@ export class ContestDetailHandler extends Handler {
];
const index = tdoc.pids.map((i) => i.toString());
for (const key in pdict) {
pdict[key].tag.length = 0;
const i = (index.indexOf(key) + 10).toString(36).toUpperCase();
if (i !== '9') pdict[key].pid = i;
}
@@ -265,6 +266,7 @@ export class ContestProblemHandler extends Handler {
]);
if (!this.pdoc) throw new ProblemNotFoundError(domainId, pid);
this.pdoc.pid = _pid;
this.pdoc.tag.length = 0;
// @ts-ignore
if (this.pdoc.domainId !== domainId) this.pdoc.docId = `${this.pdoc.domainId}:${this.pdoc.docId}`;
this.attended = this.tsdoc && this.tsdoc.attend === 1;
+2 -2
View File
@@ -39,9 +39,9 @@
"copy-webpack-plugin": "^6.4.1",
"css-loader": "^4.3.0",
"diff-dom": "^4.2.2",
"echarts": "^5.1.1",
"echarts": "^5.1.2",
"emojify.js": "^1.1.0",
"eslint": "^7.27.0",
"eslint": "^7.28.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-import-resolver-webpack": "^0.13.1",
"eslint-plugin-babel": "^5.3.1",
+1 -1
View File
@@ -16,7 +16,7 @@
},
"devDependencies": {
"@types/fs-extra": "^9.0.11",
"@types/node": "^15.12.0",
"@types/node": "^15.12.2",
"moment-timezone": "^0.5.33"
}
}