Merge branch 'master' into monaco

This commit is contained in:
undefined committed 2024-07-15 19:45:19 +08:00
commit 14c3f82b44
15 files changed
+109 -33

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "3.3.15",
"version": "3.3.16",
"main": "./src/index.ts",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+1
View File
@@ -18,6 +18,7 @@ export const judge = async (ctx: JudgeTask) => {
// Allow 2x limits for better debugging
time: parseTimeMS(ctx.config.time || '1s') * 2,
memory: parseMemoryMB(ctx.config.memory || '128m'),
filename: ctx.config.filename,
addressSpaceLimit: address_space_limit,
processLimit: process_limit,
},
+2 -2
View File
@@ -74,7 +74,7 @@ function parseArgs(execute: string): string[] {
function proc(params: Parameter): Cmd {
const copyOut = supportOptional
? params.copyOut
? (params.copyOut || [])
: (params.copyOut || []).map((i) => (i.endsWith('?') ? i.substring(0, i.length - 1) : i));
const stdioLimit = parseMemoryMB(getConfig('stdio_size'));
const stdioSize = params.cacheStdoutAndStderr ? stdioLimit : 4;
@@ -82,7 +82,7 @@ function proc(params: Parameter): Cmd {
if (params.cacheStdoutAndStderr) {
copyOutCached.push('stdout', 'stderr');
if (params.filename) copyOutCached.push(`${params.filename}.out?`);
}
} else if (params.filename) copyOut.push(`${params.filename}.out${supportOptional ? '?' : ''}`);
const copyIn = { ...(params.copyIn || {}) };
const stdin = params.stdin || { content: '' };
if (params.filename) copyIn[`${params.filename}.in`] = stdin;
+1
View File
@@ -636,6 +636,7 @@ Quit Scratchpad: 退出在线编程模式
Quote: 引用
Rank: 排名
ranking: 排名
Ranking: 排名
Read record codes after accept: 题目通过后读取记录的代码
Recalculates nSubmit and nAccept in problem status.: 重新计算每道题目的 AC 量和提交量
Recommended: 推荐
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "4.13.1",
"version": "4.13.2",
"bin": "bin/hydrooj.js",
"main": "src/plugin-api",
"module": "src/plugin-api",
@@ -12,10 +12,10 @@
},
"preferUnplugged": true,
"dependencies": {
"@aws-sdk/client-s3": "3.609.0",
"@aws-sdk/lib-storage": "3.609.0",
"@aws-sdk/s3-presigned-post": "3.609.0",
"@aws-sdk/s3-request-presigner": "3.609.0",
"@aws-sdk/client-s3": "3.614.0",
"@aws-sdk/lib-storage": "3.614.0",
"@aws-sdk/s3-presigned-post": "3.614.0",
"@aws-sdk/s3-request-presigner": "3.614.0",
"@graphql-tools/schema": "^10.0.4",
"@hydrooj/framework": "workspace:^",
"@hydrooj/utils": "workspace:^",
@@ -34,7 +34,7 @@
"koa-proxies": "^0.12.4",
"koa-static-cache": "^5.1.4",
"lodash": "^4.17.21",
"lru-cache": "^10.3.1",
"lru-cache": "^10.4.3",
"mime-types": "^2.1.35",
"moment-timezone": "^0.5.45",
"mongodb": "^5.9.2",
@@ -14,16 +14,19 @@ declare module '../context' {
export default class MigrationService extends Service {
private channels: Record<string, MigrationScript[]> = {};
private called = false;
constructor(ctx: Context) {
super(ctx, 'migration', true);
}
async registerChannel(name: string, s: MigrationScript[]) {
if (this.called) logger.warn('MigrationService.registerChannel: called after doUpgrade');
this.channels[name] = s;
}
async doUpgrade() {
this.called = true;
for (const channel in this.channels) {
const name = `db.ver${channel === 'hydrooj' ? '' : `-${channel}`}`;
let dbVer = system.get(name) ?? 0;
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.51.4",
"version": "4.52.0",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "index.ts",
@@ -30,8 +30,8 @@
"@fontsource/source-code-pro": "^5.0.18",
"@fontsource/ubuntu-mono": "^5.0.20",
"@hydrooj/utils": "workspace:^",
"@sentry/browser": "^8.15.0",
"@sentry/webpack-plugin": "^2.20.1",
"@sentry/browser": "^8.17.0",
"@sentry/webpack-plugin": "^2.21.1",
"@simplewebauthn/browser": "7.4.0",
"@svgr/webpack": "^8.1.0",
"@types/gulp-if": "^0.0.34",
@@ -50,7 +50,7 @@
"@types/vscode": "^1.91.0",
"@types/webpack-env": "^1.18.5",
"@vscode/codicons": "^0.0.36",
"ajv": "^8.16.0",
"ajv": "^8.17.1",
"allotment": "^1.20.2",
"autoprefixer": "^10.4.19",
"browser-update": "^3.3.53",
@@ -67,7 +67,7 @@
"echarts": "^5.5.1",
"emojis-keywords": "2.0.0",
"emojis-list": "2.1.0",
"esbuild-loader": "^4.2.0",
"esbuild-loader": "^4.2.1",
"fancy-log": "^2.0.0",
"flatpickr": "^4.6.13",
"graphiql": "^2.4.7",
@@ -133,7 +133,7 @@
"vinyl-buffer": "^1.0.1",
"vscode": "npm:@codingame/monaco-vscode-api@^7.0.5",
"web-streams-polyfill": "^4.0.0",
"webpack": "^5.92.1",
"webpack": "^5.93.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-dev-server": "^5.0.4",
"webpack-manifest-plugin": "^5.0.0",
@@ -161,7 +161,7 @@ const page = new NamedPage('problem_files', () => {
const style = { fontFamily: 'var(--code-font-family)' };
return <div className="typo">
return <div className="typo" style={{ maxHeight: '60vh', overflow: 'scroll' }}>
{!preview ? <>
<div className="row">
<div className="medium-6 small-6 columns">
@@ -229,7 +229,7 @@ const page = new NamedPage('problem_files', () => {
<th className="col--new">{i18n('New filename(s)')}</th>
</tr>
</thead>
<tbody style={{ maxHeight: '60vh', overflow: 'scroll' }}>
<tbody>
{selectedFiles.map((file, index) => <tr key={file}>
<td className="col--origin">{file}</td>
<td className="col--new">{newNames[index]}</td>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/vjudge",
"version": "1.9.7",
"version": "1.9.8",
"description": "Submit problems to remote oj",
"main": "./src/index.ts",
"repository": "https://github.com/hydro-dev/Hydro.git",
+12 -7
View File
@@ -270,12 +270,20 @@ export default class CodeforcesProvider extends BasicFetcher implements IBasicPr
});
}
async readLatestSubmission(contestId = '') {
const { document } = await this.html(contestId ? `/gym/${contestId}/my` : '/problemset/status?my=on');
this.csrf = document.querySelector('meta[name="X-Csrf-Token"]').getAttribute('content');
const submission = document.querySelector('[data-submission-id]').getAttribute('data-submission-id');
return submission;
}
async submitProblem(id: string, lang: string, code: string, info, next, end) {
const programTypeId = lang.includes('codeforces.') ? lang.split('codeforces.')[1] : '54';
const [type, contestId, problemId] = parseProblemId(id);
const endpoint = type === 'GYM'
? `/gym/${contestId}/submit`
: `/problemset/submit/${contestId}/${problemId}`;
const latestSubmission = await this.readLatestSubmission(type === 'GYM' ? contestId : '');
const [csrf, ftaa, bfaa] = await this.getCsrfToken(endpoint);
// TODO check submit time to ensure submission
const { text: submit, redirects } = await this.post(`${endpoint}?csrf_token=${csrf}`).send({
@@ -298,16 +306,13 @@ export default class CodeforcesProvider extends BasicFetcher implements IBasicPr
end({ status: STATUS.STATUS_SYSTEM_ERROR, message });
return null;
}
if (redirects.length === 0 || !redirects.toString().includes('my')) {
const submission = await this.readLatestSubmission(type === 'GYM' ? contestId : '');
if (submission === latestSubmission || redirects.length === 0 || !redirects.toString().includes('my')) {
// Submit failed so the request is not redirected
end({ status: STATUS.STATUS_SYSTEM_ERROR, message: 'Submit failed' });
// eslint-disable-next-line max-len
end({ status: STATUS.STATUS_SYSTEM_ERROR, message: 'Submit failed. Check service status or use better network to avoid rejection by server protection.' });
return null;
}
const { document } = await this.html(type !== 'GYM'
? '/problemset/status?my=on'
: `/gym/${contestId}/my`);
this.csrf = document.querySelector('meta[name="X-Csrf-Token"]').getAttribute('content');
const submission = document.querySelector('[data-submission-id]').getAttribute('data-submission-id');
return type !== 'GYM' ? submission : `${contestId}#${submission}`;
}