feat: 并发文件审查,可配置并行度

This commit is contained in:
2026-06-19 23:40:13 +08:00
parent e4df6487ea
commit a66074e49c
6 changed files with 164 additions and 104 deletions
+10 -1
View File
@@ -18,7 +18,7 @@
<h1 class="text-2xl font-bold text-gray-900 mb-6">AI 代码审查</h1>
<div class="bg-white rounded-lg shadow-md p-6 mb-6">
<div class="grid grid-cols-3 gap-4 mb-4">
<div class="grid grid-cols-4 gap-4 mb-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Base</label>
<select id="base-ref" class="w-full border rounded-md px-3 py-2" required>
@@ -37,6 +37,12 @@
placeholder="留空=全部">
<p class="text-xs text-gray-400 mt-1">设为 0 分析全部文件</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">并发分析数</label>
<input type="number" id="concurrency" value="{{.Concurrency}}" min="1" max="20" class="w-full border rounded-md px-3 py-2"
placeholder="默认 5">
<p class="text-xs text-gray-400 mt-1">同时分析的文件数 (1-20)</p>
</div>
</div>
<button onclick="startReview()" id="btn-review" class="w-full bg-purple-600 text-white py-2 px-4 rounded-md hover:bg-purple-700">
开始审查
@@ -254,10 +260,13 @@
let completedFiles = 0;
let currentFile = '';
const concurrency = document.getElementById('concurrency').value;
currentSSE = SSE.post(`/api/repos/${repoId}/review`, {
base: baseRef,
head: headRef,
top_n: parseInt(topN) || 0,
concurrency: parseInt(concurrency) || 5,
}, {
start(data) {
totalFiles = data.total_files || 0;