mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
hydrojudge intergration
This commit is contained in:
1 parent
2a09213f5d
commit
6b88570bd6
24 files changed
+1719
-9
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user