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

Function handleCleanup

static/js/settings.js:707–724  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

705
706// 清理数据
707async function handleCleanup() {
708 const confirmed = await confirm('确定要清理过期数据吗?默认会清理 14 天前的已完成/已取消任务、45 天前的失败任务、7 天前的待处理任务,以及 3 天前仍未结束的运行任务。此操作不可恢复。');
709 if (!confirmed) return;
710
711 elements.cleanupBtn.disabled = true;
712 elements.cleanupBtn.innerHTML = '<span class="loading-spinner"></span> 清理中...';
713
714 try {
715 const data = await api.post('/settings/database/cleanup');
716 toast.success(data.message);
717 loadDatabaseInfo();
718 } catch (error) {
719 toast.error('清理失败: ' + error.message);
720 } finally {
721 elements.cleanupBtn.disabled = false;
722 elements.cleanupBtn.textContent = '🧹 清理过期数据';
723 }
724}
725
726// 加载服务配置字段
727async function loadServiceConfigFields(serviceType) {

Callers

nothing calls this directly

Calls 5

confirmFunction · 0.85
loadDatabaseInfoFunction · 0.85
successMethod · 0.80
errorMethod · 0.80
postMethod · 0.45

Tested by

no test coverage detected