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

Function cleanupLogs

static/js/logs.js:179–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177}
178
179async function cleanupLogs() {
180 const retentionDays = Number(el.cleanupRetentionDays.value || 14);
181 const maxRows = Number(el.cleanupMaxRows.value || 50000);
182 const ok = await confirm(
183 `确认清理日志吗?\n保留天数=${retentionDays},最大条数=${maxRows}`,
184 "清理后台日志"
185 );
186 if (!ok) return;
187
188 try {
189 loading.show(el.cleanupBtn, "清理中...");
190 const data = await api.post("/logs/cleanup", {
191 retention_days: retentionDays,
192 max_rows: maxRows,
193 });
194 toast.success(`清理完成:删除 ${data.deleted_total || 0} 条,剩余 ${data.remaining || 0} 条`);
195 logsState.page = 1;
196 await Promise.all([loadLogs(true), loadStats(true)]);
197 setLogsSummary();
198 } catch (error) {
199 toast.error(`清理失败: ${error?.message || error}`);
200 } finally {
201 loading.hide(el.cleanupBtn);
202 }
203}
204
205async function clearAllLogs() {
206 const ok = await confirm("确认清空全部后台日志吗?该操作不可恢复。", "清空后台日志");

Callers

nothing calls this directly

Calls 10

confirmFunction · 0.85
loadLogsFunction · 0.85
setLogsSummaryFunction · 0.85
successMethod · 0.80
allMethod · 0.80
errorMethod · 0.80
hideMethod · 0.80
loadStatsFunction · 0.70
showMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected