Repository navigation
完善主页与网页webxmoj #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
完善主页与网页webxmoj #18
Changes from 34 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
c08fce8
Build and document GitHub Pages site
PythonSmall-Q 92ceb22
fix: pass workflow token to Claude review
PythonSmall-Q d627d9f
docs: resolve review feedback on Pages and site content
Copilot 82a301e
Fix links to project website and documentation
PythonSmall-Q d5ffcd8
docs: address follow-up website review comments
Copilot 53dc4df
docs: point Cloudflare Pages at website content
Copilot 750c9dd
Add isolated anonymous web client build
Copilot 9785a27
Use a slim public-only browser shell
Copilot 673db79
Add Cloudflare Pages project config
Copilot 7f20b9f
Add secure web sessions and public browsing
Copilot d172854
Add authenticated web code submission
Copilot b0f4324
Use lightweight web code submission view
Copilot 36d617f
Remove Wrangler temporary bundles
Copilot 49b4b2f
Enable browser community and source tools
Copilot 0a5076d
Update web verification and compatibility
Copilot 72e616a
Restore web styling and identify login blocker
Copilot 24055d6
Keep the web sidebar accessible
Copilot 66d2704
Add safe upstream redirect handling and Web avatars
Copilot 093b38e
Route Cloudflare requests through safe authenticated sessions
Copilot 3815bb8
Require login for protected XMOJ data pages
Copilot 8882d25
Preserve web routes and enable Turnstile CSP
Copilot 042bcac
Add Cloudflare API rate limits and 429 handling
Copilot 37a1002
Link the Web favicon to official XMOJ-Script icon
Copilot 62280a7
Add the official XMOJ-Script Web icon asset
Copilot d668850
Enable shareable post and contest routes
Copilot 1fcf403
Remove redundant detail-session preflights
Copilot 074ad7f
Parallelize detail verification and display
Copilot 3dbdbf9
Fix prefilled contest-aware submissions
Copilot 4351672
Update AppSidebar.vue
zsTree0830 7a8cd6c
fix(webxmoj): 修复网页版回归与安全问题
zsTree0830 602d571
docs(website): 修正安装说明的代码标签与发布格式
zsTree0830 e41217c
refactor(app): 移除桌面入口中永不显示的网页版提示
zsTree0830 44e9179
Fix bugs
zsTree0830 a5da5d1
Fix review issues and harden contest ranking E2E
zsTree0830 3a0775c
Fix web review findings and harden Pages deployment
zsTree0830 40503aa
Merge branch 'dev' into docs/github-pages-site
zsTree0830 39f8003
fix(web): 缓存为空时回落到网络加载
zsTree0830 9112b7e
style: 修正 ProblemView 返回竞赛按钮缩进
zsTree0830 b3fe27d
fix(web): 返回竞赛按钮加 type=button,避免触发表单提交
zsTree0830 dc0a6a0
Bump version to 1.1.2
zsTree0830 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import { parse } from 'node-html-parser'; | ||
| import type { JudgeDetails, JudgeTest } from '../src/shared/types.ts'; | ||
|
|
||
| export function parseJudgeDetails(html: string): JudgeDetails { | ||
| const tests: JudgeTest[] = []; | ||
| const status: Record<number, string> = { | ||
| 0: 'Pending', | ||
| 1: 'Pending', | ||
| 2: 'Compiling', | ||
| 3: 'Running', | ||
| 4: 'AC', | ||
| 5: 'PE', | ||
| 6: 'WA', | ||
| 7: 'TLE', | ||
| 8: 'MLE', | ||
| 9: 'OLE', | ||
| 10: 'RE', | ||
| 11: 'CE', | ||
| 12: 'Compile OK', | ||
| 13: 'Testing', | ||
| 14: 'Skipped', | ||
| 15: 'Ignored', | ||
| }; | ||
| const start = /\bvar\s+json\s*=\s*/.exec(html); | ||
| if (start) { | ||
| const offset = start.index + start[0].length; | ||
| let depth = 0, quoted = false, escaped = false; | ||
| for (let i = offset; i < html.length; i++) { | ||
| const c = html[i]; | ||
| if (quoted) { | ||
| if (escaped) escaped = false; | ||
| else if (c === '\\') escaped = true; | ||
| else if (c === '"') quoted = false; | ||
| } else if (c === '"') quoted = true; | ||
| else if (c === '{') depth++; | ||
| else if (c === '}' && --depth === 0) { | ||
| try { | ||
| const data = JSON.parse(html.slice(offset, i + 1)); | ||
| const add = (task: Record<string, unknown>, group: string | null) => { | ||
| if (!task || typeof task !== 'object') return; | ||
| tests.push({ | ||
| name: String(task.i ?? tests.length + 1), | ||
| group, | ||
| status: status[Number(task.s)] ?? String(task.s ?? 'Unknown'), | ||
| timeMs: Number(task.t) || 0, | ||
| memoryKb: Number(task.m) || 0, | ||
| score: typeof task.sc === 'number' ? task.sc : null, | ||
| }); | ||
| }; | ||
| for (const task of Array.isArray(data.tasks) ? data.tasks : []) { | ||
| if (data.st === 0) add(task, null); | ||
| else for (const test of Array.isArray(task.t) ? task.t : []) add(test, `子任务 ${task.i} · ${task.s} 分`); | ||
| } | ||
| } catch { | ||
| } | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| tests.sort((a, b) => (a.group ?? '').localeCompare(b.group ?? '', undefined, { numeric: true }) || | ||
| a.name.localeCompare(b.name, undefined, { numeric: true })); | ||
| const root = parse(html); | ||
| const diagnostic = root.querySelectorAll('pre') | ||
| .filter(node => !node.closest('#tpl')) | ||
| .map(node => node.textContent.trim()) | ||
| .filter(Boolean) | ||
| .join('\n\n'); | ||
| return { tests, diagnostic }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.