diff --git a/frontend/src/components/repos/ReposView.tsx b/frontend/src/components/repos/ReposView.tsx index 09564bb..c671b0a 100644 --- a/frontend/src/components/repos/ReposView.tsx +++ b/frontend/src/components/repos/ReposView.tsx @@ -18,7 +18,6 @@ export default function ReposView() { const [scanningBranches, setScanningBranches] = useState(false) const [branchDetected, setBranchDetected] = useState(false) const [detectingLatest, setDetectingLatest] = useState(false) - const [apiKey, setApiKey] = useState('') const [expandedRepo, setExpandedRepo] = useState(null) const [currentTaskId, setCurrentTaskId] = useState(null) const [actionLabel, setActionLabel] = useState('') @@ -29,7 +28,6 @@ export default function ReposView() { const [feShowBranchPicker, setFeShowBranchPicker] = useState(false) const [feScanningBranches, setFeScanningBranches] = useState(false) const [feBranchDetected, setFeBranchDetected] = useState(false) - const [feApiKey, setFeApiKey] = useState('') const [feTaskId, setFeTaskId] = useState(null) const [feRunning, setFeRunning] = useState(false) const [feLogs, setFeLogs] = useState<{ts:string;level:string;msg:string}[]>([]) @@ -49,7 +47,7 @@ export default function ReposView() { const endpoints: Record = { analyze: `/api/repos/${repoId}/analyze`, generate: `/api/repos/${repoId}/generate`, diff: `/api/repos/${repoId}/diff`, full: `/api/repos/${repoId}/full` } const endpoint = endpoints[mode] if (!endpoint) return - const res = await fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ api_key: apiKey, test_types: ['smoke', 'unit', 'integration'] }) }) + const res = await fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ api_key: '', test_types: ['smoke', 'unit', 'integration'] }) }) const task = await res.json(); setCurrentTaskId(task.id); connect(task.id) } @@ -95,7 +93,7 @@ export default function ReposView() { const scanRepo = async () => { if (!url) return; setActionLabel('扫描仓库') - const res = await fetch('/api/repos', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url, branch, api_key: apiKey }) }) + const res = await fetch('/api/repos', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url, branch }) }) const task = await res.json(); setCurrentTaskId(task.id); connect(task.id) } @@ -188,8 +186,7 @@ export default function ReposView() { )} - setApiKey(e.target.value)} className="w-48 px-3 py-2 rounded-lg text-sm outline-none" style={{ backgroundColor: 'rgb(var(--color-page))', borderColor: !apiKey ? 'rgb(var(--color-error))' : 'rgb(var(--color-border))', borderWidth: !apiKey ? '2px' : '1px', color: 'rgb(var(--color-text-primary))' }} /> - + @@ -257,7 +254,6 @@ export default function ReposView() { )} - setFeApiKey(e.target.value)} className="w-48 px-3 py-2 rounded-lg text-sm outline-none" style={{ backgroundColor: 'rgb(var(--color-page))', borderColor: !feApiKey ? 'rgb(var(--color-error))' : 'rgb(var(--color-border))', borderWidth: !feApiKey ? '2px' : '1px', color: 'rgb(var(--color-text-primary))' }} />