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

Function loadStats

static/js/logs.js:152–168  ·  view source on GitHub ↗
(silent = false)

Source from the content-addressed store, hash-verified

150}
151
152async function loadStats(silent = false) {
153 try {
154 const data = await api.get("/logs/stats");
155 const levels = data.levels || {};
156 applyCleanupDefaults(data);
157 el.statTotal.textContent = format.number(data.total || 0);
158 el.statInfo.textContent = format.number(levels.INFO || 0);
159 el.statWarning.textContent = format.number(levels.WARNING || 0);
160 el.statError.textContent = format.number(levels.ERROR || 0);
161 el.statCritical.textContent = format.number(levels.CRITICAL || 0);
162 el.latestLogTime.textContent = `最新日志: ${data.latest_at ? format.date(data.latest_at) : "-"}`;
163 } catch (error) {
164 if (!silent) {
165 toast.error(`加载统计失败: ${error?.message || error}`);
166 }
167 }
168}
169
170function resetFilters() {
171 el.filterLevel.value = "";

Callers 5

cleanupLogsFunction · 0.70
clearAllLogsFunction · 0.70
restartAutoRefreshFunction · 0.70
bindEventsFunction · 0.70
logs.jsFile · 0.70

Calls 3

applyCleanupDefaultsFunction · 0.85
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected