(silent = false)
| 111 | } |
| 112 | |
| 113 | async function loadLogs(silent = false) { |
| 114 | if (!silent) { |
| 115 | loading.show(el.refreshBtn, "加载中..."); |
| 116 | } |
| 117 | try { |
| 118 | const query = buildLogParams(); |
| 119 | const data = await api.get(`/logs?${query}`); |
| 120 | logsState.total = Number(data.total || 0); |
| 121 | renderLogs(data.logs || []); |
| 122 | setLogsSummary(); |
| 123 | } catch (error) { |
| 124 | toast.error(`加载日志失败: ${error?.message || error}`); |
| 125 | } finally { |
| 126 | if (!silent) { |
| 127 | loading.hide(el.refreshBtn); |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | function applyCleanupDefaults(data) { |
| 133 | if (logsState.cleanupDefaultsHydrated) { |
no test coverage detected