MCPcopy Create free account
hub / github.com/su-kaka/gcli2api / clearLogs

Function clearLogs

front/common.js:2561–2580  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2559}
2560
2561async 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
2582function filterLogs() {
2583 const filter = document.getElementById('logLevelFilter').value;

Callers

nothing calls this directly

Calls 3

getAuthHeadersFunction · 0.85
clearLogsDisplayFunction · 0.85
showStatusFunction · 0.85

Tested by

no test coverage detected