feat: 添加 Toast 通知系统,替换所有 alert() 调用
This commit is contained in:
@@ -229,7 +229,7 @@
|
||||
const topN = document.getElementById('top-n').value;
|
||||
|
||||
if (!baseRef || !headRef) {
|
||||
alert('请选择 Base 和 Head 分支');
|
||||
showToast('请选择 Base 和 Head 分支', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@
|
||||
NoteEditor.loadNotes();
|
||||
},
|
||||
error(data) {
|
||||
alert('审查失败: ' + (data.message || '未知错误'));
|
||||
showToast('审查失败: ' + (data.message || '未知错误'), 'error');
|
||||
progress.classList.add('hidden');
|
||||
btn.disabled = false;
|
||||
btn.textContent = '开始审查';
|
||||
@@ -471,7 +471,7 @@
|
||||
|
||||
const result = data.result;
|
||||
if (!result || !result.file_reviews) {
|
||||
alert('该历史记录没有完整的评审数据');
|
||||
showToast('该历史记录没有完整的评审数据', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@
|
||||
|
||||
} catch (e) {
|
||||
console.error('Load history error:', e);
|
||||
alert('加载历史评审失败: ' + e.message);
|
||||
showToast('加载历史评审失败: ' + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user