mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
🆕 系统状态,修复题目复制
This commit is contained in:
1 parent
933dc73162
commit
3cb4d2ad49
19 files changed
+67
-30
No files matched your search
@@ -54,6 +54,7 @@ export async function load(call: Entry) {
|
||||
bus.subscribe(['system_database_connected'], h);
|
||||
require('../service/db');
|
||||
});
|
||||
require('../service/monitor');
|
||||
for (const i of builtinModel) require(`../model/${i}`);
|
||||
const modelSystem = require('../model/system');
|
||||
const dbVer = await modelSystem.get('db.ver');
|
||||
|
||||
@@ -199,6 +199,11 @@ class DomainJoinApplicationsHandler extends ManageHandler {
|
||||
if (!this.response.body.joinSettings) {
|
||||
delete this.response.body.expirations[domain.JOIN_EXPIRATION_KEEP_CURRENT];
|
||||
}
|
||||
this.response.body.path = [
|
||||
['Hydro', 'homepage'],
|
||||
['domain', null],
|
||||
['domain_join_applications', null],
|
||||
];
|
||||
this.response.template = 'domain_join_applications.html';
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class ProblemMainHandler extends ProblemHandler {
|
||||
}
|
||||
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) query.hidden = false;
|
||||
const [pdocs, ppcount, pcount] = await paginate(
|
||||
problem.getMulti(domainId, query).sort({ pid: 1 }),
|
||||
problem.getMulti(domainId, query).sort({ pid: 1, docId: 1 }),
|
||||
page,
|
||||
CONSTANT.PROBLEM_PER_PAGE,
|
||||
);
|
||||
@@ -119,7 +119,7 @@ class ProblemCategoryHandler extends ProblemHandler {
|
||||
let psdict = {};
|
||||
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) q.hidden = false;
|
||||
const [pdocs, ppcount, pcount] = await paginate(
|
||||
problem.getMulti(domainId, q).sort({ pid: 1 }),
|
||||
problem.getMulti(domainId, q).sort({ pid: 1, docId: 1 }),
|
||||
page,
|
||||
CONSTANT.PROBLEM_PER_PAGE,
|
||||
);
|
||||
@@ -190,7 +190,7 @@ class ProblemDetailHandler extends ProblemHandler {
|
||||
// eslint-disable-next-line
|
||||
async get(...args: any[]) { }
|
||||
|
||||
@param('pid', Types.ObjectID)
|
||||
@param('pid', Types.UnsignedInt)
|
||||
@param('dest', Types.String)
|
||||
@param('hidden', Types.Boolean)
|
||||
async postCopy(domainId: string, pid: number, destDomainId: string, hidden = false) {
|
||||
|
||||
@@ -192,7 +192,6 @@ PERM.PERM_DEFAULT = PERM.PERM_VIEW
|
||||
| PERM.PERM_EDIT_DISCUSSION_SELF
|
||||
| PERM.PERM_REPLY_DISCUSSION
|
||||
| PERM.PERM_EDIT_DISCUSSION_REPLY_SELF
|
||||
// PERM_EDIT_DISCUSSION_REPLY_SELF_DISCUSSION
|
||||
| PERM.PERM_DELETE_DISCUSSION_REPLY_SELF
|
||||
| PERM.PERM_DELETE_DISCUSSION_REPLY_SELF_DISCUSSION
|
||||
| PERM.PERM_VIEW_CONTEST
|
||||
@@ -206,7 +205,6 @@ PERM.PERM_DEFAULT = PERM.PERM_VIEW
|
||||
| PERM.PERM_VIEW_TRAINING
|
||||
| PERM.PERM_CREATE_TRAINING
|
||||
| PERM.PERM_EDIT_TRAINING_SELF
|
||||
| PERM.PERM_VIEW_RANKING
|
||||
| PERM.PERM_SUBMIT_PROBLEM
|
||||
| PERM.PERM_CREATE_PROBLEM_SOLUTION
|
||||
| PERM.PERM_VOTE_PROBLEM_SOLUTION
|
||||
|
||||
@@ -18,7 +18,7 @@ export function updateJudger(args) {
|
||||
args.type = 'judger';
|
||||
return coll.updateOne(
|
||||
{ mid: args.mid, type: 'judger' },
|
||||
{ $set: args },
|
||||
{ $set: { ...args, updateAt: new Date() } },
|
||||
{ upsert: true },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -326,6 +326,7 @@ export class Handler {
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
console.log(name, args);
|
||||
console.log(e.stack);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user