mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
upgrade katex to 0.12, wiki load
This commit is contained in:
1 parent
3b9910529e
commit
bf29661eaa
18 files changed
+189
-54
No files matched your search
@@ -35,9 +35,10 @@ class RecordListHandler extends RecordHandler {
|
||||
page,
|
||||
await system.get('RECORD_PER_PAGE'),
|
||||
);
|
||||
const canViewProblemHidden = this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN);
|
||||
const [udict, pdict] = await Promise.all([
|
||||
user.getList(domainId, rdocs.map((rdoc) => rdoc.uid)),
|
||||
problem.getList(domainId, rdocs.map((rdoc) => rdoc.pid), false, false),
|
||||
problem.getList(domainId, rdocs.map((rdoc) => rdoc.pid), canViewProblemHidden, false),
|
||||
]);
|
||||
const path = [
|
||||
['Hydro', 'homepage'],
|
||||
@@ -100,7 +101,7 @@ class RecordRejudgeHandler extends Handler {
|
||||
const RecordConnectionHandler = contest.ContestHandlerMixin(ConnectionHandler);
|
||||
|
||||
class RecordMainConnectionHandler extends RecordConnectionHandler {
|
||||
@param('tid', Types.ObjectID)
|
||||
@param('tid', Types.ObjectID, true)
|
||||
async prepare(domainId: string, tid: ObjectID) {
|
||||
this.domainId = domainId;
|
||||
if (tid) {
|
||||
|
||||
@@ -10,13 +10,14 @@ class WikiHandler extends Handler {
|
||||
if (!global.Hydro.wiki[category]) throw new NotFoundError(category);
|
||||
if (!global.Hydro.wiki[category][page]) throw new NotFoundError(category, page);
|
||||
const contents = global.Hydro.wiki[category][page];
|
||||
const pages = Object.keys(global.Hydro.wiki[category]);
|
||||
const path = [
|
||||
['Hydro', 'homepage'],
|
||||
[`wiki_${category}`, null],
|
||||
[`wiki_${category}_${page}`, null],
|
||||
];
|
||||
this.response.body = {
|
||||
path, contents, page_name: `wiki_${category}_${page}`,
|
||||
path, contents, pages, page_name: `wiki_${category}_${page}`,
|
||||
};
|
||||
this.response.template = 'wiki.html';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user