MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / executeRepairCenter

Function executeRepairCenter

static/js/selfcheck.js:430–457  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

428}
429
430async function executeRepairCenter() {
431 const btn = document.getElementById('repair-center-execute-btn');
432 const run = selfcheckState.selectedRun;
433 if (!run?.id) {
434 toast.warning('请先选择一条自检运行记录');
435 return;
436 }
437 const keys = collectCheckedPreviewKeys();
438 if (!keys.length) {
439 toast.warning('请先勾选要执行的修复项');
440 return;
441 }
442 if (btn) loading.show(btn, '执行中...');
443 try {
444 const data = await api.post('/selfcheck/repair-center/execute', {
445 run_id: Number(run.id),
446 repair_keys: keys,
447 });
448 const rollbackId = data?.result?.rollback_id;
449 toast.success(`修复完成${rollbackId ? `,回滚点: ${rollbackId}` : ''}`);
450 await loadRunDetail(Number(run.id));
451 await loadRepairRollbacks();
452 } catch (error) {
453 toast.error(`执行失败: ${parseErrorMessage(error)}`);
454 } finally {
455 if (btn) loading.hide(btn);
456 }
457}
458
459async function rollbackRepairPoint(rollbackId, btn) {
460 const id = String(rollbackId || '').trim();

Callers

nothing calls this directly

Calls 10

loadRunDetailFunction · 0.85
loadRepairRollbacksFunction · 0.85
parseErrorMessageFunction · 0.85
warningMethod · 0.80
successMethod · 0.80
errorMethod · 0.80
hideMethod · 0.80
showMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected