🧹 清理调试日志

- 移除日志弹窗调试日志
- 移除openModal调试日志
- 移除账号API调试日志
- 移除账号加载调试日志

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-10 20:11:18 +08:00
parent fc7ef70259
commit 2e7dc95d55
2 changed files with 5 additions and 43 deletions

View File

@@ -1331,45 +1331,28 @@
if (schedule) openScheduleModal(schedule);
}
function viewScheduleLogs(scheduleId) {
console.log('[日志弹窗] 开始查看日志, scheduleId=', scheduleId, '(类型:', typeof scheduleId + ')');
console.log('[日志弹窗] 当前schedules数组:', schedules);
// 类型转换确保兼容性
function viewScheduleLogs(scheduleId) {
const numericId = parseInt(scheduleId, 10);
const schedule = schedules.find(s => s.id == numericId); // 使用宽松相等
const schedule = schedules.find(s => s.id == numericId);
if (!schedule) {
console.error('[日志弹窗] 未找到任务, scheduleId=', scheduleId);
console.error('[日志弹窗] 可用的任务IDs:', schedules.map(s => s.id));
showToast('未找到该定时任务', 'error');
return;
}
console.log('[日志弹窗] 找到任务:', schedule);
document.getElementById("scheduleLogsTitle").textContent = "【" + (schedule.name || "未命名任务") + "】 执行日志";
console.log('[日志弹窗] 开始请求API');
fetch("/api/schedules/" + numericId + "/logs?limit=20")
.then(r => {
console.log('[日志弹窗] API响应状态:', r.status);
return r.json();
})
.then(r => r.json())
.then(logs => {
console.log('[日志弹窗] 收到日志数据:', logs);
const container = document.getElementById("scheduleLogsList");
if (!container) {
console.error('[日志弹窗] 找不到日志容器元素 scheduleLogsList');
showToast('页面元素加载异常', 'error');
return;
}
if (!logs || logs.length === 0) {
console.log('[日志弹窗] 无日志,显示空状态');
container.innerHTML = "<div class=\"empty-state\"><p>暂无执行日志</p></div>";
} else {
console.log('[日志弹窗] 渲染', logs.length, '条日志');
let html = "<div style=\"display: flex; flex-direction: column; gap: 12px;\">";
logs.forEach(log => {
const statusClass = log.status === "success" ? "status-completed" : (log.status === "failed" ? "status-error" : "status-running");
@@ -1390,12 +1373,9 @@
container.innerHTML = html;
}
console.log('[日志弹窗] 准备打开弹窗');
openModal("scheduleLogsModal");
console.log('[日志弹窗] 弹窗已打开');
})
.catch(err => {
console.error('[日志弹窗] 请求失败:', err);
showToast("加载日志失败", "error");
});
}
@@ -1735,13 +1715,7 @@
// ==================== 通用函数 ====================
function openModal(id) {
const element = document.getElementById(id);
console.log('[openModal] 打开弹窗:', id, '元素:', element);
if (element) {
element.classList.add('active');
console.log('[openModal] 已添加active类, classList:', element.classList);
} else {
console.error('[openModal] 未找到元素:', id);
}
if (element) element.classList.add('active');
}
function closeModal(id) {
const element = document.getElementById(id);