()
| 705 | |
| 706 | // 清理数据 |
| 707 | async 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 | // 加载服务配置字段 |
| 727 | async function loadServiceConfigFields(serviceType) { |
nothing calls this directly
no test coverage detected