fix: Update debug image handling and enhance reservation display

- Added a configuration option in `config.json` to enable or disable debug image saving, defaulting to false for improved performance.
- Updated the GUI and web interface to display reservation details in Chinese, enhancing readability and user experience.
- Adjusted the click coordinates for joining the fan club and added logic to close the details page after joining.
- Cleaned up blank lines across multiple files to improve code readability and maintainability.
This commit is contained in:
Your Name committed 2025-12-26 15:09:18 +08:00
1 parent 5d22250b05
commit 36b39b1fac
35 files changed
+2863 -46

No files matched your search

+21 -9
View File
@@ -57,6 +57,7 @@ const DEFAULTS = {
fudai_quiet_end_hour: 7,
// 调试相关
"debug_captures.enabled": false,
"debug_captures.auto_cleanup": true,
"debug_captures.keep_days": 7,
"debug_captures.max_files": 2000,
@@ -804,16 +805,16 @@ async function pollReservations() {
const current_room_title_raw = data.current_room_title_raw || "";
const reason = data.reason || "";
// 显示基本信息
// 显示基本信息(中文)
const info = document.createElement("div");
info.className = "reservationsInfo";
info.innerHTML = `
<div><strong>当前位置:</strong>${room_pos}</div>
<div><strong>当前直播间位置:</strong>${room_pos}</div>
<div><strong>当前直播间(清洗后):</strong>${escapeHtml(current_room_title || '-') }</div>
<div><strong>当前直播间原文:</strong>${escapeHtml(current_room_title_raw || '-') }</div>
<div><strong>预约数量:</strong>${reservations.length}</div>
<div class="hint">更新时间:${updated_ts > 0 ? new Date(updated_ts * 1000).toLocaleTimeString() : '-'}</div>
<div class="hint">原因:${escapeHtml(reason || '-') }</div>
<div><strong>预约总数量:</strong>${reservations.length}</div>
<div class="hint">更新时间:${updated_ts > 0 ? new Date(updated_ts * 1000).toLocaleString() : '-'}</div>
<div class="hint">最近更新原因:${escapeHtml(reason || '-') }</div>
`;
container.appendChild(info);
@@ -825,7 +826,7 @@ async function pollReservations() {
return;
}
// 显示预约列表
// 显示预约列表(更详细中文)
const list = document.createElement("div");
list.className = "reservationsList";
@@ -836,20 +837,31 @@ async function pollReservations() {
const now = Date.now() / 1000;
const future_ts = item.future_ts || 0;
const remain = Math.max(0, Math.floor(future_ts - now));
const remainStr = remain > 0 ? `${Math.floor(remain / 60)}分${remain % 60}秒后` : "已到开奖时间";
const remainStr = remain > 0 ? `${Math.floor(remain / 60)}分${remain % 60}秒后开奖` : "已到开奖时间";
const createdTs = item.created_ts || 0;
let createdStr = "-";
if (createdTs > 0) {
try {
createdStr = new Date(createdTs * 1000).toLocaleString();
} catch (e) {
createdStr = String(createdTs);
}
}
card.innerHTML = `
<div class="reservationHeader">
<span class="reservationIndex">#${idx + 1}</span>
<span class="reservationValue">${item.prize_value_yuan || 0}元</span>
<span class="reservationValue">${item.prize_value_yuan || 0} 元</span>
</div>
<div class="reservationBody">
<div><strong>内容:</strong>${escapeHtml(item.content || '-')}</div>
<div><strong>开奖时间:</strong>${item.future_str || '-'}</div>
<div><strong>剩余时间:</strong>${remainStr}</div>
<div><strong>发现位置:</strong>${item.pos_seen || 0}</div>
<div><strong>发现时直播间位置:</strong>${item.pos_seen || 0}</div>
<div><strong>直播间(清洗后):</strong>${escapeHtml(item.room_title || '-')}</div>
<div><strong>直播间原文:</strong>${escapeHtml(item.room_title_raw || '-')}</div>
<div><strong>记录时间:</strong>${createdStr}</div>
</div>
`;
list.appendChild(card);