feat: 添加 Toast 通知系统,替换所有 alert() 调用
This commit is contained in:
@@ -405,7 +405,7 @@
|
||||
const base = document.getElementById('select-base').value;
|
||||
const head = document.getElementById('select-head').value;
|
||||
if (!base || !head) {
|
||||
alert('请选择 Base 和 Head 分支');
|
||||
showToast('请选择 Base 和 Head 分支', 'warning');
|
||||
return;
|
||||
}
|
||||
DiffViewer.loadDiff(repoId, base, head);
|
||||
@@ -436,7 +436,7 @@
|
||||
const base = document.getElementById('select-base').value;
|
||||
const head = document.getElementById('select-head').value;
|
||||
if (!base || !head) {
|
||||
alert('请先选择 Base 和 Head 并查看 Diff');
|
||||
showToast('请先选择 Base 和 Head 并查看 Diff', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@
|
||||
viewLink.href = `/repo/${repoId}/review?base=${encodeURIComponent(base)}&head=${encodeURIComponent(head)}`;
|
||||
},
|
||||
error(data) {
|
||||
alert('审查失败: ' + (data.message || '未知错误'));
|
||||
showToast('审查失败: ' + (data.message || '未知错误'), 'error');
|
||||
progress.classList.add('hidden');
|
||||
btn.disabled = false;
|
||||
btn.textContent = '🤖 AI 评审';
|
||||
|
||||
Reference in New Issue
Block a user