mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: category: allow using '+'
This commit is contained in:
1 parent
fcb06284e4
commit
dd21f74ad2
9 files changed
+26
-26
No files matched your search
+6
-6
@@ -31,27 +31,27 @@
|
|||||||
"@shelf/jest-mongodb": "^1.2.5",
|
"@shelf/jest-mongodb": "^1.2.5",
|
||||||
"@types/cross-spawn": "^6.0.2",
|
"@types/cross-spawn": "^6.0.2",
|
||||||
"@types/jest": "^26.0.23",
|
"@types/jest": "^26.0.23",
|
||||||
"@types/node": "^15.12.4",
|
"@types/node": "^15.12.5",
|
||||||
"@types/semver": "^7.3.6",
|
"@types/semver": "^7.3.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.26.1",
|
"@typescript-eslint/eslint-plugin": "^4.28.0",
|
||||||
"@typescript-eslint/parser": "^4.26.1",
|
"@typescript-eslint/parser": "^4.28.0",
|
||||||
"cac": "^6.7.3",
|
"cac": "^6.7.3",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
"eslint": "^7.28.0",
|
"eslint": "^7.29.0",
|
||||||
"eslint-config-airbnb-typescript": "^12.3.1",
|
"eslint-config-airbnb-typescript": "^12.3.1",
|
||||||
"eslint-import-resolver-typescript": "^2.4.0",
|
"eslint-import-resolver-typescript": "^2.4.0",
|
||||||
"eslint-plugin-import": "^2.23.4",
|
"eslint-plugin-import": "^2.23.4",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.0",
|
||||||
"globby": "^11.0.4",
|
"globby": "^11.0.4",
|
||||||
"jest": "^27.0.4",
|
"jest": "^27.0.5",
|
||||||
"latest-version": "^5.1.0",
|
"latest-version": "^5.1.0",
|
||||||
"mongodb": "^3.6.9",
|
"mongodb": "^3.6.9",
|
||||||
"nmls": "^3.0.1",
|
"nmls": "^3.0.1",
|
||||||
"ora": "^5.4.1",
|
"ora": "^5.4.1",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.5",
|
||||||
"ts-jest": "^27.0.3",
|
"ts-jest": "^27.0.3",
|
||||||
"typedoc": "^0.20.37",
|
"typedoc": "^0.21.2",
|
||||||
"typescript": "4.2.4"
|
"typescript": "4.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/js-yaml": "^4.0.1",
|
"@types/js-yaml": "^4.0.1",
|
||||||
"@types/node": "^15.12.4"
|
"@types/node": "^15.12.5"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"hydrooj": "*"
|
"hydrooj": "*"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
"mongodb": "^3.6.9",
|
"mongodb": "^3.6.9",
|
||||||
"p-queue": "^6.6.2",
|
"p-queue": "^6.6.2",
|
||||||
"shell-quote": "^1.7.2",
|
"shell-quote": "^1.7.2",
|
||||||
"ws": "^7.4.6"
|
"ws": "^7.5.0"
|
||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.28.57",
|
"version": "2.28.58",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
Route, Handler, Types, param, post, route, query,
|
Route, Handler, Types, param, post, route, query,
|
||||||
} from '../service/server';
|
} from '../service/server';
|
||||||
|
|
||||||
export const parseCategory = (value: string) => flatten(value.replace(/,/g, ',').split('+').map((e) => e.split(','))).map((e) => e.trim());
|
export const parseCategory = (value: string) => flatten(value.replace(/,/g, ',').split(',')).map((e) => e.trim());
|
||||||
export const parsePid = (value: string) => (isSafeInteger(value) ? +value : value);
|
export const parsePid = (value: string) => (isSafeInteger(value) ? +value : value);
|
||||||
|
|
||||||
export class ProblemHandler extends Handler {
|
export class ProblemHandler extends Handler {
|
||||||
@@ -70,7 +70,7 @@ export class ProblemMainHandler extends ProblemHandler {
|
|||||||
for (const tag of category) query.$and.push({ tag });
|
for (const tag of category) query.$and.push({ tag });
|
||||||
}
|
}
|
||||||
if (q) category.push(q);
|
if (q) category.push(q);
|
||||||
if (category.length) this.extraTitleContent = category.join('+');
|
if (category.length) this.extraTitleContent = category.join(',');
|
||||||
if (q) {
|
if (q) {
|
||||||
if (search) {
|
if (search) {
|
||||||
const result = await search(domainId, q);
|
const result = await search(domainId, q);
|
||||||
@@ -99,7 +99,7 @@ export class ProblemMainHandler extends ProblemHandler {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.response.body = {
|
this.response.body = {
|
||||||
page, pcount, ppcount, pdocs, psdict, category: category.join('+'),
|
page, pcount, ppcount, pdocs, psdict, category: category.join(','),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ws": "^7.4.6"
|
"ws": "^7.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/ws": "^7.4.5"
|
"@types/ws": "^7.4.5"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.14.5",
|
"@babel/cli": "^7.14.5",
|
||||||
"@babel/core": "^7.14.6",
|
"@babel/core": "^7.14.6",
|
||||||
"@babel/eslint-parser": "7.14.5",
|
"@babel/eslint-parser": "7.14.7",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
||||||
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
|
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
|
||||||
"@babel/plugin-proposal-function-sent": "^7.14.5",
|
"@babel/plugin-proposal-function-sent": "^7.14.5",
|
||||||
@@ -19,13 +19,13 @@
|
|||||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||||
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
||||||
"@babel/plugin-transform-runtime": "^7.14.5",
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
||||||
"@babel/preset-env": "^7.14.5",
|
"@babel/preset-env": "^7.14.7",
|
||||||
"@babel/preset-react": "^7.14.5",
|
"@babel/preset-react": "^7.14.5",
|
||||||
"@babel/register": "^7.14.5",
|
"@babel/register": "^7.14.5",
|
||||||
"@babel/runtime-corejs3": "^7.14.6",
|
"@babel/runtime-corejs3": "^7.14.7",
|
||||||
"@blueprintjs/core": "^3.45.0",
|
"@blueprintjs/core": "^3.46.0",
|
||||||
"@blueprintjs/icons": "^3.26.1",
|
"@blueprintjs/icons": "^3.27.0",
|
||||||
"@blueprintjs/select": "^3.16.4",
|
"@blueprintjs/select": "^3.16.5",
|
||||||
"@hydrooj/utils": "workspace:*",
|
"@hydrooj/utils": "workspace:*",
|
||||||
"@types/json-schema": "^7.0.7",
|
"@types/json-schema": "^7.0.7",
|
||||||
"@types/katex": "^0.11.0",
|
"@types/katex": "^0.11.0",
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"diff-dom": "^4.2.2",
|
"diff-dom": "^4.2.2",
|
||||||
"echarts": "^5.1.2",
|
"echarts": "^5.1.2",
|
||||||
"emojify.js": "^1.1.0",
|
"emojify.js": "^1.1.0",
|
||||||
"eslint": "^7.28.0",
|
"eslint": "^7.29.0",
|
||||||
"eslint-config-airbnb": "^18.2.1",
|
"eslint-config-airbnb": "^18.2.1",
|
||||||
"eslint-import-resolver-webpack": "^0.13.1",
|
"eslint-import-resolver-webpack": "^0.13.1",
|
||||||
"eslint-plugin-babel": "^5.3.1",
|
"eslint-plugin-babel": "^5.3.1",
|
||||||
@@ -66,19 +66,19 @@
|
|||||||
"jquery-scroll-lock": "^3.1.3",
|
"jquery-scroll-lock": "^3.1.3",
|
||||||
"jquery.easing": "^1.4.1",
|
"jquery.easing": "^1.4.1",
|
||||||
"jquery.transit": "^0.9.12",
|
"jquery.transit": "^0.9.12",
|
||||||
"mini-css-extract-plugin": "^1.6.0",
|
"mini-css-extract-plugin": "^1.6.1",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"monaco-editor": "^0.24.0",
|
"monaco-editor": "^0.25.2",
|
||||||
"monaco-editor-webpack-plugin": "^3.1.0",
|
"monaco-editor-webpack-plugin": "^3.1.0",
|
||||||
"nanoid": "^3.1.23",
|
"nanoid": "^3.1.23",
|
||||||
"normalize.css": "^8.0.1",
|
"normalize.css": "^8.0.1",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"optimize-css-assets-webpack-plugin": "^5.0.6",
|
"optimize-css-assets-webpack-plugin": "^5.0.8",
|
||||||
"pickadate": "^3.6.4",
|
"pickadate": "^3.6.4",
|
||||||
"plugin-error": "^1.0.1",
|
"plugin-error": "^1.0.1",
|
||||||
"postcss-loader": "^3.0.0",
|
"postcss-loader": "^3.0.0",
|
||||||
"prism-themes": "^1.7.0",
|
"prism-themes": "^1.7.0",
|
||||||
"prismjs": "^1.23.0",
|
"prismjs": "^1.24.0",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/fs-extra": "^9.0.11",
|
"@types/fs-extra": "^9.0.11",
|
||||||
"@types/node": "^15.12.4",
|
"@types/node": "^15.12.5",
|
||||||
"moment-timezone": "^0.5.33"
|
"moment-timezone": "^0.5.33"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"superagent-proxy": "^2.1.0"
|
"superagent-proxy": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jsdom": "^16.2.11",
|
"@types/jsdom": "^16.2.12",
|
||||||
"@types/superagent-proxy": "^2.0.0"
|
"@types/superagent-proxy": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user