feat: 并发文件审查,可配置并行度
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user