mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
update postInit api, add nav_logo opt
This commit is contained in:
1 parent
13e3e0ec98
commit
3eb593d134
16 files changed
+137
-47
No files matched your search
@@ -194,6 +194,7 @@ class HomeworkDetailProblemSubmitHandler extends HomeworkDetailProblemHandler {
|
||||
class HomeworkCreateHandler extends HomeworkHandler {
|
||||
async get() {
|
||||
const beginAt = moment().add(1, 'day');
|
||||
console.log(beginAt, beginAt.tz(this.user.timeZone));
|
||||
const penaltySince = beginAt.clone().add(7, 'days');
|
||||
const path = [
|
||||
['Hydro', 'homepage'],
|
||||
|
||||
+20
-4
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable camelcase */
|
||||
import { ObjectID } from 'mongodb';
|
||||
import { PRIV } from '../model/builtin';
|
||||
import * as system from '../model/system';
|
||||
@@ -74,18 +75,33 @@ class MarkdownHandler extends Handler {
|
||||
|
||||
class SockToken extends Handler {
|
||||
async get() {
|
||||
this.response.body = { token: this.csrfToken };
|
||||
this.response.body = { token: this.UIContext.token };
|
||||
}
|
||||
}
|
||||
|
||||
class UiSettingsHandler extends Handler {
|
||||
async get() {
|
||||
const [
|
||||
header, nav, headerBackground,
|
||||
header_logo, header_logo_2x,
|
||||
nav_logo_dark, nav_logo_light,
|
||||
nav_logo_dark_2x, nav_logo_light_2x,
|
||||
header_background, header_background_2x,
|
||||
] = await system.getMany([
|
||||
'ui.header', 'ui.nav', 'ui.headerBackground',
|
||||
'ui.header_logo', 'ui.header_logo_2x',
|
||||
'ui.nav_logo_dark', 'ui.nav_logo_light',
|
||||
'ui.nav_logo_dark_2x', 'ui.nav_logo_light_2x',
|
||||
'ui.headerBackground', 'ui.headerBackground2x',
|
||||
]);
|
||||
this.response.body = await this.renderHTML('extra.css', { header, nav, headerBackground });
|
||||
this.response.body = await this.renderHTML('extra.css', {
|
||||
header_logo,
|
||||
header_logo_2x,
|
||||
nav_logo_dark,
|
||||
nav_logo_light,
|
||||
nav_logo_dark_2x,
|
||||
nav_logo_light_2x,
|
||||
header_background,
|
||||
header_background_2x,
|
||||
});
|
||||
this.response.type = 'text/css';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user