修复三个关键Bug
1. 修复定时任务设置时间不执行问题 - 将定时任务检查频率从60秒提升到5秒 - 确保定时任务在设定时间准时执行 - 位置: app.py 第3010-3011行 2. 修复账号管理卡片设置按钮无法点击问题 - 修正JavaScript引号转义错误 - 位置: templates/index.html 第886行 3. 修复用户反馈和后台反馈进度不同步问题 - 前端改为检查status字段而非reply字段 - 新增closed状态支持 - 正确显示待处理/已回复/已关闭三种状态 - 位置: templates/index.html 第249-251行, 第1550-1567行 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
4
app.py
4
app.py
@@ -3007,8 +3007,8 @@ def scheduled_task_worker():
|
||||
# 执行待执行的任务
|
||||
schedule.run_pending()
|
||||
|
||||
# 每60秒重新检查一次配置
|
||||
if time.time() - last_check > 60:
|
||||
# 每5秒重新检查一次配置(提高检查频率以确保定时任务准时执行)
|
||||
if time.time() - last_check > 5:
|
||||
check_and_schedule()
|
||||
check_user_schedules() # 检查用户定时任务
|
||||
last_check = time.time()
|
||||
|
||||
@@ -248,6 +248,7 @@
|
||||
.feedback-item-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; margin-left: 8px; }
|
||||
.feedback-status-pending { background: #FFF3E0; color: #EF6C00; }
|
||||
.feedback-status-replied { background: #E8F5E9; color: #2E7D32; }
|
||||
.feedback-status-closed { background: #ECEFF1; color: #546E7A; }
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.sidebar { width: 100%; position: fixed; top: auto; bottom: 0; height: 60px; border-right: none; border-top: 1px solid var(--md-divider); display: flex; overflow-x: auto; }
|
||||
@@ -882,7 +883,7 @@
|
||||
'</select>' +
|
||||
'<button class="btn btn-primary btn-small" onclick="startAccount(\'' + acc.id + '\')" ' + (isRunning ? 'disabled' : '') + '>启动</button>' +
|
||||
'<button class="btn btn-outlined btn-small" onclick="stopAccount(\'' + acc.id + '\')" ' + (!isRunning ? 'disabled' : '') + '>停止</button>' +
|
||||
'<button class="btn btn-primary btn-small" onclick="openEditAccountModal('' + acc.id + ''')" title="设置" style="background: #FFA726; border-color: #FFA726;" ' + (isRunning ? 'disabled' : '') + '>⚙️ 设置</button>' +
|
||||
'<button class="btn btn-primary btn-small" onclick="openEditAccountModal(\'' + acc.id + '\')" title="设置" style="background: #FFA726; border-color: #FFA726;" ' + (isRunning ? 'disabled' : '') + '>⚙️ 设置</button>' +
|
||||
'<button class="btn btn-text btn-small" onclick="deleteAccount(\'' + acc.id + '\')" title="删除">🗑️</button>' +
|
||||
'</div></div>';
|
||||
}
|
||||
@@ -1547,13 +1548,22 @@
|
||||
}
|
||||
let html = '';
|
||||
data.forEach(function(f) {
|
||||
const statusClass = f.reply ? 'feedback-status-replied' : 'feedback-status-pending';
|
||||
const statusText = f.reply ? '已回复' : '待处理';
|
||||
// 根据status字段确定状态显示
|
||||
let statusClass = 'feedback-status-pending';
|
||||
let statusText = '待处理';
|
||||
if (f.status === 'replied') {
|
||||
statusClass = 'feedback-status-replied';
|
||||
statusText = '已回复';
|
||||
} else if (f.status === 'closed') {
|
||||
statusClass = 'feedback-status-closed';
|
||||
statusText = '已关闭';
|
||||
}
|
||||
|
||||
html += '<div class="feedback-item">' +
|
||||
'<div class="feedback-item-title">' + escapeHtml(f.title) +
|
||||
'<span class="feedback-item-status ' + statusClass + '">' + statusText + '</span></div>' +
|
||||
'<div class="feedback-item-time">' + f.created_at + '</div>' +
|
||||
(f.reply ? '<div style="margin-top: 8px; padding: 8px; background: #f5f5f5; border-radius: 4px; font-size: 13px;"><strong>回复:</strong> ' + escapeHtml(f.reply) + '</div>' : '') +
|
||||
(f.admin_reply ? '<div style="margin-top: 8px; padding: 8px; background: #f5f5f5; border-radius: 4px; font-size: 13px;"><strong>回复:</strong> ' + escapeHtml(f.admin_reply) + '</div>' : '') +
|
||||
'</div>';
|
||||
});
|
||||
container.innerHTML = html;
|
||||
|
||||
Reference in New Issue
Block a user