mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix pdoc get
This commit is contained in:
1 parent
30f82ae82b
commit
cb91c6ba71
4 files changed
+8
-8
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.21.16",
|
||||
"version": "2.21.17",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -266,10 +266,6 @@ class ContestProblemHandler extends ContestHandler {
|
||||
[this.tdoc.title, 'contest_detail', { tid: this.tdoc.docId }, true],
|
||||
[this.pdoc.title, null, null, true],
|
||||
];
|
||||
// Navigate to current additional file download
|
||||
// e.g.  will navigate to 
|
||||
this.response.body.pdoc.content = this.response.body.pdoc.content
|
||||
.replace(/\(file:\/\//g, `(./${this.pdoc.docId}/file/`);
|
||||
this.response.body = {
|
||||
tdoc: this.tdoc,
|
||||
pdoc: this.pdoc,
|
||||
@@ -279,6 +275,10 @@ class ContestProblemHandler extends ContestHandler {
|
||||
path,
|
||||
page_name: 'contest_detail_problem',
|
||||
};
|
||||
// Navigate to current additional file download
|
||||
// e.g.  will navigate to 
|
||||
this.response.body.pdoc.content = this.response.body.pdoc.content
|
||||
.replace(/\(file:\/\//g, `(./${this.pdoc.docId}/file/`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ export function errorMessage(err: Error | string) {
|
||||
for (let i = 0; i < q.length; i++) {
|
||||
if (!q[i].startsWith(' at')) continue;
|
||||
if (q[i].includes(`${sep}@hydrooj${sep}`)) q[i] = q[i].split(`@hydrooj${sep}`)[1];
|
||||
else if (q[i].includes(`${sep}hydrooj${sep}`)) q[i] = `hydrooj${sep}${q[i].split(`hydrooj/${sep}`)[1]}`;
|
||||
else if (q[i].includes(`${sep}hydrooj${sep}`)) q[i] = ` at hydrooj${sep}${q[i].split(`hydrooj${sep}`)[1]}`;
|
||||
}
|
||||
if (typeof err === 'string') return q.join('\n');
|
||||
err.stack = q.join('\n');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/utils",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "hydrooj utils",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
@@ -14,4 +14,4 @@
|
||||
"devDependencies": {
|
||||
"moment-timezone": "^0.5.33"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user