Merge branch 'master' into training-maintainer

This commit is contained in:
panda authored and GitHub committed 2023-07-10 01:09:19 +08:00
commit 3876d4c5e7
14 files changed
+69 -53

No files matched your search

+9 -1
View File
@@ -105,11 +105,19 @@ Telegram [@webpack_exports_undefined](https://t.me/webpack_exports_undefined)
<details>
<summary><h2>更新日志(点击展开)</h2></summary>
### Hydro 4.9.21 / UI 4.48.21
- core: 修复 strictioi 比赛计分
- ui: 修复已参加训练列表显示
- core: 在比赛开始前禁用计分板
- ui: 在添加用户到域的时候隐藏 default 和 guest 选项
- core: 允许管理员筛选所有小组
- ui: 修复语言过滤(#598)
- ui: 修复讨论 reaction
### Hydro 4.9.20 / UI 4.48.20
- vjudge: 修复 Codeforces 提交结果获取
- core: 优化系统自检功能
- vjudge: 支持 detail 设置(#582)
- ui: 修复语言过滤(#598)
- ui: 禁用视频自动播放
- install: 支持安装时自动从 UOJ 导入数据
- ui: 修复 preferredPrefix 功能异常的问题
+3 -1
View File
@@ -283,7 +283,9 @@ const printInfo = [
'echo https://qm.qq.com/cgi-bin/qm/qr\\?k\\=0aTZfDKURRhPBZVpTYBohYG6P6sxABTw | qrencode -o - -m 2 -t UTF8',
() => {
if (installAsJudge) return;
password = new URL(require(`${process.env.HOME}/.hydro/config.json`).uri).password || '(No password)';
const config = require(`${process.env.HOME}/.hydro/config.json`);
if (config.uri) password = new URL(config.uri).password || '(No password)';
else password = config.password || '(No password)';
log.info('extra.dbUser');
log.info('extra.dbPassword', password);
},
+7 -7
View File
@@ -32,7 +32,7 @@
"license": "AGPL-3.0-only",
"devDependencies": {
"@simplewebauthn/typescript-types": "^7.0.0",
"@types/autocannon": "^7.9.0",
"@types/autocannon": "^7.9.1",
"@types/cross-spawn": "^6.0.2",
"@types/node": "^18.16.16",
"@types/semver": "^7.5.0",
@@ -47,7 +47,7 @@
"css-loader": "^6.8.1",
"esbuild": "0.17.10",
"esbuild-loader": "^2.21.0",
"eslint": "^8.42.0",
"eslint": "^8.44.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-import-resolver-webpack": "^0.13.2",
"fs-extra": "^11.1.1",
@@ -56,20 +56,20 @@
"latest-version": "7.0.0",
"mini-css-extract-plugin": "^2.7.6",
"monaco-editor-webpack-plugin": "^7.0.1",
"mongodb": "^5.6.0",
"mongodb": "^5.7.0",
"mongodb-memory-server": "^8.13.0",
"nyc": "^15.1.0",
"ora": "^6.3.1",
"postcss-loader": "7.3.2",
"semver": "^7.5.3",
"simple-git": "^3.19.0",
"semver": "^7.5.4",
"simple-git": "^3.19.1",
"style-loader": "^3.3.3",
"stylus": "^0.59.0",
"stylus-loader": "7.1.2",
"supertest": "^6.3.3",
"ts-loader": "^9.4.3",
"ts-loader": "^9.4.4",
"typescript": "5.0.2",
"webpack": "^5.88.0",
"webpack": "^5.88.1",
"webpack-bundle-analyzer": "^4.9.0",
"webpack-dev-server": "^4.15.1",
"webpack-manifest-plugin": "^5.0.0",
+1 -1
View File
@@ -11,6 +11,6 @@
},
"dependencies": {
"crypto-js": "^4.1.1",
"semver": "^7.5.3"
"semver": "^7.5.4"
}
}
+2 -2
View File
@@ -4,8 +4,8 @@
"license": "MIT",
"main": "react.yaml",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "2.27.5",
+2 -2
View File
@@ -8,9 +8,9 @@
"dependencies": {
"@hydrooj/utils": "workspace:*",
"cac": "^6.7.14",
"mongodb": "^5.6.0",
"mongodb": "^5.7.0",
"p-queue": "^7.3.4",
"schemastery": "^3.10.0",
"schemastery": "^3.10.1",
"shell-quote": "^1.8.1",
"superagent": "^8.0.9",
"ws": "^8.13.0"
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "4.9.20",
"version": "4.9.21",
"bin": "bin/hydrooj.js",
"main": "src/plugin-api",
"module": "src/plugin-api",
@@ -12,17 +12,17 @@
},
"preferUnplugged": true,
"dependencies": {
"@aws-sdk/client-s3": "^3.358.0",
"@aws-sdk/lib-storage": "^3.358.0",
"@aws-sdk/middleware-endpoint": "^3.357.0",
"@aws-sdk/s3-presigned-post": "^3.358.0",
"@aws-sdk/s3-request-presigner": "^3.358.0",
"@aws-sdk/client-s3": "3.357.0",
"@aws-sdk/lib-storage": "3.357.0",
"@aws-sdk/middleware-endpoint": "3.357.0",
"@aws-sdk/s3-presigned-post": "3.357.0",
"@aws-sdk/s3-request-presigner": "3.357.0",
"@graphql-tools/schema": "^10.0.0",
"@hydrooj/utils": "workspace:*",
"@simplewebauthn/server": "^7.3.1",
"adm-zip": "0.5.5",
"cac": "^6.7.14",
"cordis": "^2.8.0",
"cordis": "^2.8.2",
"detect-browser": "^5.3.0",
"emoji-regex": "^10.2.1",
"emojis-list": "2.1.0",
@@ -40,7 +40,7 @@
"lru-cache": "^9.1.2",
"mime-types": "^2.1.35",
"moment-timezone": "^0.5.43",
"mongodb": "^5.6.0",
"mongodb": "^5.7.0",
"nanoid": "^4.0.2",
"nodemailer": "^6.9.3",
"notp": "^2.0.3",
@@ -48,8 +48,8 @@
"path-to-regexp": "^6.2.1",
"require-resolve-hook": "^1.1.0",
"saslprep": "^1.0.3",
"schemastery": "^3.10.0",
"semver": "^7.5.3",
"schemastery": "^3.10.1",
"semver": "^7.5.4",
"serialize-javascript": "^6.0.1",
"superagent": "^8.0.9",
"tar": "^6.1.15",
+6 -2
View File
@@ -77,8 +77,12 @@ class ImportQduojHandler extends Handler {
});
}
if (+pdoc.display_id) pdoc.display_id = `P${pdoc.display_id}`;
const n = await ProblemModel.get(domainId, pdoc.display_id);
if (n) pdoc.display_id = null;
const isValidPid = async (id: string) => {
if (!(/^[A-Za-z]+[0-9A-Za-z]*$/.test(id))) return false;
if (await ProblemModel.get(domainId, id)) return false;
return true;
};
if (!await isValidPid(pdoc.display_id)) pdoc.display_id = null;
const pid = await ProblemModel.add(
domainId, pdoc.display_id, pdoc.title, buildContent(content, 'html'),
this.user._id, pdoc.tags || [],
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/import-qduoj",
"version": "1.5.3",
"version": "1.5.4",
"description": "Import QDUOJ problem export",
"main": "index.ts",
"repository": "https://github.com/hydro-dev/Hydro.git",
+1 -1
View File
@@ -7,7 +7,7 @@
"license": "AGPL-3.0-or-later",
"dependencies": {
"mariadb": "^3.2.0",
"mongodb": "^5.6.0",
"mongodb": "^5.7.0",
"turndown": "^7.1.2",
"xml2js": "^0.6.0"
},
+19 -19
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.48.20",
"version": "4.48.21",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "index.ts",
@@ -14,16 +14,16 @@
"cli": false
},
"devDependencies": {
"@blueprintjs/core": "^4.20.1",
"@blueprintjs/popover2": "^1.14.9",
"@fontsource/dm-mono": "^5.0.3",
"@fontsource/fira-code": "^5.0.3",
"@fontsource/inconsolata": "^5.0.3",
"@fontsource/jetbrains-mono": "^5.0.3",
"@fontsource/pt-mono": "^5.0.3",
"@fontsource/roboto-mono": "^5.0.3",
"@fontsource/source-code-pro": "^5.0.3",
"@fontsource/ubuntu-mono": "^5.0.3",
"@blueprintjs/core": "^4.20.2",
"@blueprintjs/popover2": "^1.14.11",
"@fontsource/dm-mono": "^5.0.5",
"@fontsource/fira-code": "^5.0.5",
"@fontsource/inconsolata": "^5.0.5",
"@fontsource/jetbrains-mono": "^5.0.5",
"@fontsource/pt-mono": "^5.0.5",
"@fontsource/roboto-mono": "^5.0.5",
"@fontsource/source-code-pro": "^5.0.5",
"@fontsource/ubuntu-mono": "^5.0.5",
"@hydrooj/utils": "workspace:*",
"@simplewebauthn/browser": "^7.2.0",
"@svgr/webpack": "^8.0.1",
@@ -33,22 +33,22 @@
"@types/katex": "^0.16.0",
"@types/markdown-it": "^12.2.3",
"@types/pickadate": "^3.5.32",
"@types/qrcode": "^1.5.0",
"@types/react": "^18.2.13",
"@types/qrcode": "^1.5.1",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@types/redux-logger": "^3.0.9",
"@types/serviceworker": "^0.0.68",
"@types/sharedworker": "^0.0.97",
"@types/serviceworker": "^0.0.69",
"@types/sharedworker": "^0.0.98",
"@types/webpack-env": "^1.18.1",
"@vscode/codicons": "^0.0.33",
"ajv": "^8.12.0",
"allotment": "^1.19.0",
"autoprefixer": "^10.4.14",
"browser-update": "^3.3.44",
"chalk": "^5.2.0",
"chalk": "^5.3.0",
"classnames": "^2.3.2",
"clipboard": "^2.0.11",
"cordis": "^2.8.0",
"cordis": "^2.8.2",
"diff": "^5.1.0",
"diff-dom": "^5.0.4",
"echarts": "^5.4.2",
@@ -96,7 +96,7 @@
"redux-promise-middleware": "^6.1.3",
"redux-thunk": "^2.4.2",
"rupture": "^0.7.1",
"schemastery": "^3.10.0",
"schemastery": "^3.10.1",
"slideout": "^1.0.1",
"sticky-kit": "^1.1.3",
"tether": "1.4.7",
@@ -114,7 +114,7 @@
"fs-extra": "^11.1.1",
"js-yaml": "^4.1.0",
"jsesc": "^3.0.2",
"katex": "^0.16.7",
"katex": "^0.16.8",
"lodash": "^4.17.21",
"markdown-it": "^13.0.1",
"markdown-it-anchor": "^8.6.7",
@@ -59,15 +59,16 @@
</div>
<div class="section__body">
<ol class="my secondary training__list">
{%- for tsdoc in tsdict -%}
{%- for tid, tsdoc in tsdict -%}
{% if tsdoc['enroll'] %}
{% set progress = (100 * (tsdoc['donePids']|length) / (model.training.getPids(tdict[tsdoc['docId']].dag)|length))|round|int %}
<li class="training__item"><div class="media">
<div class="media__left">
<span class="icon training-status--icon {% if tsdoc['done'] %}done{% else %}progress{% endif %}"></span>
</div>
<div class="media__body">
<h1 class="training__title"><a href="{{ url('training_detail', tid=tsdoc.docId) }}" data-emoji-enabled>{{ tdict[tsdoc['docId']]['title'] }}</a></h1>
<div class="supplementary training__progress"><div class="training__progress-bar"><div class="training__progress-track" style="width:{{ (100 * tsdoc['donePids']|length / model.training.getPids(tdict[tsdoc['docId']].dag)|length)|round|int }}%;"></div></div> {{ _('Complete') }} {{ (100 * tsdoc['donePids']|length / handler.getPids(tdict[tsdoc.docId].dag)|length)|round|int }}%</div>
<div class="supplementary training__progress"><div class="training__progress-bar"><div class="training__progress-track" style="width:{{ progress }}%;"></div></div> {{ _('Complete') }} {{ progress }}%</div>
</div>
</div></li>
{% endif %}
+3 -3
View File
@@ -13,10 +13,10 @@
"fs-extra": "^11.1.1",
"js-yaml": "^4.1.0",
"moment-timezone": "^0.5.43",
"mongodb": "^5.6.0",
"reggol": "^1.4.2",
"mongodb": "^5.7.0",
"reggol": "^1.4.4",
"source-map-support": "^0.5.21",
"systeminformation": "^5.18.4"
"systeminformation": "^5.18.6"
},
"devDependencies": {
"@types/fs-extra": "^11.0.1",
+2 -1
View File
@@ -16,7 +16,7 @@ class AccountService {
problemLists: Set<string>;
listUpdated = false;
working = false;
error = null;
error = '';
constructor(public Provider: BasicProvider, public account: RemoteAccount) {
this.api = new Provider(account, async (data) => {
@@ -25,6 +25,7 @@ class AccountService {
this.problemLists = Set.union(this.api.entryProblemLists || ['main'], this.account.problemLists || []);
this.main().catch((e) => {
logger.error(`Error occured in ${account.type}/${account.handle}`);
this.working = false;
this.error = e.message;
console.error(e);
});