(runId, repairKey, btn)
| 343 | } |
| 344 | |
| 345 | async function executeRepair(runId, repairKey, btn) { |
| 346 | if (!runId || !repairKey) return; |
| 347 | if (btn) loading.show(btn, '执行中...'); |
| 348 | try { |
| 349 | const data = await api.post(`/selfcheck/runs/${Number(runId)}/repairs/${encodeURIComponent(repairKey)}`, {}); |
| 350 | toast.success(`${getRepairName(repairKey)} 执行完成`); |
| 351 | const run = data?.run; |
| 352 | if (run?.id) { |
| 353 | renderRunDetail(run); |
| 354 | await loadRuns(); |
| 355 | } else { |
| 356 | await loadRunDetail(runId); |
| 357 | } |
| 358 | } catch (error) { |
| 359 | toast.error(`修复失败: ${parseErrorMessage(error)}`); |
| 360 | } finally { |
| 361 | if (btn) loading.hide(btn); |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | function collectRepairKeysFromSelectedRun() { |
| 366 | const run = selfcheckState.selectedRun; |
no test coverage detected