hydrojudge intergration

This commit is contained in:
undefined committed 2020-08-09 19:02:03 +08:00
1 parent 2a09213f5d
commit 6b88570bd6
24 files changed
+1719 -9

No files matched your search

+12 -6
View File
@@ -193,12 +193,13 @@ class DomainJoinApplicationsHandler extends ManageHandler {
async get() {
const r = await domain.getRoles(this.domain);
const roles = r.map((role) => role._id).sort();
const rolesWithText = roles.map((role) => [role, role]);
const joinSettings = domain.getJoinSettings(this.domain, roles);
const expirations = { ...domain.JOIN_EXPIRATION_RANGE };
if (!joinSettings) delete expirations[domain.JOIN_EXPIRATION_KEEP_CURRENT];
this.response.body.rolesWithText = roles.map((role) => [role, role]);
this.response.body.joinSettings = domain.getJoinSettings(this.domain, roles);
this.response.body.expirations = { ...domain.JOIN_EXPIRATION_RANGE };
if (!this.response.body.joinSettings) {
delete this.response.body.expirations[domain.JOIN_EXPIRATION_KEEP_CURRENT];
}
this.response.template = 'domain_join_applications.html';
this.response.body = { rolesWithText, joinSettings, expirations };
}
@param('method', Types.UnsignedInt)
@@ -243,7 +244,12 @@ class DomainJoinHandler extends Handler {
@param('code', Types.String, true)
async get(domainId: string, code: string) {
this.response.template = 'domain_join.html';
this.response.body = { joinSettings: this.joinSettings, code };
this.response.body.joinSettings = this.joinSettings;
this.response.body.code = code;
this.response.body.path = [
['Hydro', 'homepage'],
['domain_join', 'domain_join', { domainId, code }],
];
}
@param('code', Types.String, true)
+1 -1
View File
@@ -1,4 +1,4 @@
import { ObjectID, PushOperator, MatchKeysAndValues } from 'mongodb';
import { ObjectID } from 'mongodb';
import { JudgeResultBody, Rdoc, TestCase } from '../interface';
import * as record from '../model/record';
import * as problem from '../model/problem';