|
|
@@ -160,6 +160,7 @@
|
|
|
.status-pending { color: #F59E0B; }
|
|
|
.status-processing { color: #3B82F6; }
|
|
|
.status-success, .status-completed { color: #10B981; }
|
|
|
+.status-partial-success { color: #F97316; }
|
|
|
.status-failed { color: #EF4444; }
|
|
|
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
|
|
|
.custom-scrollbar::-webkit-scrollbar-track { background: #1F2937; }
|
|
|
@@ -355,13 +356,21 @@ function renderImportTasks(data) {
|
|
|
'processing': '<span class="status-processing"><i class="fas fa-spinner fa-spin"></i> 处理中</span>',
|
|
|
'success': '<span class="status-success"><i class="fas fa-check-circle"></i> 已完成</span>',
|
|
|
'completed': '<span class="status-success"><i class="fas fa-check-circle"></i> 已完成</span>',
|
|
|
+ 'partial_success': '<span class="status-partial-success"><i class="fas fa-exclamation-circle"></i> 部分完成</span>',
|
|
|
'failed': '<span class="status-failed"><i class="fas fa-times-circle"></i> 失败</span>',
|
|
|
};
|
|
|
|
|
|
items.forEach(function(item) {
|
|
|
- const progressHtml = item.progress
|
|
|
- ? item.progress.processed + '/' + item.progress.total
|
|
|
- : '-';
|
|
|
+ let progressHtml = '-';
|
|
|
+ if (item.progress) {
|
|
|
+ const p = item.progress;
|
|
|
+ if (p.succeeded !== undefined && p.failed !== undefined) {
|
|
|
+ progressHtml = `<span title="成功 ${p.succeeded} / 失败 ${p.failed} / 总计 ${p.total}">${p.processed || 0}/${p.total}</span>`;
|
|
|
+ } else {
|
|
|
+ progressHtml = p.processed + '/' + p.total;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const hasError = item.status === 'failed' || item.status === 'partial_success';
|
|
|
const html = `<tr class="border-b border-gray-700 hover:bg-gray-700/30 transition-colors">
|
|
|
<td class="px-4 py-3 font-mono text-xs text-gray-300">${item.task_no}</td>
|
|
|
<td class="px-4 py-3 text-white">${item.kb_name || item.kb_id}</td>
|
|
|
@@ -371,7 +380,7 @@ function renderImportTasks(data) {
|
|
|
<td class="px-4 py-3 text-center">
|
|
|
${item.status === 'processing' || item.status === 'pending'
|
|
|
? '<button onclick="refreshTaskStatus(\'' + item.task_no + '\')" class="text-blue-400 hover:text-blue-300 text-xs"><i class="fas fa-sync-alt"></i> 刷新</button>'
|
|
|
- : (item.error_message ? '<span class="text-red-400 text-xs" title="' + item.error_message + '"><i class="fas fa-exclamation-triangle"></i></span>' : '')}
|
|
|
+ : (hasError && item.error_message ? '<span class="text-red-400 text-xs" title="' + item.error_message + '"><i class="fas fa-exclamation-triangle"></i></span>' : '')}
|
|
|
</td>
|
|
|
</tr>`;
|
|
|
tbody.append(html);
|