修复代码审查反馈: event参数传递 + 刷新倒计时提示

Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/98f7f760-839a-42c7-b716-fa39b6021391

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-08 03:46:04 +00:00 committed by GitHub
parent 9e7c40a025
commit ca1d75494d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 5 deletions

View File

@ -891,7 +891,7 @@ mode: direct
<div class="stat-row"><span class="stat-label">加速池人数</span><span class="stat-value" id="poolContributors">${bwPoolInfo.active_contributors}人在线 / ${bwPoolInfo.total_contributors}</span></div>
${bwContribAuthTime ? '<div class="stat-row"><span class="stat-label">授权时间</span><span class="stat-value" style="font-size:0.8em;color:#aaa;">' + new Date(bwContribAuthTime).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) + '</span></div>' : ''}
<div style="margin-top: 10px; text-align: center;">
<button class="refresh-btn" onclick="refreshAccelStatus()">🔄 刷新加速状态</button>
<button class="refresh-btn" onclick="refreshAccelStatus(event)">🔄 刷新加速状态</button>
</div>
</div>
@ -970,8 +970,8 @@ var dashIdx = window.location.pathname.indexOf('/dashboard/');
var bwBasePath = dashIdx >= 0 ? window.location.pathname.substring(0, dashIdx) : '';
// 刷新加速状态 (从带宽池API获取最新数据)
function refreshAccelStatus() {
var btn = event.target;
function refreshAccelStatus(e) {
var btn = e.target;
btn.textContent = '⏳ 刷新中...';
btn.disabled = true;
@ -1091,9 +1091,14 @@ function bwVerifyCode() {
document.getElementById('speedBoostStatus').textContent = '✅ 已开启';
var badge = document.getElementById('accelBadge');
if (badge) { badge.textContent = '加速中'; badge.className = 'accel-badge accel-on'; }
result.textContent = (data.message || '授权成功!') + ' 刷新页面查看完整状态';
result.textContent = (data.message || '授权成功!') + ' 3秒后自动刷新...';
// 3秒后自动刷新页面加载最新服务器状态
setTimeout(function() { window.location.reload(); }, 3000);
var cd2 = 3;
var reloadTimer = setInterval(function() {
cd2--;
result.textContent = '✅ 授权成功!' + cd2 + '秒后自动刷新...';
if (cd2 <= 0) { clearInterval(reloadTimer); window.location.reload(); }
}, 1000);
} else {
result.style.background = '#3a1a1a';
result.style.color = '#e74c3c';