已有同步任务时直接显示进度条,不再弹阻塞提示
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -267,11 +267,9 @@ function startSync(url) {
|
||||
.then(function(r) { return r.json(); })
|
||||
.then(function(data) {
|
||||
if (!data.ok) {
|
||||
document.getElementById('sync-progress-label').textContent = '已有同步任务进行中,请稍后再试';
|
||||
document.getElementById('sync-progress-pct').textContent = '';
|
||||
document.getElementById('sync-progress-bar').style.width = '0%';
|
||||
document.getElementById('sync-progress').insertAdjacentHTML('beforeend',
|
||||
'<button onclick="hideProgress()" style="display:block;margin-top:10px;padding:4px 14px;border:1px solid var(--border);border-radius:5px;background:var(--surface);color:var(--fg);cursor:pointer;font-size:0.8rem;">关闭</button>');
|
||||
// Another sync is already running — just show its progress
|
||||
syncTimer = setInterval(pollProgress, 500);
|
||||
pollProgress();
|
||||
return;
|
||||
}
|
||||
syncTimer = setInterval(pollProgress, 500);
|
||||
|
||||
Reference in New Issue
Block a user