mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-08-20 01:47:35 +02:00
Add files via upload
This commit is contained in:
@@ -6112,6 +6112,9 @@ header {
|
|||||||
.batch-manage-modal-content {
|
.batch-manage-modal-content {
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
max-height: 85vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.batch-manage-header-actions {
|
.batch-manage-header-actions {
|
||||||
@@ -6146,8 +6149,12 @@ header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.batch-manage-body {
|
.batch-manage-body {
|
||||||
max-height: 60vh;
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.batch-conversations-table {
|
.batch-conversations-table {
|
||||||
@@ -6241,6 +6248,7 @@ header {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 16px 24px;
|
padding: 16px 24px;
|
||||||
border-top: 1px solid var(--border-color);
|
border-top: 1px solid var(--border-color);
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-all-checkbox {
|
.select-all-checkbox {
|
||||||
|
|||||||
+47
-4
@@ -1449,7 +1449,6 @@ async function loadConversations(searchQuery = '') {
|
|||||||
url += '&search=' + encodeURIComponent(searchQuery.trim());
|
url += '&search=' + encodeURIComponent(searchQuery.trim());
|
||||||
}
|
}
|
||||||
const response = await apiFetch(url);
|
const response = await apiFetch(url);
|
||||||
const conversations = await response.json();
|
|
||||||
|
|
||||||
const listContainer = document.getElementById('conversations-list');
|
const listContainer = document.getElementById('conversations-list');
|
||||||
if (!listContainer) {
|
if (!listContainer) {
|
||||||
@@ -1459,6 +1458,14 @@ async function loadConversations(searchQuery = '') {
|
|||||||
const emptyStateHtml = '<div style="padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.875rem;">暂无历史对话</div>';
|
const emptyStateHtml = '<div style="padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.875rem;">暂无历史对话</div>';
|
||||||
listContainer.innerHTML = '';
|
listContainer.innerHTML = '';
|
||||||
|
|
||||||
|
// 如果响应不是200,显示空状态(友好处理,不显示错误)
|
||||||
|
if (!response.ok) {
|
||||||
|
listContainer.innerHTML = emptyStateHtml;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const conversations = await response.json();
|
||||||
|
|
||||||
if (!Array.isArray(conversations) || conversations.length === 0) {
|
if (!Array.isArray(conversations) || conversations.length === 0) {
|
||||||
listContainer.innerHTML = emptyStateHtml;
|
listContainer.innerHTML = emptyStateHtml;
|
||||||
return;
|
return;
|
||||||
@@ -1533,6 +1540,12 @@ async function loadConversations(searchQuery = '') {
|
|||||||
updateActiveConversation();
|
updateActiveConversation();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载对话列表失败:', error);
|
console.error('加载对话列表失败:', error);
|
||||||
|
// 错误时显示空状态,而不是错误提示(更友好的用户体验)
|
||||||
|
const listContainer = document.getElementById('conversations-list');
|
||||||
|
if (listContainer) {
|
||||||
|
const emptyStateHtml = '<div style="padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.875rem;">暂无历史对话</div>';
|
||||||
|
listContainer.innerHTML = emptyStateHtml;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4056,7 +4069,6 @@ async function loadConversationsWithGroups(searchQuery = '') {
|
|||||||
url += '&search=' + encodeURIComponent(searchQuery.trim());
|
url += '&search=' + encodeURIComponent(searchQuery.trim());
|
||||||
}
|
}
|
||||||
const response = await apiFetch(url);
|
const response = await apiFetch(url);
|
||||||
const conversations = await response.json();
|
|
||||||
|
|
||||||
const listContainer = document.getElementById('conversations-list');
|
const listContainer = document.getElementById('conversations-list');
|
||||||
if (!listContainer) {
|
if (!listContainer) {
|
||||||
@@ -4066,6 +4078,14 @@ async function loadConversationsWithGroups(searchQuery = '') {
|
|||||||
const emptyStateHtml = '<div style="padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.875rem;">暂无历史对话</div>';
|
const emptyStateHtml = '<div style="padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.875rem;">暂无历史对话</div>';
|
||||||
listContainer.innerHTML = '';
|
listContainer.innerHTML = '';
|
||||||
|
|
||||||
|
// 如果响应不是200,显示空状态(友好处理,不显示错误)
|
||||||
|
if (!response.ok) {
|
||||||
|
listContainer.innerHTML = emptyStateHtml;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const conversations = await response.json();
|
||||||
|
|
||||||
if (!Array.isArray(conversations) || conversations.length === 0) {
|
if (!Array.isArray(conversations) || conversations.length === 0) {
|
||||||
listContainer.innerHTML = emptyStateHtml;
|
listContainer.innerHTML = emptyStateHtml;
|
||||||
return;
|
return;
|
||||||
@@ -4136,6 +4156,12 @@ async function loadConversationsWithGroups(searchQuery = '') {
|
|||||||
updateActiveConversation();
|
updateActiveConversation();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载对话列表失败:', error);
|
console.error('加载对话列表失败:', error);
|
||||||
|
// 错误时显示空状态,而不是错误提示(更友好的用户体验)
|
||||||
|
const listContainer = document.getElementById('conversations-list');
|
||||||
|
if (listContainer) {
|
||||||
|
const emptyStateHtml = '<div style="padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.875rem;">暂无历史对话</div>';
|
||||||
|
listContainer.innerHTML = emptyStateHtml;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4988,7 +5014,14 @@ let allConversationsForBatch = [];
|
|||||||
async function showBatchManageModal() {
|
async function showBatchManageModal() {
|
||||||
try {
|
try {
|
||||||
const response = await apiFetch('/api/conversations?limit=1000');
|
const response = await apiFetch('/api/conversations?limit=1000');
|
||||||
allConversationsForBatch = await response.json();
|
|
||||||
|
// 如果响应不是200,使用空数组(友好处理,不显示错误)
|
||||||
|
if (!response.ok) {
|
||||||
|
allConversationsForBatch = [];
|
||||||
|
} else {
|
||||||
|
const data = await response.json();
|
||||||
|
allConversationsForBatch = Array.isArray(data) ? data : [];
|
||||||
|
}
|
||||||
|
|
||||||
const modal = document.getElementById('batch-manage-modal');
|
const modal = document.getElementById('batch-manage-modal');
|
||||||
const countEl = document.getElementById('batch-manage-count');
|
const countEl = document.getElementById('batch-manage-count');
|
||||||
@@ -5002,7 +5035,17 @@ async function showBatchManageModal() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载对话列表失败:', error);
|
console.error('加载对话列表失败:', error);
|
||||||
alert('加载对话列表失败');
|
// 错误时使用空数组,不显示错误提示(更友好的用户体验)
|
||||||
|
allConversationsForBatch = [];
|
||||||
|
const modal = document.getElementById('batch-manage-modal');
|
||||||
|
const countEl = document.getElementById('batch-manage-count');
|
||||||
|
if (countEl) {
|
||||||
|
countEl.textContent = 0;
|
||||||
|
}
|
||||||
|
if (modal) {
|
||||||
|
renderBatchConversations();
|
||||||
|
modal.style.display = 'flex';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user