core&ui: fix contest_edit file upload

This commit is contained in:
undefined committed 2026-02-28 02:22:07 +08:00
1 parent 3a5586cc5a
commit 2bad9d330d
11 files changed
+39 -22

No files matched your search

+2 -2
View File
@@ -60,10 +60,10 @@
"@types/fs-extra": "^11.0.4",
"@types/js-yaml": "^4.0.9",
"@types/koa-static-cache": "^5.1.4",
"@types/lodash": "^4.17.23",
"@types/lodash": "^4.17.24",
"@types/mime-types": "^3.0.1",
"@types/mongodb-uri": "^0.9.4",
"@types/nodemailer": "^7.0.10",
"@types/nodemailer": "^7.0.11",
"@types/notp": "^2.0.5",
"@types/semver": "^7.7.1",
"@types/superagent": "^8.1.9",
+7 -4
View File
@@ -538,7 +538,9 @@ export class ContestCodeHandler extends Handler {
export class ContestManagementHandler extends ContestManagementBaseHandler {
@param('tid', Types.ObjectId)
async get(domainId: string, tid: ObjectId) {
@param('d', Types.Range(['public', 'private']), true)
@param('sidebar', Types.Boolean)
async get(domainId: string, tid: ObjectId, d?: string, sidebar?: boolean) {
this.response.body = {
tdoc: this.tdoc,
tsdoc: this.tsdoc,
@@ -549,11 +551,12 @@ export class ContestManagementHandler extends ContestManagementBaseHandler {
urlForFile: (filename: string, type: string) => this.url('contest_file_download', { tid, filename, type }),
};
this.response.pjax = [
['partials/files.html', { filetype: 'public' }],
['partials/files.html', {
...((!d || d === 'public') ? [['partials/files.html', { filetype: 'public', sidebar }] as const] : []),
...((!d || d === 'private') ? [['partials/files.html', {
files: this.response.body.privateFiles,
filetype: 'private',
}],
sidebar,
}] as const] : []),
];
this.response.template = 'contest_manage.html';
}