diff --git a/README.md b/README.md index 82893947..1932e040 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,23 @@ Telegram [@webpack_exports_undefined](https://t.me/webpack_exports_undefined)

更新日志(点击展开)

+### Hydro 4.9.0 / UI 4.48.0 +- core: 优化讨论鉴权 +- judge: 优化统一回调评测状态回显 +- judge: 移除 `processTestdata` 步骤 +- judge: 客观题子任务分数回显 +- core: 压平测试数据结构 +- core: rp: 修复比赛分数 +- core&ui: 首次使用 OAuth 时要求设置密码 +- ui: 评测设置 UI 升级 +- install: 根据系统内存调整 wtCacheSize +- ui: 加载速度优化 +- core: 检测域 ID 大小写 +- ui: 导航栏域索引 +- ui: 支持按权限组过滤作业/比赛 +- judge: 将 Javascript 默认解释器设置为 node +- judge: 修复删除未评测完成的题目导致评测队列卡死的问题 + ### Hydro 4.8.0 / UI 4.47.6 - core: 升级至 mongodb@5 - ui: 评测详情中显示子任务得分 diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index acdab541..5b80ac7a 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "4.9.0", + "version": "4.9.1", "bin": "bin/hydrooj.js", "main": "src/plugin-api", "module": "src/plugin-api", diff --git a/packages/hydrooj/src/handler/contest.ts b/packages/hydrooj/src/handler/contest.ts index d1220be3..8d962fa9 100644 --- a/packages/hydrooj/src/handler/contest.ts +++ b/packages/hydrooj/src/handler/contest.ts @@ -322,6 +322,11 @@ export class ContestScoreboardHandler extends ContestDetailBaseHandler { async exportScoreboard(domainId: string, tid: ObjectId, ext: string) { await this.limitRate('scoreboard_download', 60, 3); if (ext === 'ghost') { + if ((contest.isDone(this.tdoc) || contest.isLocked(this.tdoc)) && !this.tdoc.unlocked) { + if (!this.user.own(this.tdoc)) { + this.checkPerm(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD); + } + } await this.exportGhost(domainId, tid); return; } diff --git a/packages/ui-default/components/problemconfig/tree/AddTestcase.tsx b/packages/ui-default/components/problemconfig/tree/AddTestcase.tsx index 7f2f40e1..6b9bb3de 100644 --- a/packages/ui-default/components/problemconfig/tree/AddTestcase.tsx +++ b/packages/ui-default/components/problemconfig/tree/AddTestcase.tsx @@ -1,9 +1,10 @@ import { - Button, ControlGroup, Dialog, DialogBody, DialogFooter, Icon, InputGroup, + Button, Dialog, DialogBody, DialogFooter, Icon, } from '@blueprintjs/core'; import { readSubtasksFromFiles } from '@hydrooj/utils/lib/common'; -import React, { useEffect } from 'react'; +import React, { useEffect, useRef } from 'react'; import { useSelector, useStore } from 'react-redux'; +import FileSelectAutoComplete from '../../autocomplete/components/FileSelectAutoComplete'; import { RootState } from '../reducer'; export function AddTestcase() { @@ -13,9 +14,28 @@ export function AddTestcase() { const [valid, setValid] = React.useState(false); const testdata = useSelector((state: RootState) => state.testdata); const store = useStore(); + const refInput = useRef(); + const refOutput = useRef(); useEffect(() => { setValid(testdata.find((i) => i.name === input) && testdata.find((i) => i.name === output)); + if (input && !output) { + const filename = input.substring(0, input.lastIndexOf('.')); + let outputFile = ''; + if (testdata.find((i) => i.name === `${filename}.out`)) outputFile = `${filename}.out`; + else if (testdata.find((i) => i.name === `${filename}.ans`)) outputFile = `${filename}.ans`; + // @ts-ignore + refOutput.current!.setSelectedItems([outputFile]); + setOutput(outputFile); + } + if (output && !input) { + const filename = output.substring(0, output.lastIndexOf('.')); + if (testdata.find((i) => i.name === `${filename}.in`)) { + // @ts-ignore + refInput.current!.setSelectedItems([`${filename}.in`]); + setInput(`${filename}.in`); + } + } }, [input, output]); function onConfirm() { @@ -57,32 +77,52 @@ export function AddTestcase() {
  • setOpen(true)} + onClick={() => { + setInput(''); + setOutput(''); + setOpen(true); + }} >
      Add testcase
  • - setOpen(false)}> + setOpen(false)}> - - {/* TODO: autocomplete */} - } - onChange={(e) => setInput(e.target.value)} - placeholder="Input" - value={input || ''} - /> - } - onChange={(e) => setOutput(e.target.value)} - placeholder="Output" - value={output || ''} - /> - +
    +
    + setInput(e)} + placeholder="Input" + value={input || ''} + /> +
    +
    + setOutput(e)} + placeholder="Output" + value={input || ''} + /> +
    +
    - } /> + } />
    ); } diff --git a/packages/ui-default/components/problemconfig/tree/SubtaskSettings.tsx b/packages/ui-default/components/problemconfig/tree/SubtaskSettings.tsx index 0fb13cb9..c178ded2 100644 --- a/packages/ui-default/components/problemconfig/tree/SubtaskSettings.tsx +++ b/packages/ui-default/components/problemconfig/tree/SubtaskSettings.tsx @@ -65,7 +65,7 @@ export function SubtaskSettings(props: SubtaskSettingsProps) { /> - } /> + } />
  • setOpen(true)}>
    @@ -123,7 +123,7 @@ export function GlobalSettings() { /> - } /> + } />
  • setOpen(true)}>
    diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 7b7abc88..b1a74505 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.48.0", + "version": "4.48.1", "author": "undefined ", "license": "AGPL-3.0", "main": "index.ts", diff --git a/packages/ui-default/pages/problem_config.page.styl b/packages/ui-default/pages/problem_config.page.styl index 964b69cd..19c6be2b 100644 --- a/packages/ui-default/pages/problem_config.page.styl +++ b/packages/ui-default/pages/problem_config.page.styl @@ -15,6 +15,37 @@ .bp4-tab-panel margin-top: 5px + .bp4-dialog + font-family: var(--code-font-family) + background: #fff + + .autocomplete-container + font-size: 0.875rem + color: #666 + + .bp4-dialog-footer-fixed + border-top: 0 + + .button + margin: 0 + + .bp4-input-group + input + appearance: none + display: block + width: 100% + font-size: 0.875rem + height: 2.1875rem + line-height: 1.2 + padding: 0.3125rem; + border: 1px solid #ddd + color: inherit + border-radius: 0 + outline: 2px solid transparent + transition: outline-color 0.2s, border-color 0.2s + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1) + box-shadow: none + .problem-config-form font-family: var(--code-font-family) @@ -27,24 +58,6 @@ background: transparent .bp4-input-action pointer-events: none - .bp4-input-group - input - appearance: none - display: block - width: 100% - font-size: 0.875rem - height: 2.1875rem - line-height: 1.2 - padding: 0.3125rem; - border: 1px solid #ddd - color: inherit - border-radius: 0 - background-color: transparent - outline: 2px solid transparent - transition: outline-color 0.2s, border-color 0.2s - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1) - box-shadow: none - .data-table tr diff --git a/packages/ui-default/theme/dark.styl b/packages/ui-default/theme/dark.styl index b6781f1e..17050ea6 100644 --- a/packages/ui-default/theme/dark.styl +++ b/packages/ui-default/theme/dark.styl @@ -390,3 +390,15 @@ $hover-background-color = #424242 .omnibar-content-section background-color: $main-background-color !important border-color: #3d3d3d !important + + .bp4-tab + color: #aaa + + &[aria-disabled=true] + color: #555 + + .bp4-card,.bp4-dialog,.bp4-dialog-header,.bp4-dialog-footer + background-color: #1f1f1f !important + + .bp4-input-group input + border-color: #3d3d3d!important