()
| 2559 | } |
| 2560 | |
| 2561 | async function clearLogs() { |
| 2562 | try { |
| 2563 | const response = await fetch('./logs/clear', { |
| 2564 | method: 'POST', |
| 2565 | headers: getAuthHeaders() |
| 2566 | }); |
| 2567 | |
| 2568 | const data = await response.json(); |
| 2569 | |
| 2570 | if (response.ok) { |
| 2571 | clearLogsDisplay(); |
| 2572 | showStatus(data.message, 'success'); |
| 2573 | } else { |
| 2574 | showStatus(`清空日志失败: ${data.detail || data.error || '未知错误'}`, 'error'); |
| 2575 | } |
| 2576 | } catch (error) { |
| 2577 | clearLogsDisplay(); |
| 2578 | showStatus(`清空日志时网络错误: ${error.message}`, 'error'); |
| 2579 | } |
| 2580 | } |
| 2581 | |
| 2582 | function filterLogs() { |
| 2583 | const filter = document.getElementById('logLevelFilter').value; |
nothing calls this directly
no test coverage detected